2009-08-17 08:03 AM
Custom Bootloader jump to Application
2011-05-17 04:20 AM
Edit:: Nevermind, I was jumping to the reset vector and not the address stored at the reset vector.
I think that's right. :)[ This message was edited by: lucauwf on 17-08-2009 15:47 ]2011-05-17 04:20 AM
If I understand what a bootloader has to do then what you said is half correct. But note that the initial sp is in 0000 and the reset address is in 0004.
My understanding (and I’m sure I will be corrected if I’m wrong) is that the bootloader is pointed to by the reset vector. Thus the bootloader gets control after every reset. Something – perhaps a push button – tells the bootloader to (button pressed) do the boot loader thing or (button not pressed) jump to the application. How does the bootloader know where the application starts? The application has to leave something around for the bootloader. One easy place is the word at 0020. It’s reserved for ARM I think. I don’t think it’s used in the current parts. Or pick an interrupt vector, perhaps ADC3 at 00FC, that you have no reason to use. 100% safe is 0130 – it’s just past the vectors used only by large parts. Wherever the address is, the bootloader loads it into lr and bx lr. Application is now running.