i have problems that stm32f767 nucleo Board configed flash bank
hi dear.
I have some problems with the Flash bank configure.
STM32F767 is used by setting Flash Bank to Single or Dual.
So I want to set Dual Bank Mode on Flash Memory.
However, the Dual Bank setting does not work properly.
I changed the Option bytes to set Single or Dual Bank.
Below is the code I wrote.
bool flash_opt_init_func(void)
{
uint32_t ret = true;
FLASH_OBProgramInitTypeDef ob_bytes;
HAL_FLASHEx_OBGetConfig(&ob_bytes);
if(ob_bytes.USERConfig & OB_NDBANK_SINGLE_BANK)
{
HAL_FLASH_OB_Unlock();
ob_bytes.OptionType = OPTIONBYTE_USER | OPTIONBYTE_RDP;
ob_bytes.USERConfig = OB_NDBANK_DUAL_BANK | OB_DUAL_BOOT_DISABLE | OB_IWDG_SW | OB_STOP_NO_RST
| OB_STDBY_NO_RST | OB_IWDG_STOP_ACTIVE | OB_IWDG_STDBY_ACTIVE | OB_WWDG_SW;
ob_bytes.RDPLevel = OB_RDP_LEVEL_0;
HAL_FLASHEx_OBProgram(&ob_bytes);
if(HAL_FLASH_OB_Launch() != HAL_OK)
{
return HAL_ERROR;
}
HAL_FLASH_OB_Lock();
}
else return ret;
return ret;
}Sometimes hard fault occurs when the above code is executed. And Change Flash Memory Data on 0x0810 0000
Please Can you tell me what I'm doing wrong?
