2020-10-21 02:43 AM
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
Solved! Go to Solution.
2020-10-21 03:43 AM
Fixed :
Added
OBInit.BootConfig=OB_BOOT_ADD1;
before
if(mode)OBInit.BootAddr1 = BOOTLOADER_ADDR0;
2020-10-21 03:43 AM
Fixed :
Added
OBInit.BootConfig=OB_BOOT_ADD1;
before
if(mode)OBInit.BootAddr1 = BOOTLOADER_ADDR0;