cancel
Showing results for 
Search instead for 
Did you mean: 

STM32g0xx change boot address with option bytes

MishKa59
Associate II

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions

Wow, sadly, Thank you.

View solution in original post

2 REPLIES 2
TDK
Guru

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

If you feel a post has answered your question, please click "Accept as Solution".

Wow, sadly, Thank you.