cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L152RET6 bank 1 and bank 2 switching:

HMull.1
Associate II

Good day,

I need some advise with switching banks on the STM32L152.

Here's what I currently do:

  1. Flash a new, blank MCU and boot from bank 1.
  2. BOOT0 is externally pulled LOW. BOOT1 is being used otherwise.
  3. Load firmware starting at address 0x08040000 (start of bank 2)
  4. Flip the nBFB2 bit in the Options register. No other changes are made in other config registers

Now I expect the device to boot from bank 2 but nothing happens. Any idea why this may be?

Please see image of a read of the MCU after loading firmware into Bank 2:

0693W00000HnaBGQAZ.png 

Thanks!

2 REPLIES 2
HMull.1
Associate II

I have made some progress here. It seems the key is NOT to switch banks by flipping nBFB2? I just linked the bank 2 image to 0x08040000 and wrote the hex file in position. Now I need to understand how to switch back to bank 1? It seems the nBFB2 bit has absolutely no effect. The image in B1 is linked to 0x08000000 and the image in B2 is linked to 0x0804000. How do I switch between the two?

diegofontanabr
Associate II

i am having problems with dual bank too, i was not able to get it to work...

nothing seems to work as expected, but i think the bit nBFB2 should have some affect, if not, how would you build a firmware that needs more then 256k of flash, because above that size some data will be writen on address 0x8040 0000... so the internal bootloader cant just use this address to validate the firmware in bank2.

i am wating some answers from st team, but to me, it just dont work and they dont know yet or dont want to confirm that...

by the way, there is some missleading information about wich one have or not the dual bank mode, in datasheet it says that MCU cat 4/5/6 have dual bank, but in the product selector only the STM32L151RE has it... i tested the with both 151 and 152, none of then worked.

0693W00000Hnv0dQAB.png