The S32K312 UART+DMA+IDLE received data is 0. Procedure issue

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

The S32K312 UART+DMA+IDLE received data is 0. Procedure issue

1,405件の閲覧回数
guochuan
Contributor III

Three UART channels are configured, and uart0 is receiving and sending correctly. 1. All data received by uart1 is 0.The length of bytes is normal.Please guide me.thanks

config init:

guochuan_0-1676627210548.png

 idle Receiving operation

guochuan_1-1676627260385.png

 

0 件の賞賛
9 返答(返信)

1,365件の閲覧回数
guochuan
Contributor III

Thank you for your reply.

  • I have checked the configuration of UART0 and UART1 and they are the same.

  • UART0 dma+idle receive is normal. UART1 receives all zeros, but the received length is normal.
  • UART0 is a separate channel. I check the clock differently

  • The following is the tool configuration.

  • clock config
  • guochuan_2-1676856369747.png
  • dma config
  • guochuan_0-1676856015026.png
  • UART CONFIG

guochuan_1-1676856065642.png

0 件の賞賛

1,343件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @guochuan 

Thank you for sharing your configurations.

Could you help confirm if the UART1 works without initializing UART0?

Did you test the UART1 using the same clock frequency as UART0?

Did you test UART1 with diferent baud rate?

Also, could you share oscilloscope images of the TX UART0 and TX UART1?

0 件の賞賛

1,383件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @guochuan 

Could you help me with the following information:
Which DE are you using?
Does UART1 work individually, that is, without configuring UART0?

 

B.R.

VaneB

0 件の賞賛

1,333件の閲覧回数
guochuan
Contributor III

HIi @VaneB  

Thanks for your reply.

When we use uart+dma+idle mode to realize communication, there is an issue. After repeated verification, it is found that the UART communication is abnormal after DMA is added.

and test the UART+IDLE communication alone is normal.

Attached is the configuration routine, please help to guide, thank you.

0 件の賞賛

1,305件の閲覧回数
guochuan
Contributor III

hi @VaneB 

我们在调试UART+DMA+IDLE时,UART能正常产生Idle中断。产生的顺序是先产生IDLE中断,然后才进入void Lpuart_Uart_Ip_CompleteReceiveUsingDma(uint8 Instance)函数中断,

进入该函数提示如下

guochuan_0-1677156070537.png

初步怀疑是DMA产生的完成中断滞后,导致接收到的数据全是0.请帮助分析,谢谢。

0 件の賞賛

1,258件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @guochuan 

I understood that after the IDE interrupt is generated, a DMA interrupt is generated, which produces a delay in data reception by UART. Did I understand correctly?

Would you help me to maintain communication in English for better interaction?

0 件の賞賛

1,249件の閲覧回数
guochuan
Contributor III

hi @VaneB

thank you reply.

We use emulator for tracking. Now it is normal to test uart+dma+idle to receive data, but send data is always 0. Both DMA and uart states are successful.

The project is fixed to send 50 bytes full of 0. share the project, please help to guide, thank you..

 

0 件の賞賛

1,178件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @guochuan 

Did you test the example code I shared with you earlier?

0 件の賞賛

1,318件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @guochuan 

Thank you for the information.

Could you help me with the information requested above?

Also, check the following community post, where you will find an example of UART and DMA that may help you.

S32K312 UART DMA example

0 件の賞賛