Bus Fault stack frame content

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bus Fault stack frame content

1,408 Views
GlebPlekhotko
Contributor II

This question follows my note in regard to the failing flash memory access under the certain conditions. The question is the following. Why does the fault's stack frame does not match the expectations?

The exception occurs at the following instruction:

GlebPlekhotko_1-1691608366154.png

Upon the Bus Fault handler arrival I'm expecting to find a valid PC value in the stack frame, but instead I'm having the following content:

GlebPlekhotko_2-1691608658942.png

The stack frame pointed by the SP register has nothing in common with the core's state right before the exception. Moreover, the position which should be occupied by the PC value is pointing to the location beyond the RAM, which in the LPC5528 occupies the range 0x20000000 to 0x0x2002FFFF.

What is the reason?

Labels (1)
0 Kudos
Reply
2 Replies

1,384 Views
GlebPlekhotko
Contributor II

Oops, my bad!

I didn't pay attention to the LR register. Its value in the exception handler is 0xFFFFFFBC, which according to the documentation says, that stack frame is located in the process stack, not in the main one. And I've been looking exactly at the latter in the previous message.

Here is how it looks like in fact:

GlebPlekhotko_0-1691612144459.png

The SP value right before fault is 0x200090E0. So the exception stack frame is right below the address. And there one may find the address of the instruction which has caused the fault. It is 0x0002C09C, like expected.

 

0 Kudos
Reply

1,340 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @GlebPlekhotko 

 

Thanks for your sharing.

 

BR

Alice

0 Kudos
Reply