S32K3 UART FIFO

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S32K3 UART FIFO

7,145 次查看
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 项奖励
回复
15 回复数

7,125 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @li3,

The RTD LPUART driver does not use the FIFOs.

 

BR, Daniel

0 项奖励
回复

7,122 次查看
li3
Contributor II

Hi Daniel,

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

Best regards,

Li 3

0 项奖励
回复

7,111 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Probably because of the increased complexity that it would require.

 

Regards,

Daniel

 

0 项奖励
回复

7,109 次查看
li3
Contributor II

Hi Daniel,

    Can DMA be used instead of FIFO?

Regards,

Li 3

0 项奖励
回复

7,102 次查看
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 项奖励
回复

7,100 次查看
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 项奖励
回复

7,092 次查看
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 项奖励
回复

7,089 次查看
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 项奖励
回复

7,076 次查看
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 项奖励
回复

6,907 次查看
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 项奖励
回复

6,905 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @li3,

I don't understand the question.

Can you elaborate?

 

 

0 项奖励
回复

6,890 次查看
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 项奖励
回复

6,855 次查看
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 项奖励
回复

6,853 次查看
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 项奖励
回复

6,849 次查看
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 项奖励
回复