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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
1,640 Views
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.

Tags (3)
0 Kudos
Reply
1 Solution
1,604 Views
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

 

 

View solution in original post

0 Kudos
Reply
2 Replies
1,605 Views
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 Kudos
Reply
1,554 Views
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 Kudos
Reply