Skip to main content
MHirs
Associate
Nov 20, 2018 9:28 AM UTC
Question

using stm32L151VE dual bank boot

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? 

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
Nov 20, 2018 1:23 PM UTC

>>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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
MHirs
MHirsAuthor
Associate
Nov 21, 2018 7:44 AM UTC

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.

Tesla DeLorean
Guru
Nov 21, 2018 11:02 AM UTC

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..