UART DMA problems。CPU isS32K118

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

UART DMA problems。CPU isS32K118

1,452件の閲覧回数
zhaowei961
Contributor III

Every time I use it, I need to call the receive function once to turn on the receive function. I need the DMA function to be on all the time and use it when I have data. But the library function is not implemented in this way. Every time I receive data, it will turn off the receiving function. How can I know when I receive the data? Is there a solution?

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

1,342件の閲覧回数
B46399
NXP Employee
NXP Employee

Hello,

For the usecase you described, a suitable implementation would be using an RX callback. The example project provided in the SDK shows such an implementation.

The idea is to install a callback, then call the receive function for one byte; once the first byte is received, the callback is called and inside the callback you can call LPUART_DRV_SetRxBuffer to update the receive buffer address. When no more bytes are expected, the communication is terminated (buffer is not updated anymore) - this will shut down the rx logic (and dma requests as well). This approach implements a continuous receive scenario, where the hw logic is not reinitialized for each transfer, basically receiving a variable number of bytes.

Please let me know if you have other questions!

Regards,

Vlad Lionte

0 件の賞賛
返信

1,342件の閲覧回数
zhaowei961
Contributor III

thank you for your help.I will test and reply later.

0 件の賞賛
返信