UART Rx won't restart after interruption to Rx data

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

UART Rx won't restart after interruption to Rx data

91 Views
johngreenjets
Contributor III

I have created a model to receive UART based on the Simulink example code 'lpuart_s32k14x.mdl'.

I had to modify it slightly, because I need to receive 10 continuous bytes of data sent at a 100ms cycle rate.

The code works fine, until the UART data is interrupted such as:

  • disconnected from the external transmitter
  • external transmitter is powered down
  • debugger halted and restarted

When the UART data transmission restarts , the code does not receive the data unless the processor is reset.

I imported the generated code xml project into S32DS and set breakpoint in the function LPUART_DRV_ErrIrqHandler (in lpuart_driver.c). 

I set a break point in each of the error types...

  • Overrun
  • Framing error
  • Parity error
  • Noise detect

When I disconnect the serial data, I get a framing error.

When I power down the transmitter, I get a noise error.

When I pause the debugger, I get an overrun error.

I also noticed that the LPUART0.CTRL register has the value 0x0F240000 when its working and 0x00000000 when it stops working.

I need the software to automatically recover from these errors once the fault has been removed (with the exception of the paused debugger as this would only happen during debugging).

How do I achieve this ?

The generated code xml project is attached for reference (HUMS_mbd_rtw.zip)

0 Kudos
Reply
0 Replies