2016-03-03 02:36 PM
On STM32L4 (and some other parts), the FB_MODE bit in SYSCFG->MEMRMP is used to swap the mapping of flash banks 1 and 2. This is how the factory bootloader implements ''boot from bank 2'' (BFB2) in the flash option bytes.
The flash controller provides two bits in FLASH->CR, MER1 and MER2, which allow for erasing a single bank or both banks (if both MER1=MER2=1). This raises an obvious question: Does MER1 always refer to bank 1? Or does it refer to whichever bank is currently mapped into the lower address range (0x0800 0000 on my 1-MB part)?2016-03-03 03:58 PM
I would expect only the memory mapping of the array to be swapped, and the flash banks and controllers remain as they are physically defined.
Sort of thing you could quickly validate with simple experiments.2016-03-15 04:30 PM
Confirmed. For MER1/MER2 purposes, ''bank 1'' always refers to the same bank and ''bank 2'' always refers to the same bank.