cancel
Showing results for 
Search instead for 
Did you mean: 

Troubles changing boot1 address in Flash Option Bytes

BNord.1
Associate III

Hello,

I am having troubles changing boot1 address in Option Byte in Flash

I want to change boot1 address, allowing me to launch either in bootloader mode (system memory) or usercode mode(flash) without using a jump.

I am currently testing on the STM32H743 EVAL Board

Here is the code changing the address and it does not appear its changing anything

HAL_FLASH_OB_Unlock();
HAL_FLASH_Unlock();
 
/* Change Boot0 address */
 
if(mode)OBInit.BootAddr1 = BOOTLOADER_ADDR0;
else OBInit.BootAddr1 = USER_CODE_ADDR0;
HAL_FLASHEx_OBProgram(&OBInit);
 
if (HAL_FLASH_OB_Launch() != HAL_OK)
{
	return(-1);//error
}
 
HAL_FLASH_OB_Lock();
HAL_FLASH_Lock();

Thanks,

Gabriel

1 ACCEPTED SOLUTION

Accepted Solutions
BNord.1
Associate III

Fixed :

Added 

OBInit.BootConfig=OB_BOOT_ADD1;

before

if(mode)OBInit.BootAddr1 = BOOTLOADER_ADDR0;

View solution in original post

1 REPLY 1
BNord.1
Associate III

Fixed :

Added 

OBInit.BootConfig=OB_BOOT_ADD1;

before

if(mode)OBInit.BootAddr1 = BOOTLOADER_ADDR0;