Author Topic: LPC932A ISP bootloader entry  (Read 6202 times)

epeng

  • Jr. Member
  • **
  • Posts: 1
    • View Profile
LPC932A ISP bootloader entry
« on: August 08, 2007, 06:56:20 am »
Hello,
I know the ISR entry and notouch method has been thoroughly discussed in this forum.
However, I have just one thing to clarify.

From my understanding:
The NoTouch implementation sets the boot status bit and then reset.

Why can't I just jump straight to the bootloader without reset?
I am guessing that it is because the bootloader wants to start with a clean memory space and stack.

So what if my code only checks for the ISP entry condition at the very beginning of the code and then go straight into the bootloader. Is there any problems with that?

thanks!

Eugene

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: LPC932A ISP bootloader entry
« Reply #1 on: August 08, 2007, 08:41:20 am »
You will have to reset things like the stack pointer and anything else that the bootloader expects when it starts. Rather than guessing at what is needed it's just easier to create a watchdog reset.

Also it is safer to ensure the status bit is set before doing anything. Imagine if there was a glitch on the power supply halfway through programming. You would want the device to reset back into ISP mode rather than trying to execute the partially programmed code.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

Je Gold

  • Full Member
  • ***
  • Posts: 135
    • View Profile
Re: LPC932A ISP bootloader entry
« Reply #2 on: August 10, 2007, 06:18:38 am »
Andy is correct -  NXP (Philips) perceived that the bootloader execution happens after a reset and registers and memory have been set back to their reset values.

==>
If the bootloader is well written then there "may not" be any dependence on reset values (who knows how well the boot loader is written???).

I have experimented with jumping to the bootloader directly - so far it's ok   but my code is very small.

Joe

Jan Waclawek

  • Full Member
  • ***
  • Posts: 220
    • View Profile
    • EFTON homepage
Re: LPC932A ISP bootloader entry
« Reply #3 on: August 11, 2007, 03:30:10 am »
If the bootloader is well written then there "may not" be any dependence on reset values (who knows how well the boot loader is written???).
Joe, epeng,

the ISP code is freely available from NXP as the code appendix to the "adding your code to the bootloader" appnote (the name is just a guesswork out of my head, please take time to find it yourself on the nasty NXP website :-) )

Nevertheless it relies on the internal IAP code, which appears to be hidden...

JW

Je Gold

  • Full Member
  • ***
  • Posts: 135
    • View Profile
Re: LPC932A ISP bootloader entry
« Reply #4 on: August 12, 2007, 05:08:25 am »
Ok   Bootloader files are here.

http://www.nxp.com/files/markets/microcontrollers/Adding%20ISP%20in%20source%20code.zip

So  Just to clarify the LPP900 series already have the bootloaders in flash - but when flashing a LPC900 the checksums will be different if the bootloader code is not incorporated as part of the hex file etc.... hence the files are needed for completeness.


Another purpose as Jan suggests is for you to examine the bootloader code for yourself to see how it works.

Joe