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,639件の閲覧回数
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,603件の閲覧回数
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,604件の閲覧回数
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,553件の閲覧回数
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 件の賞賛
返信