10 years, 1 month ago.

LPC1768FET100 100TFBGA cannot enter SWD/JTAG debug mode

i have the following::

1) LPC1768FET100 100TFBGA chip on my final board

2) LPC1768FBD100 100LQFP chip on my protoboard

and running LPCXpresso 7.0 to use the JTAG/SWD function. proto and final boards are electrically equivalent

Both are running: USBSerial_HelloWorld - main.cpp code http://mbed.org/handbook/USBSerial

the JTAG/SWD works on LPC1768FBD100 100LQFP, but gets stuck on USB configuration with LPC1768FET100 100TFBGA. how come i cannot use JTAG/SWD on LPC1768FET100 100TFBGA? I ohmed out and tripled checked the signal paths. I can use JTAG to flash the *.bin on both proto and final.

the code below is where it gets stuck in the USBDevice.cpp. anyone know why i cannot get JTAG/SWD to work on the ball grid array version of the LPC1768?

USBDevice.cpp

void USBDevice::EP0in(void)
{
#ifdef DEBUG
    printf("EP0IN\r\n");
#endif
    /* Endpoint 0 IN data event */
    if (!controlIn())
    {
        /* Protocol stall; this will stall both endpoints */
        EP0stall();
    }
}

bool USBDevice::configured(void)
{
    /* Returns true if device is in the CONFIGURED state */
    return (device.state == CONFIGURED);  //GETS STUCK HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}

void USBDevice::connect(void)
{
    /* Connect device */
    USBHAL::connect();
    /* Block if not configured */
    while (!configured());
}

3 Answers

10 years, 1 month ago.

You do know where it gets stuck, but how is that related to the jtag? It will get stuck there when it doesn't have a USB connection to a host PC. So you probably need to quadrupple check that connection, including the resistors.

10 years, 1 month ago.

it gets stuck at the code posted above where it says "GETS STUCK HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" at a section of USBDevice.cpp.

i have 100K pullup to 3.3V at the JTAG connections: TCK, TMS, TDI, TRST,

i am able to successfully flash the LPC1768 BGA, but not able to run Debug mode. not sure which pins JTAG uses on flashing only. was assuming the same. /media/uploads/jonliujl/untitled.png

the above schematic uses LPC1768FET100 100TFBGA

But if you don't have a proper USB connection active it is supposed to get stuck on that line of code.

posted by Erik - 14 Mar 2014

I am able to successfully flash the LPC1768 BGA with *.bin file, and run USB serial comm with Putty.

but in debug mode i cannot get USB to work.

any ideas?

posted by jonathan liu 14 Mar 2014
10 years, 1 month ago.

Are you able to use debug on code that does not use the USB. Note that default the SWD port is used for Cortex M3 rather than JTAG. The USB lib may have changed clock settings which do not match SWD. There are some clock settings for the SWD mode of the programmer in lpcxpresso. Other reasons why SWD/JTAG could fail is when code protection bits are set.

<<quote>>Are you able to use debug on code that does not use the USB.<</quote>> yes. works fine without USBserial library

<<quote>>The USB lib may have changed clock settings which do not match SWD. There are some clock settings for the SWD mode of the programmer in lpcxpresso.<</quote>> So i changed the lpcxpresso wire speed to 1000. see similar below. but for LPC1768. http://host.lpcware.com/system/files/lpc812_debug.PNG the code still gets stuck at the same location. see 1st post.

<<quote>>Other reasons why SWD/JTAG could fail is when code protection bits are set.<</quote>> Using the same code, If i am able to get into debug mode using a protoboard that uses LPC1768FBD100 100LQFP, bbut fails the debug mode with LPC1768FET100 100TFBGA by getting stuck (see 1st post) then this rules out the code protection bits being set. correct?

posted by jonathan liu 18 Mar 2014