Skip to main content
Associate II
December 11, 2023
Solved

STM32g0xx change boot address with option bytes

Hi, 

I used this code to change the boot address in the STM32U575 project:

FLASH_OBProgramInitTypeDef OB_Data;

/* Unlock Flash Control register and Option Bytes */

HAL_FLASH_Unlock();

HAL_FLASH_OB_Unlock();

OB_Data.OptionType = OPTIONBYTE_USER | OPTIONBYTE_BOOTADDR;

OB_Data.USERType = OB_USER_TZEN | OB_USER_NBOOT0 | OB_USER_NSWBOOT0;

OB_Data.USERConfig = OB_TZEN_DISABLE | OB_NBOOT0_RESET | OB_BOOT0_FROM_OB;

OB_Data.BootAddrConfig = OB_BOOTADDR_NS1;

OB_Data.BootAddr = addr;

/* Program Option Bytes */

HAL_FLASHEx_OBProgram(&OB_Data);

/* Launch Option Bytes Loading */

HAL_FLASH_OB_Launch();

How to do the same in the STM32G0xx project?

 

This topic has been closed for replies.
MishKa59Best answer
Associate II
December 12, 2023

Wow, sadly, Thank you.

2 replies

TDK
December 12, 2023

The boot address can't be changed on the G0.

"If you feel a post has answered your question, please click ""Accept as Solution""."
MishKa59AuthorBest answer
Associate II
December 12, 2023

Wow, sadly, Thank you.