cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 L476RG dual bank boot

sespinoza_toro
Associate

Hello community,

I've been trying to implement the dual bank boot on my L476RG and run the app on the bank 2 after reset by setting the option byte BFB2 to 1 and it didn't work. Tried a lot of things and specially setting SCB->VTOR = 0x08000000 in the SystemInit() function for the bank 2 and still didnt work. 

With BFB2=0, app 1 works fine but when setting BFB2=1, after a reset, none of the apps work.At this point I don't know what to do, I've tried it all (both just with code and using the cube programmer)

 

Greetings!

2 REPLIES 2
lobna
ST Employee

Dear sespinoza_toro

Could you please verify SYSCFG_MEMRMP register through bit Bit 8 FB_MODE to define what is the mapping of Flash Bank in your example? Please refer to the reference manual RM0351 Rev 10 paragraph 9.2.

BR

 

Once I set BFB2=1 the FB_MODE registers sets to 1. The value of the reset handler for the bank 1 is 08080859 and 0800086D for the bank 2 (and obviously their values are withing their own banks when BFB2=0) and none of the programs run. When this happens, the VTOR value is 00000000 (by looking at the address 0xE000ED08 using CubeProgrammer), which makes sense to me considering what the RM says that "When BFB2 bit is set, the system memory remains aliased at @0x0000 0000".