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

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

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

1,967 Views
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 Kudos
Reply
9 Replies

1,927 Views
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 Kudos
Reply

1,905 Views
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 Kudos
Reply

1,945 Views
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 Kudos
Reply

1,895 Views
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 Kudos
Reply

1,867 Views
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 Kudos
Reply

1,820 Views
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 Kudos
Reply

1,811 Views
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 Kudos
Reply

1,740 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @guochuan 

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

0 Kudos
Reply

1,880 Views
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 Kudos
Reply