cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F427VI boot from bank 2

larry
Associate
Posted on January 24, 2016 at 01:01

Hello:

     I've read the documentation and searched the forum and internet, but still having trouble with booting from the flash bank2. I have BOOT0 = 0, BOOT1 = 0, BFB2 = 0. I have programmed an image at 0x8000000 and a slightly different image at 0x8100000. I have read back the binary and confirmed that they are loaded correctly. Reading AN2606 Fig 37 indicates that this should work, the application should test bank2 and then boot from there. But the application always boots to the version at bank1, 0x8000000.

     If I set BFB2 to 1 or Boot0 to a 1, the device does not boot at all. 

     I am confused on a few fronts. AN2606 discusses remapping the flash from 0x8100000 to 0x0, indicating that the image for bank2 is built exactly the same was as for bank1. However, RM0090 in the discussion on BFB2 discusses changing the interrupt vector table. Seems contradictory. I am also confused how BFB2 and BOOT0/1 interact. And finally, how does SYSCFG_MEMRMP play into all of this?

     Any advice would be appreciated.

Thanks, Larry
1 REPLY 1
Posted on January 24, 2016 at 02:07

The processor always boots from address zero, so it's important to map/shadow the code you want booting there. Once booted you can alter the VTOR to suit whatever plans you have.

The code that's at 0x08100000 needs to be compiled as if it was located at zero or 0x08000000, if you plan on doing any swapping or mapping.

As I recall the System Loader looks at the SP, so you might want to park that in the middle of SRAM

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