AnsweredAssumed Answered

firmware update - dual bank - linker

Question asked by Francois Baratin on Jul 10, 2017
Latest reply on Jul 10, 2017 by Francois Baratin

Hello,

 

I would like to manage firmware update using dual bank mode, for STM32F765 device.
I am a little confused about how to configure the linker for the dual bank. Here is what has been done:

 

I have designed a firmware which toggles led1 on STM32 NUCLEO F767ZI board, and a second firmware where I blink another led (led2).
When the user button is pushed, the boot address 0 is changed to 0x08000000 or 0x08100000. Then a software reset is done to make the device restart in the other bank.

 

For the first firmware compilation, I leave the initial configuration.
For the second firmware compilation, I edit the linker with .intvec start = 0x08100000, and Memory regions ROM start = 0x08100000 (and end = 0x081FFFFF). (IAR)

 

Using STM32 ST-link utility, I set nDBANK = 0 (and I leave nDBOOT = 1). BOOT_ADD0 = 0x08000000 (init value).
Firmware 1 and and 2 are programmed from 0x08000000 and 0x08100000 start adresses respectively.

 

Then it works, when I push the user button, the led1 or led2 is toggling.

 

The problem is that I have to edit the linker to program firmware in bank2, else the firmware in bank2 doesn't start.
But, in the field, I don't know if the firmware will be loaded into bank1 or bank2.

 

- Is there a way to use the same linker for an application being programmed in bank1 or bank2 ?
- Should I mandatory use a small bootloader to manage it? I woudn't use this solution.  

 

(I have found the AN4767 and the provided code example (X-CUBE-DBFU), it seems to work as I would like to implement, but I don't understand how the downloaded code in bank2 can start. As I don't have this eval board, I can't test it).

 

Thanks for your advices,

 

François

Outcomes