2018-11-20 01:28 AM
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?
2018-11-20 05:23 AM
>>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.
2018-11-20 11:44 PM
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.
2018-11-21 03:02 AM
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.