S32K3 UART FIFO

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

S32K3 UART FIFO

7,149 Views
li3
Contributor II

Hi NXP,

    I am learning to use LPUART with S32K312 and can not find the code to set the FIFO function of LPUART in the generated driver code.

    Does LPUART not need to use FIFO? Or I did not find the code to set the FIFO function of LPUART, please tell me the location of the code, thank you.

Best regards,

Li 3.

0 Kudos
Reply
15 Replies

7,129 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @li3,

The RTD LPUART driver does not use the FIFOs.

 

BR, Daniel

0 Kudos
Reply

7,126 Views
li3
Contributor II

Hi Daniel,

    Can you explain why you don't use FIFO? thank you.

Best regards,

Li 3

0 Kudos
Reply

7,115 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Probably because of the increased complexity that it would require.

 

Regards,

Daniel

 

0 Kudos
Reply

7,113 Views
li3
Contributor II

Hi Daniel,

    Can DMA be used instead of FIFO?

Regards,

Li 3

0 Kudos
Reply

7,106 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @li3,

DMA can be used, but this is not a replacement for the FIFO.

We can use either Interrups or DMA to transfer data to the DATA register, regardless whether the FIFOs are enabled or not.

 

Regards,

Daniel

0 Kudos
Reply

7,104 Views
li3
Contributor II

Hi Daniel,

   Can you tell me how to receive data with an interrupt to know that the data is complete?

    And how do you know when the data is received using DMA?

Regards,

Li 3

0 Kudos
Reply

7,096 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Use the Lpuart_Uart_Ip_AsyncReceive() function.

And the LPUART callback.

danielmartynek_0-1715858044888.png

There are these events (Lpuart_Uart_Ip_Types.h):

danielmartynek_1-1715858154224.png

 

Regards,

Daniel

 

0 Kudos
Reply

7,093 Views
li3
Contributor II

Hi Daniel,

    Can interrupt and DMA receive only fixed-length data?

    For example, if size is set to 20, only 20 characters can be received to call back the call back function, and if only 10 characters are received, the call back function will not be called. May I ask how can I know that RX has completed the data reception this time?

li3_0-1715860306432.png

Regards,

Li 3

0 Kudos
Reply

7,080 Views
danielmartynek
NXP TechSupport
NXP TechSupport

There is this API that can be used to extend the AsyncReceive() call from the callback:

danielmartynek_0-1715866695627.png

Also, the application can call Lpuart_Uart_Ip_GetReceiveStatus() to get the status of the call.

 

BR, Daniel

0 Kudos
Reply

6,911 Views
li3
Contributor II

Hi Daniel,

    Which register does DMA store data, and where is it in the chip manual?

    How do I get the data out of the DMA register?

Best regards,

Li 3

0 Kudos
Reply

6,909 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @li3,

I don't understand the question.

Can you elaborate?

 

 

0 Kudos
Reply

6,894 Views
li3
Contributor II
Hi Daniel,
    When using DMA reception, is the received data first stored in the DMA register? Or do you just save it to RxBuff?
    For example: If RxSize is set to 100, but there are only 50 pieces of data, where are the 50 pieces of data stored?
li3_0-1716533860420.jpeg
Best regards,
Li 3
0 Kudos
Reply

6,859 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @li3,

The eDMA transfers the RX data from the LPUART data register to the SRAM buffer.

The data are not stored anyware in the eDMA module.

Refer to the eMDA description in the RM or to this AN:

https://www.nxp.com/docs/en/application-note/AN4765.pdf

 

Regards,

Daniel

0 Kudos
Reply

6,857 Views
li3
Contributor II

Hi Daniel,

I want to use DMA receive to get the data received by DMA after generating idle interrupt, please tell me to implement, thank you.

Regards,

Li 3

0 Kudos
Reply

6,853 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Since this follow-up question is not related to the original topic of the thread, please create a new one,

 

Thank you,

Daniel

0 Kudos
Reply