cancel
Showing results for 
Search instead for 
Did you mean: 

How to use bootloader to upgrade bootloader in STM32?

ray
Associate II
Posted on October 14, 2013 at 10:11

I designed a bootloader and erase it to sector 0. It can erase other bin into other sectors using IAP. But how to  upgrade itself to sector 0? Does anyone give me an idea?

Thanks.
4 REPLIES 4
Posted on October 14, 2013 at 13:30

Copy the updating code to RAM, and run it from there.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
ray
Associate II
Posted on October 16, 2013 at 06:58

Hi clive1,

How to copy a function(include upgrading code) to a RAM address? Is it possible?

If not, I need to create another upgrading project and include the binary code of this project into bootloader?

ray
Associate II
Posted on October 16, 2013 at 07:02

Hi Clive1,

How to copy a functon which includes updrading code to a RAM address? Is it possible? If not, do I need to create another upgrading project and include the binary code of this project into bootloader?

Posted on October 16, 2013 at 15:44

Coding a whole other applet is one approach, if your current code is address agnostic you could use that too. I, personally, wrote a small block of assembler code which I can copy anywhere in memory, and has a clearly understood call tree. This would be more challenging in C, and using external/library subroutines.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..