Troubles changing boot1 address in Flash Option Bytes
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-10-21 2: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.
Labels:
- Labels:
-
Flash
-
STM32H7 Series
1 ACCEPTED SOLUTION
Accepted Solutions
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-10-21 3:43 AM
Fixed :
Added
OBInit.BootConfig=OB_BOOT_ADD1;
before
if(mode)OBInit.BootAddr1 = BOOTLOADER_ADDR0;
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-10-21 3:43 AM
Fixed :
Added
OBInit.BootConfig=OB_BOOT_ADD1;
before
if(mode)OBInit.BootAddr1 = BOOTLOADER_ADDR0;
