8 years, 11 months ago.

Possibly buggy firmware for LPCXpresso 1549 and 11U68

Hi,

Where is the source code for lpc4322 firmware for those 2 boards? http://developer.mbed.org/teams/NXP/wiki/Updating-LPCXpresso-firmware

I suspect a bug in USB Serial part in the firmware. When I send back what I receive on those 2 boards, the last char either is not sent back or something else is sent back. I tried with another USB Serial on a different port and it was working OK. The problem starts when 3 or more bytes are sent, afterwards if I send 1 byte, I do not get back anything.

Sample application for LPC1159 (I used mbed-src library because I was debugging)

#include "mbed.h"

Serial pc1(USBTX, USBRX);
Serial pc2(P0_9, P0_29);
Serial pc3(P0_0, P1_3);

int main()
{
    pc1.baud(115200);
    pc1.printf("\r\nPC1: Serial Echo Server - 115200\r\n");
    
    pc2.baud(115200);
    pc2.printf("\r\nPC2: Serial Echo Server - 115200\r\n");
    
    pc3.baud(115200);
    pc3.printf("\r\nPC3: Serial Echo Server - 115200\r\n");
    
    while(1)
    {
        if (pc1.readable())
            pc1.putc(pc1.getc());
            
        if (pc2.readable())
            pc2.putc(pc2.getc());

        if (pc3.readable())
            pc3.putc(pc3.getc());
    }
}

Output on port 1

<<< \x0D\x0APC1: Serial Echo Server - 115200\x0D\x0A
>>> 1
<<< 1
>>> 12
<<< 12
>>> 123
<<< 12?
>>> 1
>>> 12
<<< 12

Output on port 2

<<< \x0D\x0APC2: Serial Echo Server - 115200\x0D\x0A
>>> 1
<<< 1
>>> 12
<<< 12
>>> 123
<<< 123
>>> 1
<<< 1
>>> 12
<<< 12

Output on port 3

\x0D\x0APC3: Serial Echo Server - 115200\x0D\x0A
>>> 1
<<< 1
>>> 12
<<< 12
>>> 123
<<< 123
>>> 1
<<< 1
>>> 12
<<< 12

I hope this demonstrates the issue.

Cheers, Jurgis

Most likely it is buffer overflow. 3 bytes per port buffer seems too small. Did you try one port first and slowly increase the number of bytes sent?

posted by HM Yoong 14 Apr 2015

Yes, I tried lots of things during 2 days when I tried to find the problem in mbed library. And came to concludion that the bug is in the firmware. I will not spend any more time on this, will use another usb to serial converter and another port if necessary.

posted by Jurgis Jurksta 15 Apr 2015

1 Answer

8 years, 11 months ago.

Please look at https://github.com/ARMmbed/CMSIS-DAP

Accepted Answer

Looks like it is too complicated for me, I'll create an issue on github.

posted by Jurgis Jurksta 13 Apr 2015