cancel
Showing results for 
Search instead for 
Did you mean: 

using stm32L151VE dual bank boot

MHirs
Associate

I am using STM32L151VE. Trying to use the dual boot banks mechanism.

I am compiling the code to 0x0 and load it to bank1 OR bank2 and setting the VTOR accordingly.

When the code is located in bank1 and BFB2 is on - the application is running (memory mapping is correct).

Once I am disabling BFB2 - the application is not running.

When the code is loaded to bank2, at any state of BFB2 - the application is not running. (unless I am compiling the code to 0x8040000 which is not a valid solution for me).

What am I missing? 

3 REPLIES 3

>>What am I missing?

I don't think the BFB2 setting changes the physical mapping on the L1 parts, like it does with the F7 for example. Observe SYSCFG_MEMRMP doesn't have a bank switching bit.

If you want to deliver a single firmware image it is going to need to contain relocation information.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
MHirs
Associate

Thank you for the answer.

I suspected that the remap is not supported. But still I find it hard to explain why the same code, compiled to address 0x0, loaded on bank1, is running when BFB2 = 1 and when BFB2=0 the MC is halted.

Because I expect the system loader is setting the SCB VTOR to 0x08040000 and not mapping the code at zero, so all the fixed addresses in the vector table are still broken.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..