cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Bootloader jump to Application

lucaontheweb
Associate II
Posted on August 17, 2009 at 17:03

Custom Bootloader jump to Application

2 REPLIES 2
lucaontheweb
Associate II
Posted on May 17, 2011 at 13:20

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 ]

picguy
Associate II
Posted on May 17, 2011 at 13:20

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.