UART DMA communication Issue on Initial power up with LPC55S28

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

UART DMA communication Issue on Initial power up with LPC55S28

1,166 次查看
SegFault0
Contributor II

Hello everyone,

I'm experiencing an issue with UART communication between my PC and an LPC55S28 microcontroller.


When I first connect the USB cable (Debug Link P6) to power up the LPC55S28 dev board, the initial UART communication is corrupted. I have a python script running on my development computer that sends a 6 byte header to the uC. On the first attempt, immediately after powering the board via the debug USB cable, my UART interface (on the uC) does not receive the desired data. If I start a new debug run immediately afterwards without interrupting the power supply, the correct data is received. The result is that the first run after each power up is faulty. 

Here's what I'm observing:

1. On the PC side (Python script):
- I'm sending a header: [Destination: 1, Type: 1, Seq: 0, Length: 108]
- This is packed as struct.pack('<BBHH', 1, 1, 0, 108)

2. On the LPC55S28 side:
- Instead of receiving the correct header, it receives: [0, 61, 511, 1]
- Followed by another incorrect header: [108, 0, 1, 7]

3. On the LPC55S28 side on the second debug run:
- It received the correct header [1,1,0,108]

 

The project is based on the SDK example.

This only happens on the initial connection after plugging in the USB cable.

The issue resolves itself on subsequent attempts without disconnecting the power.

I'm using the default UART configuration provided by the SDK.

It looks as if data is getting into the UART buffer that does not originate from my development computer. Is there a way to flush the buffer after the initialization function?

 

标签 (3)
标记 (3)
0 项奖励
回复
3 回复数

1,136 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, my name is Pavel, and I will be supporting your case, could you let me know the name of the example that are you using? the buffer that you are using is initialize with 0? maybe you could use memset to set the buffer to 0's.

Best regards,
Pavel

0 项奖励
回复

1,118 次查看
SegFault0
Contributor II

It is based on the usart_dma_transfer example project. I have adopted the initialization, I have changed the receive function. The array is initialized with 0s.

0 项奖励
回复

1,108 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, and what was your result?

Best regards,
Pavel

0 项奖励
回复