Bus Fault stack frame content

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Bus Fault stack frame content

777 次查看
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 回复数

753 次查看
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 项奖励
回复

709 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @GlebPlekhotko 

 

Thanks for your sharing.

 

BR

Alice

0 项奖励
回复