Bus Fault stack frame content

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Bus Fault stack frame content

1,411件の閲覧回数
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?

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

1,387件の閲覧回数
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 件の賞賛
返信

1,343件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @GlebPlekhotko 

 

Thanks for your sharing.

 

BR

Alice

0 件の賞賛
返信