cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to flash two different programs on different sectors of the same Flash?

stathpale
Associate II

I am developing an application that requires over the air firmware update, but my MCU's Bootloader does not support this Task (stm32f446re).

So I was thinking to do this :

1)My main appllication will be located at 0x0800 0000 on the flash

2) At some point a newer version of the firmware will be received and that version will be temporarily be stored at 0x0802 0000(sector 5).

3) After checking if the new firmware is vaild the applicatoin will call the program Flash_Rewrite to copy the new firmware at 0x0800 0000. Flash_Rewrite program will be located at 0x0804 0000( sector 6 of the Flash-Memory) .It must be a different program and not just a function of the main application because it will have to use it's own copy of all the necessary drivers.

4) When Flash_Rewrite finishes the system shall restart with the new version of the application.

PROBLEM:

Although the Flash_Rewrite program works fine when its located at 0x0800 000(it performs just fast blink instead of copying at this early stage of development) it fails to start when I change its starting address at 0x0804 0000 from the STM32F446RETX_FLASH.ld file.

1 ACCEPTED SOLUTION

Accepted Solutions

Yes, you can stage data wherever. You can build for specific addresses via linker script or scatter file.

Generally you'd want a small boot loader at the 0x08000000 address which can check application integrity and check for new firmware to copy over into the active location.​

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

View solution in original post

2 REPLIES 2

Yes, you can stage data wherever. You can build for specific addresses via linker script or scatter file.

Generally you'd want a small boot loader at the 0x08000000 address which can check application integrity and check for new firmware to copy over into the active location.​

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

> it fails to start when I change its starting address at 0x0804 0000 from the STM32F446RETX_FLASH.ld file.

Code starts from 0x08000000. If your program is somewhere else, you'll need to load code at 0x08000000 to jump to where your program is.

If you feel a post has answered your question, please click "Accept as Solution".