You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The decision on which bank to load the new firmware to, is based off the REMAP flag, which is correct. The remap flag tells you which flash bank you're running from.
However, the decision to set BFB2, is based on the BFB2 flag. Unlike Remap, BFB2 flag does not necessarily mean you're executing from the bank you think you are. What this flag actually means is whether or not the rom bootloader will attempt to boot from bank2. If bank2 contains no valid firmware, then the bootloader will boot from bank1. In this situation, Remap will be zero, but BFB2 will be one.
if (GetActiveBank() == FLASH_BANK_2) {
// Switch over boot from Bank2 to Bank1, by disabling BFB2 flag
OBInit.USERConfig = OB_BFB2_DISABLE;
} else {
// Switch over boot from Bank1 to Bank2, by enabling BFB2 flag
OBInit.USERConfig = OB_BFB2_ENABLE;
}
The decision on which bank to load the new firmware to, is based off the REMAP flag, which is correct. The remap flag tells you which flash bank you're running from.
However, the decision to set BFB2, is based on the BFB2 flag. Unlike Remap, BFB2 flag does not necessarily mean you're executing from the bank you think you are. What this flag actually means is whether or not the rom bootloader will attempt to boot from bank2. If bank2 contains no valid firmware, then the bootloader will boot from bank1. In this situation, Remap will be zero, but BFB2 will be one.
g4-dual-bank-example/Core/Src/main.c
Line 107 in a4f098d
The text was updated successfully, but these errors were encountered: