Debugging LPC1114LV with LPC-LINK2 Crashes

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

Debugging LPC1114LV with LPC-LINK2 Crashes

1,810 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by johnnyfp on Sun Nov 02 22:11:52 MST 2014
Hi,
I'm trying to debug a LPC1114LV bit of code via LPCXpresso 7.4 on Windows 7 and it keeps crashing the arm-none-eabi-gdb.exe debugger with the following

$1 = 0xff
The target endianness is set automatically (currently little endian)
/home/build/work/GCC-4-8-build/src/gdb/gdb/linespec.c:2445: internal-error: decode_line_full: Assertion `state->canonical_names.suffix != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? 
(y or n) [answered Y; input not from terminal]
/home/build/work/GCC-4-8-build/src/gdb/gdb/linespec.c:2445: internal-error: decode_line_full: Assertion `state->canonical_names.suffix != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.


and

(crt_emu_cm_redlink) terminating on communication loss: Pipe has been closed by GDB.


The code and debugger works fine with a LPC1115 Dev board and LINK1.

I've tried to change the Header libraries from RedLib to NewLib to NewLibNano hosted/Semi hosted and No host all with the same results.

Is there anything else I can try?

Thanks
0 Kudos
Reply
9 Replies

1,737 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Tue Nov 04 03:42:57 MST 2014

Quote: johnnyfp
Is this just for debugging or is it needed for production?



Not sure what you are producing...

Is it a device or a surprise?


Quote: johnnyfp
If it is, have I missed this information in the datasheets?



That's in the 'Microcontroller basics datasheet' Chapter 4: 'Dos and Donts with Reset and ISP'  :)
0 Kudos
Reply

1,737 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by johnnyfp on Tue Nov 04 01:05:07 MST 2014
Is this just for debugging or is it needed for production?
If it is, have I missed this information in the datasheets? Because I haven't seen these requirements in the ds.
0 Kudos
Reply

1,737 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Mon Nov 03 23:49:23 MST 2014

Quote: johnnyfp
Reset is connected to JTAG_RESET (No Pull up resistor resistor installed)
ISP is connected to ISP CTL OD (No Pull up resistor installed)



:quest:

For a custom board there are exact 2 pull-ups required:

ISP and Reset...
0 Kudos
Reply

1,737 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by johnnyfp on Mon Nov 03 23:31:18 MST 2014
I have the ISP and Reset pin connected to the programming header from the LPC-LINK2. Should I not have these connected? Also the debugging document you pointed me to says that I need pull ups on SWIO and SWCLK or the JTAG. As I am only using SWD I have not installed any on the JTAG side. Do I need them on them as well? Even if I'm not actually using JTAG but SWD?

Reset is connected to JTAG_RESET (No Pull up resistor resistor installed)
ISP is connected to ISP CTL OD (No Pull up resistor installed)

Thanks
0 Kudos
Reply

1,737 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Nov 03 21:30:26 MST 2014
The error 'No Source Available for "0x1fff0938"' means that the program has stopped, hit a breakpoint or encountered a fault and the PC location is 0x1ff0938. As that address is in the on-chip ROM, this address does not map to any source in your application.

You will need to debug your application (from Reset) to find out how it gets there. If you code is NEVER run (i.e. you get this error before you have started your code), then the most likely cause is that you have the ISP pin floating, or tied the wrong way. Check your ISP/Reset circuit.
0 Kudos
Reply

1,737 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by johnnyfp on Mon Nov 03 16:51:50 MST 2014
I have no LED, it's a custom board. But I can make a simple toggle of a pin routine and it flashes OK to the board and can see that the pin toggles.

However I can get any debugging output, be it with printf and semi hosted or checking peripheral changes if I halt.

The following is what I get in the console window
LPCXpresso RedlinkMulti Driver v7.4 (Sep 11 2014 00:18:29 - crt_emu_cm_redlink build 154)
Emu(0): Conn&Reset. DpID: 0BB11477. CpuID: 410CC200. Info: (null)
Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Loaded LPC11_12_13_32K_8K.cfx: LPC11_12_13 (32K Flash, min 8K RAM) Sep 15 2014 17:39:37  On-chip Flash Memory
Connected: was_reset=true. was_stopped=false
v LPCXpresso Free License - Download limit is 256K
Writing 5876 bytes to address 0x00000000 in Flash
Erased/Wrote page  0-1 with 5876 bytes in 1005msec
Flash Write Done
Flash Program Summary: 5876 bytes in 1.00 seconds (5.71 KB/sec)
Stopped (Was Reset)  [Reset from Unknown]


using the following code
#include "chip.h"

#include <cr_section_macros.h>
#include "timer_11xx.h"

const uint32_t OscRateIn = 12000000;

void delay32Ms(uint8_t timer_num, uint32_t delayInMs)
{
  if (timer_num == 0)
  {
Chip_TIMER_Init(LPC_TIMER32_0);
    /* setup timer #0 for delay */
    LPC_TIMER32_0->TCR = 0x02;/* reset timer */
    LPC_TIMER32_0->PR  = 0x00;/* set prescaler to zero */
    LPC_TIMER32_0->MR[0]  = delayInMs * ((SystemCoreClock/(LPC_TIMER32_0->PR+1)) / 10000);
    LPC_TIMER32_0->IR  = 0xff;/* reset all interrrupts */
    LPC_TIMER32_0->MCR = 0x04;/* stop timer on match */
    LPC_TIMER32_0->TCR = 0x01;/* start timer */

    /* wait until delay time has elapsed */
    while (LPC_TIMER32_0->TCR & 0x01);
    Chip_TIMER_DeInit(LPC_TIMER32_0);
  }
  else if (timer_num == 1)
  {
  Chip_TIMER_Init(LPC_TIMER32_1);
    /* setup timer #1 for delay */
  LPC_TIMER32_1->TCR = 0x02;/* reset timer */
  LPC_TIMER32_1->PR  = 0x00;/* set prescaler to zero */
  LPC_TIMER32_1->MR[0] = delayInMs * ((SystemCoreClock/(LPC_TIMER32_1->PR+1)) / 1000);
  LPC_TIMER32_1->IR  = 0xff;/* reset all interrrupts */
  LPC_TIMER32_1->MCR = 0x04;/* stop timer on match */
  LPC_TIMER32_1->TCR = 0x01;/* start timer */

    /* wait until delay time has elapsed */
    while (LPC_TIMER32_1->TCR & 0x01);
    Chip_TIMER_DeInit(LPC_TIMER32_1);
  }
  return;
}


int main(void){
SystemCoreClockUpdate();
printf("System Starting....\n");
Chip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO1_2, (IOCON_FUNC1 | IOCON_MODE_INACT));
Chip_GPIO_SetPinDIROutput(LPC_GPIO, 1, 2);
Chip_GPIO_SetPinOutLow(LPC_GPIO,1,2);

while(1) {
Chip_GPIO_SetPinOutHigh(LPC_GPIO,1,2);
delay32Ms(0,500);
Chip_GPIO_SetPinOutLow(LPC_GPIO,1,2);
delay32Ms(0,500);
}
}


I've got 22k resistors on the SWCLK and SWIO pins with SWIO pulled up and SWCLK pulled down.
Headers currently set to NewLibNano(SemiHost)

Cheers
0 Kudos
Reply

1,737 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Nov 03 01:05:54 MST 2014
So that sounds like you are stuck in the ROM bootloader. Can you actually tell if your code has downloaded successfully (e.g. LED flashing)?

And is this you own board or an off-the-shelf one? I would certainly suggest checking your debug/reset circuitry (in particular ISP):

http://www.lpcware.com/content/faq/lpcxpresso/debug-design

If you are still having problems, please also post you debug log…

http://www.lpcware.com/content/faq/lpcxpresso/debug-log

And finally, for reference, please see:

http://www.lpcware.com/content/faq/lpcxpresso/debugging-lpc11xxlv-parts

Regards,
LPCXpresso Support
0 Kudos
Reply

1,737 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by johnnyfp on Sun Nov 02 23:33:37 MST 2014
That solves that issue, Thanks.

Now if I set a breakpoint it does not trigger or if I pause it shows the following int the debugger.

I now get 'No Source Available for "0x1fff0938"

0 Kudos
Reply

1,737 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Sun Nov 02 22:53:15 MST 2014
This has been reported before. For example see
http://www.lpcware.com/content/forum/issues-lpcexpresso-70092
And others

Solution seems to be to delete your breakpoints and try debugging again
0 Kudos
Reply