Skip to main content
Associate II
October 16, 2024
Question

Using pre-programmed bootloader on STM32G0B0RE

  • October 16, 2024
  • 16 replies
  • 6577 views

hello

I am developping on a STM32G0B0RE, I've learned after finishing my board and everything that boot pin can be used by default.

It is not a problem since I have ST-Link for production but I would like to be able to do firmware update through bootloader.

 

The issue is, since nBOOT_SEL is set to '1' by default I need to change it to 0 so I go in bootloader if my pin PA14-BOOT0 is tied up at startup. I find how to change it in STM32CubeProgrammer but I would like to do it in my firmware so the flashing process is not too complicated in factory.

 

I've tried this but it does not have any effect : 

Tiboww_0-1729088556950.png

Best Regards

Thibaud HABRAND

This topic has been closed for replies.

16 replies

mƎALLEm
ST Technical Moderator
October 16, 2024

Hello @Tiboww and welcome to the community,

Using user option byte:

SofLit_0-1729094824462.png

Refer to the RM0444 / 2.5 Boot configuration

 

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
TibowwAuthor
Associate II
October 17, 2024

Hello

I know this table, as I said I've been able de modify "nBOOT_SEL" bit in the STM32CubeProgrammer but I would like to implement it in my firmware. So they only need to flash a firmware in factory. 

I am developping on STM32CubeIDE v1.16.0, I tried to use the function "HAL_FLASHEx_OBGetConfig". Can you tell me if I am using this function wrong or I have to do an other way ? 

Best Regards

Thibaud HABRAND

TibowwAuthor
Associate II
October 22, 2024

Hello 

 

@mƎALLEm Do you have any update on my case ?

 

Best Regards

Thibaud HABRAND

Shirley.Ye
ST Employee
October 22, 2024

ShirleyYe_0-1729583993151.png

D you mean you cannot change your "nBOOT_SEL" bit from 1 to 0 by the function HAL_FLASHEx_OBProgram?

please note:

New option bytes configuration will be taken into account in two cases:
* - after an option bytes launch through the call of @ref HAL_FLASH_OB_Launch()
* - after a power reset (BOR reset or exit from Standby/Shutdown modes) 

TibowwAuthor
Associate II
October 22, 2024

Hello

I've tried to add HAL_FLASH_OB_Launch() : 

Tiboww_2-1729606178517.png Tiboww_1-1729606143898.png

Tiboww_3-1729606242296.png Tiboww_4-1729606264366.png

Tiboww_5-1729606297463.png Tiboww_6-1729606314161.png

 

 

I didi'nt tried power reset because when I do programm then get it seems like the modification didn't do anything in the register and it changed only my local structure.

BR 

Thibaud