How to print register in fault handler function using lpuart in S32K144

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

How to print register in fault handler function using lpuart in S32K144

跳至解决方案
1,651 次查看
huangkenny
Contributor II

Hi all,

I'm trying to catch some unexpected exception without debugger.

By reference the following example, I was able to catch different kind of error by debugger(pemicro)

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

However, I want to use lpuart to print it out on terminal by simply using 

LPUART_DRV_SendData before the while loop, end of the exception function, but it seems not working.

 

Are there any more step to do so? Or some kind of configuration is missing?

 

PS: the LPUART_DRV_SendData is working properly when normal application is running.

Thanks a lot.

标记 (3)
0 项奖励
回复
1 解答
1,615 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @huangkenny,

The LPUART driver uses interrupts, and interrupts cannot preempt the HardFault exception that has a higher priority. Theoretically, you should be able to use the other three exception handlers with lover priorities than the priority of the LPUART interrupts. Or you can reinitialize the LPUART and use simple baremetal code to send the data without the SDK/RTD LPUART driver.

Refer to the AN5413 cookbook:

https://www.nxp.com/docs/en/application-note/AN5413.pdf

https://www.nxp.com/webapp/Download?colCode=AN5413SW&docLang=en

 

Regards,

Daniel

 

 

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,616 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @huangkenny,

The LPUART driver uses interrupts, and interrupts cannot preempt the HardFault exception that has a higher priority. Theoretically, you should be able to use the other three exception handlers with lover priorities than the priority of the LPUART interrupts. Or you can reinitialize the LPUART and use simple baremetal code to send the data without the SDK/RTD LPUART driver.

Refer to the AN5413 cookbook:

https://www.nxp.com/docs/en/application-note/AN5413.pdf

https://www.nxp.com/webapp/Download?colCode=AN5413SW&docLang=en

 

Regards,

Daniel

 

 

0 项奖励
回复
1,565 次查看
huangkenny
Contributor II

Hi @danielmartynek 

Thanks for pointing out! 

I have enabled three other exception handler and modify the priority, and now I can print out with lpuart without problem.

Thanks,

Kenny

0 项奖励
回复