Ask a question about UsageFault abnormal interruption

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

Ask a question about UsageFault abnormal interruption

1,437件の閲覧回数
caiguanyun
Contributor I

Hello everyone, I would like to ask a question about the abnormal interruption of UsageFault. There are two S32K144 boards in the mass-produced products of the customer that are constantly reset (there is a watchdog) (the boards of other products are normal, and it is normal to burn the same set of software to other boards. ) There is a UsageFault abnormal interrupt, we use Lauterbach to locate the error in the INVSTATE status bit and cause the UsageFault abnormal interrupt. What is the reason for the error of the INVSTATE status bit?

The following is the analysis test situation:

We got the HEX file that the customer gave to close the watchdog, and burned it to the abnormal chip for testing. Use Lauterbach to read the core register of S32K144, after running at full speed, it is stuck at address 0x478.

caiguanyun_1-1656409658524.png

Check the kernel register and find the UsageFault interrupt exception, and check the kernel register and find that the Error in the INVSTATE status bit causes the UsageFault interrupt exception.

caiguanyun_2-1656409708250.png

The following figure is the description of the status bit

caiguanyun_3-1656409742380.png

According to the description in the following figure, it can be seen that when EPSR.T==0, attempting to execute the instruction results in a UsageFault

caiguanyun_4-1656409764278.pngcaiguanyun_5-1656409770914.pngcaiguanyun_6-1656409778634.png

 

0 件の賞賛
返信
4 返答(返信)

1,418件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @caiguanyun,

The instruction b.w 0x478 at 0x478 can be something like while(1){}.

I don't think this is the root cause here.

Can you halt the execution in the Hard Fault handler (or Usage Fault handler if enabled) and read the Stack?

You should find the fault instruction on the stack.

Please follow this document / sample code:

https://community.nxp.com/t5/S32K-Knowledge-Base/Fault-handling-on-S32K14x/ta-p/1114447

 

Regards,

Daniel

 

0 件の賞賛
返信

1,406件の閲覧回数
caiguanyun
Contributor I

The customer has only two boards in the INVSTATE state, which leads to the abnormal interruption of the UsageFault. The other same boards are running normally. Is it a software problem or a hardware problem?

0 件の賞賛
返信

1,400件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @caiguanyun,

Hard to say at this moment.

Please find the the PC address of the fault exception on the stack.

The code that you showed is probably while(1){} loop in the UsageFault_Handler() and the MCU is waiting for WDOG reset, correct?

If so, you should be able to open the memory window, locate the Stack and the PC address of the fault instruction on the Stack.

Then, in Disassembly window, you can find the instruction.

 

BR, Daniel

0 件の賞賛
返信

1,391件の閲覧回数
caiguanyun
Contributor I

No, because I don't have the client code, I can't debug it, so I can only ask the client to turn off the watchdog of the program. When the program runs away abnormally, I can use Lauterbach to check the kernel register value.

The following picture shows the whole process of customer debug debugging and analysis. By viewing the disassembly window, it is found that it is caused by the use of addresses outside the SRAM area.

caiguanyun_0-1656844916273.pngcaiguanyun_1-1656844932566.pngcaiguanyun_2-1656844943672.pngcaiguanyun_3-1656844954035.pngcaiguanyun_4-1656844964191.png

 

Also please help to analyze the reason, thank you very much,If you have any questions, please email me, Email: caiguanyun@zlgmcu.com

0 件の賞賛
返信