I'm trying to set dual bank mode for STM32F779II, but it doesn't set at all.
So I tried in the main before doing anything the following code
HAL_FLASH_Unlock();
HAL_FLASH_OB_Unlock();
FLASH->OPTCR |= FLASH_OPTCR_nDBANK_Msk;
HAL_FLASH_OB_Lock();
HAL_FLASH_Lock();
And When I tried to check if the memory is in Single or Dual Mode:
if((OBInit.USERConfig & OB_NDBANK_SINGLE_BANK) == OB_NDBANK_DUAL_BANK){
printf("Dual bank mode is set");
}
but that statement is never set true.