cancel
Showing results for 
Search instead for 
Did you mean: 

Has anyone gotten the boot0 pin to work on an STM32G071? (SOLVED)

DWelc
Associate II

It goes into the bootloader only with a virgin part, once programmed once (using the bootloader) asserting boot0 during a power on or reset runs the application code not the bootloader.

15 REPLIES 15
Andreas Bolsch
Lead II

Verify nBOOT0, nBOOT1, nBOOT_SEL settings according to section 2.5 in the RM.

DWelc
Associate II

why wouldnt they default in a new part to function like every other stm32 part?

why wouldnt they default in a new part to function like every other stm32? will try to look.

Andreas Bolsch
Lead II

Because one major point of the G familiy is not to sacrifice any pin ... Only one pair of supply pins, no BOOT pin (by default).

The production value of 'User and read protection option bytes' at 0x1FFF7800 is 0xFFFFFEAA, i. e. nBOOT0, nBOOT1, nBOOT_SEL all default to '1'. And description reads:

Bit 24: nBOOT_SEL

0: BOOT0 signal is defined by BOOT0 pin value (legacy mode)

1: BOOT0 signal is defined by nBOOT0 option bit

So, by default, BOOT0 pin is 'don't care' regarding boot mode.

DWelc
Associate II

I see the legacy mode thing. And do see that BOOT0 is shared with an SWD pin. kinda sad but think it is related to IoT security.

nBOOT_SEL was set from the factory so once cleared then the B00T0 pin works as desired. Fortunately I have the tools to do this (swd debugger and was able to get in and run a program in ram as using openocd mdw commands does not work).

So step one on a virgin part if you only have/want to use the debugger uart/other interface is to have the first program loaded be one that clears the nBOOT_SEL pin, do a power cycle, then you can get back in with BOOT0.

CChen.16
Associate II

Hi,

Actually I am trying to ask a question about the BOOT0 pin on G070RB here. I am using a Nucleo-G070RB board, changed the nBOOT_SEL to 0 through debugger, but BOOT0 pin still does not work. The board is always go to the main flash, no matter the pin is high or low.

The FLASH->OPTR value is 0xDEFFE1AA, FLASH->SECR is 0

Do you know why? I am so frustrated with this problem, any help is appreciated.

Thanks.

Andreas Bolsch
Lead II

The OPTR value seems to be correct, SECR too (although officially the G070 hasn't got the SECR register at all).

Note that there is a conflict on PA14/BOOT0 pin: It's used for SWCLK after reset and for BOOT0, too. To set the pin value properly, the debugger must be disconnected, i. e. jumpers on CN4 have to be removed on the nucleo board.

CChen.16
Associate II

Thank you so much. After I removed the jumps on CN4, the BOOT0 pin works.

Hi,

what is the code to be written for option bytes?