Skip to main content
Visitor II
April 26, 2023
Solved

How to modify boot configuration bits STM32G030?

  • April 26, 2023
  • 3 replies
  • 4811 views

Hello everybody:

I’m facing the following problem. To boot the microcontroller right know I have pin PA14 – BOOT0 to GND through a 10K pull down resistor (This pin is also shared with SYS_SWCLK) and BOOT0, nBOOT_SEL bit to 0 -> Boot area main Flash memory.

I want to achieve the same thing with nBOOT_SEL, nBOOT1, NBOOT0 bits.

To do that, I connect the programmer and access the option bytes -> user configuration -> set the pins as shown in the image and apply.


_legacyfs_online_stmicro_images_0693W00000bit99QAA.pngWhen I disconnect the programmer, power off then power on again the program doesn’t boot (now PA14 – BOOT0 is not connected with pull-down resistor). I am doing something wrong?

Thanks in advance.

    This topic has been closed for replies.
    Best answer by Sarra.S

    Hello @JSope.1​,

    In fact, once BOOT0 pin is pulled to GND, there is no need to configure nBOOT0 bit and nBOOT1 bit, you either configure these options bytes or work with the BOOT0 pin.

    To make it clear, you either work with BOOT0 pin, in this case nBOOT SEL must be 0, nBOOT0 and nBOOT1 bits won't matter


    _legacyfs_online_stmicro_images_0693W00000biy1PQAQ.png 

    Or you work with options bytes, in this case nBOOT_SEL bit =1, and the option bytes will determine your selected boot area


    _legacyfs_online_stmicro_images_0693W00000biy23QAA.png

    3 replies

    Sarra.SAnswer
    ST Employee
    April 27, 2023

    Hello @JSope.1​,

    In fact, once BOOT0 pin is pulled to GND, there is no need to configure nBOOT0 bit and nBOOT1 bit, you either configure these options bytes or work with the BOOT0 pin.

    To make it clear, you either work with BOOT0 pin, in this case nBOOT SEL must be 0, nBOOT0 and nBOOT1 bits won't matter


    _legacyfs_online_stmicro_images_0693W00000biy1PQAQ.png 

    Or you work with options bytes, in this case nBOOT_SEL bit =1, and the option bytes will determine your selected boot area


    _legacyfs_online_stmicro_images_0693W00000biy23QAA.png

    JSope.1Author
    Visitor II
    May 2, 2023

    Hello, first of all sorry for the late response:

    I have done a test with only option bits as you described, nBOOT_SEL bit to 1, BOOT0 bit to 0 and nBOOT1 pin to 1.

    I made those changes with the programmer connected to the microcontroller with the STM32CubeProgrammer.

    I wrote a program to blink a led, when I disconnect the device from power and from the debugger and then power on again, the led doesn't blink. It looks like the micro is in Reset permanently or Halted.

    I am doing something wrong?

    Thank you in advance. (Using the pin works fine).

    Super User
    May 2, 2023

    > nBOOT_SEL bit to 1, BOOT0 bit to 0 and nBOOT1 pin to 1.

    You mean nBOOT0 bit to 0? Look at the second picture of what @Sarra.S​  posted.

    JW

    JSope.1Author
    Visitor II
    May 2, 2023

    No, sorry for the typo, nBOOT0 bit to 1.

    JS