S32K3 UART FIFO

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K3 UART FIFO

5,882件の閲覧回数
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 返答(返信)

5,862件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @li3,

The RTD LPUART driver does not use the FIFOs.

 

BR, Daniel

0 件の賞賛
返信

5,859件の閲覧回数
li3
Contributor II

Hi Daniel,

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

Best regards,

Li 3

0 件の賞賛
返信

5,848件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Probably because of the increased complexity that it would require.

 

Regards,

Daniel

 

0 件の賞賛
返信

5,846件の閲覧回数
li3
Contributor II

Hi Daniel,

    Can DMA be used instead of FIFO?

Regards,

Li 3

0 件の賞賛
返信

5,839件の閲覧回数
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 件の賞賛
返信

5,837件の閲覧回数
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 件の賞賛
返信

5,829件の閲覧回数
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 件の賞賛
返信

5,826件の閲覧回数
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 件の賞賛
返信

5,813件の閲覧回数
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 件の賞賛
返信

5,644件の閲覧回数
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 件の賞賛
返信

5,642件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @li3,

I don't understand the question.

Can you elaborate?

 

 

0 件の賞賛
返信

5,627件の閲覧回数
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 件の賞賛
返信

5,592件の閲覧回数
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 件の賞賛
返信

5,590件の閲覧回数
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 件の賞賛
返信

5,586件の閲覧回数
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 件の賞賛
返信