I have created a model to receive UART based on the 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:
When the UART data transmission restarts , the code does not receive the data unless the processor is reset.
I cannot find what is causing the fault or how to handle resetting the fault so that it automatically starts receiving data again.
The only thing I've noticed is that the LPUART0.CTRL register has the value 0x0F240000 when its working and 0x00000000 when it stops working.
Whats causing the issue and how can I resolve this ?
The model is attached for reference (LPUART_RX.zip)
For reference, below is a scope trace of the UART data....
The UART data contains the following parameters:
I imported the 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...
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 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 ?
Also, I noticed that the LPUART0 ISR block has options for:
If these are enabled, it means the subsystem will be triggered if any one of those events occur.
But then when the subsystem is triggered, how do you determine which event caused the trigger ?