TX data corruption on virtual COM port on LPCXpresso55S28

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

TX data corruption on virtual COM port on LPCXpresso55S28

935 Views
craigmcqueenir
Contributor IV

I'm doing some development work on the LPCXpresso55S28 dev board. I have made a serial interface on Flexcomm USART0, running at 115200 bps.

The serial interface can connect to the PC through the LPCXpresso board's "virtual COM port", via USB that provides both a CMSIS-DAP debug interface and the virtual COM port.

Using the virtual COM port, I observed some data corruption happening on the data transferred from the board to the PC. At first I assumed it was a bug in my code. However, then I tried connecting a separate USB-to-serial cable directly to P8, and disabling the on-board interface with a jumper on P1. The data corruption disappeared.

So, it appears that the board's USB virtual COM port functionality is causing data corruption. Is that a bug in the firmware on the board, or a bug in the Windows driver for it?

Labels (1)
Tags (1)
0 Kudos
8 Replies

916 Views
frank_m
Senior Contributor III

> So, it appears that the board's USB virtual COM port functionality is causing data corruption. Is that a bug in the firmware on the board, or a bug in the Windows driver for it?

At least, as I interpret it, the USB implementation on the on-board debugger and the PC side.

You could try change the settings like buffer sizes and poll rate on the PC side.
I have a screenshot, only not from an English language system. But I suppose you get the idea:

frank_meyer_0-1685699536640.png

 

 

0 Kudos

926 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suppose that your issue results from the wrong connection. Your current jumper connection is correct.

This is P1 jumper configuration.

If you want to connect external uart module to P8(UART0 of LPC55S28), you have to open the P1, I suppose this is your case.

If you want to connect internal uart module which is uart port of LPC4432 debugger MCU, you have to close the P1.

 

xiangjun_rong_0-1685688698625.png

With P1 closed, LPC4322 will communicate with uart0 of LPC55S28, otherwise, the external uart device will communicate uart0 of LPC55S28 with P8 connector.

Hope it can help you

BR

XiangJun Rong

 

 

 

 

0 Kudos

882 Views
craigmcqueenir
Contributor IV

No, I know how to configure P1. I mentioned P1 just to explain how I tried both the LPXpresso virtual COM port and an external USB-to-serial cable, to isolate where the data corruption was occurring. My testing showed that the problem is not in my own serial port code.

There is a problem with the LPCXpresso virtual COM port functionality, either in the LPCXpresso board's USB implementation (in the LPC4322) or in the Windows driver.

0 Kudos

869 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Pls try to reduce the baud rate for example from 115200 to 9600, is it okay?

I suppose that mismatch of transmitter/receiver uart clock leads to the issue.

Hope it can help you

BR

XiangJun Rong

 

0 Kudos

850 Views
craigmcqueenir
Contributor IV

I tried 19200. It didn't make a difference. The same data corruption occurs.

The nature of the data corruption doesn't look like a baud rate mismatch. It looks as though, when the data corruption occurs, it does so by reinserting a previously-received block of data into the data stream. It looks as though it's a bug in buffer management, or maybe USB packet retries, in either the LPCXpresso's on-board LPC4322 or in the Windows driver.

0 Kudos

804 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Pls download LPCScrypt tools from the link:

https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mc...

You can use the tools to refresh the CMSIS-DAP driver with the tools.

Hope it can help you

BR

XiangJun Rong

 

0 Kudos

649 Views
craigmcqueenir
Contributor IV

I have installed LPCScrypt v2.1.2, and used it to update the on-board firmware.

LPCScrypt - CMSIS-DAP firmware programming script v2.1.2 Nov 2020.

Connect an LPC-Link2 or LPCXpresso V2/V3 Board via USB then press Space.

Press any key to continue . . .

Booting LPCScrypt target with "LPCScrypt_240.bin.hdr"
LPCScrypt target booted
.
Programming LPCXpresso V2/V3 with "LPC432x_IAP_CMSIS_DAP_V5_361.bin"
Error: <Command line>:1: Verify Error 0xb 0x1a007d40
   Script cmd:      program C:\NXP\LPCScrypt_2.1.2_57\probe_firmware\LPCXpressoV2\LPC432x_IAP_CMSIS_DAP_V5_361.bin BANKA
   Last target cmd: =programPage 1a000000 8
Terminated with errors
ECHO is off.
Retrying ...

- LPCXpresso V2/V3 programmed successfully and has the unique ID: KSAYBQHR
- To use: remove DFU link and reboot.

Then, I tried using the virtual COM port. I still found it has data corruption, as before.

Note, it seems that the data corruption happens when the virtual COM port is being used at the same time as CMSIS-DAP debugging is in-progress (I'm using Rowley CrossWorks 4.10.3). If I stop debugging, then the serial data operates as expected.

I normally have this USB port plugged in to this Dell laptop's dock. I tried plugging it directly into a USB-C port on the side of the laptop, with an adapter cable. In this case, the data corruption happened a lot less often, but still happened.

0 Kudos

798 Views
frank_m
Senior Contributor III

There is a JLink firmware available from the Segger website for newer LPC-Link variants as well.
I have not tested this version, but have converted most of my onboard ST-Link with the Segger JLink firmware. And those work quite well.

0 Kudos