This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Unable to program LPC2141 after IAP routine

I wanted to write a bootloader for the LPC2141 whilst running USB communications which are required during the write in my application. To do this, I ignored the suggestions about disabling interrupts during an IAP write, thinking that it will be ok as the area of code my USB interface is running in will not be overwritten during the procedure.

Normally I would agree that storing the interrupt service routines and associated code in ram and running them there during the write would be the safe thing to do, but I believe the whole USB stack would have to be moved, around 7kB of it, and there is only 4kB of available RAM.

After erasing one page of flash within the application section of memory without interrupts disabled, I am now unable to program the flash at all using uVision3. The download just times out.

I accept that the steps I took were careless, but any helpful suggestions as to how I can program the application space of an LPC214x device whilst operating the large USB stack, or even how to recover my lpc2141 from its inability to program at all will be greatly appreciated.

Thankyou.

  • Does the processor have a monitor program for programming through a serial port?'

    "[...] will not be overwritten during the procedure."

    It isn't just a question about having the ISR (or the interrupt table) overwritten. It is a question if the flash memory supports any access at all while a sector is being erased or programmed.

  • It has a serial port programming interface but as yet I have no hardware set up for doing this (I was hoping not to have to use this but it looks likely to be my only solution). I've been using the Jtag port until now but I do have a copy of Philip's LPC2100 flash programming utility for serial programming.

    "It isn't just a question about having the ISR (or the interrupt table) overwritten. It is a question if the flash memory supports any access at all while a sector is being erased or programmed."

    Yes I thought this might be the case - I was basing my code on a colleagues' working code, but it appears the interface used for transferring data to the IAP routine is sufficiently different to stop it from working. Thanks

  • The serial interface is quite good to use for factory production. Just note that the Flash Magic requires a special license for factory use.