cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L082 dual bank - set BFB2 bit is not enough?

Jeroen deBuffel
Associate III

Hello,

I am looking for your help on how to use the dual bank mechanism on the STM3L082.

  • My goal is to download the new firmware 'over the air' and write it into bank 2 (starting from 0x0801 8000)
  • Bank1 always remains as it is (with original firmware)
  • BFB2 is set to 1
  • MCU restarted
  • System memory loader will kick in 
  • Boots from bank2 (unless there is no valid code on bank2. In that error case it will continue to boot from bank1) 

 My questions:

  1. BFB2 set the only change needed to boot from bank2?
  2. Can firmware (HEX file) 'just' be written to bank2? Or do I need to take other changes into consideration?
  3. Does anybody have examples available for the STM32L082?

Thanks

1 REPLY 1
Jeroen deBuffel
Associate III

In the rm0376 the following is stated (par. 3.3.2)

When the conditions a, b, and c described below are fulfilled, it is equivalent to configuring boot pins for System memory boot (BOOT0 = 1 and BOOT1 = 0). In this case when protection level2 is disabled, normal bootloader operations are executed.

a) BFB2 bit is set.

b) Both banks do not contain valid code.

c) Boot pins configured as follows: BOOT0 = 0 and BOOT1 = x.

When the BFB2 bit is set, and Bank 2 and/or Bank 1 contain valid user application code, the Dual Bank Boot is always performed (bootloader always jumps to the user code). 

When fulfilling the above and having user code written in BANK1 and BANK2 that it would work. However it does not.

Any ideas?