cancel
Showing results for 
Search instead for 
Did you mean: 

i have problems that stm32f767 nucleo Board configed flash bank

User.72
Associate II

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?​

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

Hello @부�? 강​ ,

Make sure that you have the same condition (Bootloader version) in the "Table 84. STM32F76xxx/77xxx bootloader V9.x versions" from AN2606, which lists the Known limitations of STM32F76xxx/77xxx devices bootloader V9.x versions. 

For STM32F7 Series having the Dual Bank Boot feature, you have to disable nDBOOT and/or nDBANK features (in option bytes), then jump to bootloader.

So, when the Flash memory is configured to the dual bank boot mode (nDBANK=nDBOOT=0), whatever the BOOT0 Pin state only BOOT_ADD0 value is considered (when BOOT0 Pin=1, BOOT_ADD0 value is considered not the BOOT_ADD1).

Workaround: in order to manage dual bank boot with BOOT_ADD0 only.

Please, keep us informed about your update.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

2 REPLIES 2
Imen.D
ST Employee

Hello @부�? 강​ ,

Make sure that you have the same condition (Bootloader version) in the "Table 84. STM32F76xxx/77xxx bootloader V9.x versions" from AN2606, which lists the Known limitations of STM32F76xxx/77xxx devices bootloader V9.x versions. 

For STM32F7 Series having the Dual Bank Boot feature, you have to disable nDBOOT and/or nDBANK features (in option bytes), then jump to bootloader.

So, when the Flash memory is configured to the dual bank boot mode (nDBANK=nDBOOT=0), whatever the BOOT0 Pin state only BOOT_ADD0 value is considered (when BOOT0 Pin=1, BOOT_ADD0 value is considered not the BOOT_ADD1).

Workaround: in order to manage dual bank boot with BOOT_ADD0 only.

Please, keep us informed about your update.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Imen.D
ST Employee

Hi @부�? 강​ ,

Do you have still this problem to solve?

Let me know if my suggestion solved your issue,, if so please "Select as Best" button.

If you still need help, feel free to ask your question in more detail.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen