S32K312 Hardfault

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

S32K312 Hardfault

2,722件の閲覧回数
rexoplans
Contributor III

Hello, I'm encountering a hardfault on the NXP s32k312 microcontroller. According to the HFSR register, it appears to be FORCED, and I see an address in the BFAR register. However, I can't figure out what this address points to. (It doesn't seem to point to any location in RAM or Program Flash.) Below are the values generated during the error. I would appreciate your assistance.

 

--Stack Frame--
R0:2
R1:20416140
R2:20416330
R3:0
R12:40
LR:41e1d9
PC:41e1d8
PSR:61000000
--Fault Register--
CFSR:8200
HFSR:40000000
DFSR:0
BFAR:f05c2078

タグ(2)
0 件の賞賛
返信
6 返答(返信)

2,694件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport
0 件の賞賛
返信

2,693件の閲覧回数
rexoplans
Contributor III

@danielmartynek  My CFSR value is 8200, I'll review the documents. By the way, I'm also using FreeRTOS

0 件の賞賛
返信

2,684件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

The program must have run away, becasue the core accesses an unimplemented memory location.

You should be able to find the PC address of this precise bus fault instruction on the stack.

 

0 件の賞賛
返信

2,662件の閲覧回数
rexoplans
Contributor III
But I cant, PC value is invalid. My PC value is 41e1d8 but MCU end addres is 0x40403c( HSE host end addr on flash).
0 件の賞賛
返信

2,630件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

If you halt the core in the HardFault_Handler(), find the SP value in the core registers.

Then, open the memory view at this SP address and read the stacked context.

You should find the PC address of the fault instruction there

It is explained in the documents I linked.

 

Regards,

Daniel

0 件の賞賛
返信

2,628件の閲覧回数
rexoplans
Contributor III
Thank you for the information, but I am aware of this. I suspected a stack overflow and I found it. While searching for it, I utilized a feature of gdb. Thank you for your help
0 件の賞賛
返信