How to know which bank got booted when working with BFB2 bit in STM32L4 MCU's
Hi,
I'm implementing an OTA system using the L486VG MCU.
This one has the dual bank option and the BFB2 option bit to enable to boot in Bank2.
It works and I can constantly swap the banks and erase and read them.
Only when the BFB2 bit is set and there is no valid firmware in Bank 2 it boots from Bank 1.
The problem is that I need logic in my firmware to know what bank got booted so I can erase the correct bank before writing my new firmware. How could I do this? At the moment I just check the BFB2 bit, but that is no assurance that it's in Bank 2.
Thanks,
Marvin
