s32k lpuart A routine that receives data of varying length

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

s32k lpuart A routine that receives data of varying length

627 Views
yu1
Contributor I

s32k lpuart A routine that receives data of varying length as well as serial idle interrupt detection.

0 Kudos
Reply
2 Replies

616 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I am not aware of such example. Also I think the idle detection is not implemented within recent SDK/RTD drivers.

Generally, you can enable both the RX data register full and RX idle interrupts. Whenever data is received, the RX interrupt handler reads the received byte and stores it in a buffer if there is enough space. If an idle interrupt is detected, you will copy/process the received data from buffer. Using a circular receive buffer can be more efficient than copying data from a linear buffer to an output buffer, as it allows for continuous reception of data without the need to stop and start the receive operation. DMA can be used as well for reading data into buffer.
Implementation can be easier if you know e.g. if some delimiter character marks the end of a message or the length of the data to be transmitted is included at beginning etc.

BR, Petr

0 Kudos
Reply

490 Views
Adarshnanda
Contributor II

Hey @PetrS ,

How can I use the Rx idle detection interrupts in NXP s32k? I am using the UART_PAL driver and using callback for the reception purpose. I am only able to check for 4 events in case of a callback, i have attached the screenshot!

Adarshnanda_1-1683699867726.png

Can you please tell me how can i receive data of different lengths using UART, or any method of doing so? I am trying to implement a non blocking reception of data, using my NXP device as a slave for MODBUS protocol, in which the incoming data can be of varying lengths.

Looking forward for a reply.

Regards,

Adarsh.

 

 

 

0 Kudos
Reply