cancel
Showing results for 
Search instead for 
Did you mean: 

firmware update - dual bank - linker

Francois Baratin
Associate II
Posted on July 10, 2017 at 10:20

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

2 REPLIES 2
Nesrine M_O
Lead II
Posted on July 10, 2017 at 10:33

Hi

BARATIN.Francois

,

Please refer to these examples under the STM32F7 firmware package it may help you:

  • STM32Cube_FW_F7_V1.7.0\Projects\STM32756G_EVAL\Applications\USB_Device\DFU_Standalone (refer to readme file)
  • STM32Cube_FW_F7_V1.7.0\Projects\STM32F767ZI-Nucleo\Examples\FLASH\FLASH_SwapBank

-Nesrine-

Francois Baratin
Associate II
Posted on July 10, 2017 at 12:00

Thanks. I have already refer to those examples, but I still don't understand how to 'ping-pong' with 2 firmwares in each bank compiled with the same linker (both linked with a flash starting address of the first bank [0x08000000])).

This topic

https://community.st.com/0D50X00009XkefhSAB

describes the same problem, the configuration of

BFB2 bit seems to do the job, but there is no such bit for STM32F765 mcu...

You can find my example here:

https://drive.google.com/drive/folders/0B59UowCQTc9TVnVWT1dURDMxSFk?usp=sharing

François