LPC932A ISP bootloader entry

Started by epeng, August 08, 2007, 06:56:20 AM

Previous topic - Next topic

epeng

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

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

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

Quote from: Je Gold on August 10, 2007, 06:18:38 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

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