Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] destroyed LPC2138 via software

2005-10-25 by Michael Johnson

Hi,

The LPC2000 chips don't support debug from reset (or at least we've 
never seen one that can). By the time that a debugger has got control, 
the chip will have executed many instructions - including ones that 
could turn off the JTAG port, abort, turn on interrupts etc. There are a 
couple of workarounds to this

- Use the serial port bootloader to erase the flash before each debug 
session.

- Stopping the user program in flash from executing by
  - using the P0.14 mechanism
  - putting an invalid checksum in the interrupt vectors
  - modifiying your reset exception handler so that it goes into an 
endless loop
and then get your debugger to start executing from the code that your 
real reset handler will call. This can usually be arranged by setting 
the entrypoint given to the link command line.

Regards
Michael

>Richard Duits wrote:
>
>  
>
>>You can also enter the JTAG debugger while in the bootloader code. This 
>>way you do not need to erase the chip via the serial lines (which are 
>>inaccessable on my board). I always put a jumper on the board to pull 
>>P0.14 low when I screw something up badly. Also JTAG programming does 
>>not work well when you use the idle mode, so it helps to first force it 
>>in bootloader mode and then program the chip with the JTAG programmer.
>>
>>
>> 
>>
>>    
>>
>Thank you, that is a good tip:  hold down the P0.14 line while telling 
>the BDI2000 to "reset halt" and it clears the problem enough that I can 
>reprogram the flash from the JTAG.
>
>TomW
>
>
>  
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.