cancel
Showing results for 
Search instead for 
Did you mean: 

Layout and dual bank support in 512kB STM32F42x devices

Jaroslaw Karwik
Associate II
Posted on August 10, 2017 at 17:44

Does anyone know official documentation which provides info about sector layout and dual bank support in these devices ?

I have searched the forum, but while there was mentioned that dual bank support is not present, it was just opinion, not hard fact from documentation.

4 REPLIES 4
Posted on August 27, 2017 at 16:23

Reasonably sure there isn't support for that. I think the die have 2MB and there is a mapping trick for '1MB' devices to split that into 512KB+512KB banks.

The second bank would start at Sector 12, and it's address decoder shifted via the option bytes. ie the Flash Controller, the sectors and banks would always remain the same, and the memory interface would create the illusion that the second bank appears at 0x08080000

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on September 02, 2017 at 11:27

I'm using dual bank mechanism for SW update and I have a difficulty to identify from which bank I'm currently running. I need this when a SW upgrade process is being started and I need to physically erase the 'Other' bank sectors.

I thought I can use the BFB2 flag for that, but, in case the flashing of the SW to bank2 fail and the internal bootloader try to boot to bank 2 based on the BFB2 flag and then finds out that the address in offset 0x0 is not in the RAM it is assume that the bank2 code is not valid and it will try to boot from bank1. 

Now, in case the BFB2 was set and bank2 is not valid and the boot was done from bank1 then looking at BFB2 to distinguish the current bank will mislead, and if based on that mislead I'll erase bank1 sectors I actually erase the current bank I'm running from and get a dead device.

Any idea how to solve this?

Posted on September 02, 2017 at 14:46

Look at the FB_MODE bit in SYSCFG_MEMRMP register

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on September 02, 2017 at 16:11

Thank you! Indeed it is