Skip to main content
Explorer
September 6, 2024
Solved

STM32G030F6P6 STMCubeProgrammer

  • September 6, 2024
  • 1 reply
  • 1725 views

Hi,

After I program an STM32G030F6P6 I can't connect again with the STMCubeProgrammer. I have checked that my boot pin is in the correct position but still I keep on getting the error:

TDie_0-1725624908750.png

I have used a simple program that got generated by STM32CubeIde to download to the microcontroller.

Is there a setting that sets the chip protected orso when programming the microcontroller?

Kind regards

 

edit: the simple program sets PA2 to USART_TX and PA3 to USART_RX, don't know it this could give an issue. 

    This topic has been closed for replies.
    Best answer by TDK

    Looking at AN2606, here's what it takes to get into the bootloader:

    TDK_0-1725631942191.png

    From RM0454, all option bits are high by default except BOOT_LOCK because it "doesn't exist". So nBoot0 = nBoot1 = nBOOT0_SEL = 1. And BOOT_LOCK = 0.

    It went into the bootloader initially because flash is empty (third line). Now it doesn't because you have a program there.

     

    To recover, you'll need to connect with SWD and change the option bytes.

     

    What you're doing is viable approach for flashing an empty chip, but it won't work for re-flashing, at least not without configuring option bits first.

    1 reply

    Super User
    September 6, 2024

    It looks like you're trying to connect to the bootloader. You will need to hold BOOT0 high during reset to launch the bootloader, otherwise user code will execute, and the chip will not be listening for a bootloader connection.

    For development and debugging, a connection over SWD is much more preferred and will allow you to be more productive.

    T.DieAuthor
    Explorer
    September 6, 2024

    Hi @TDK ,

    Thank you for your response.

    That was what I meant with " I have checked that my boot pin is in the correct position". 

    So what I have tried:

    1. Connected pin19 (PA14-Boot0) to 3.3V with a switch in close position. Then powered the board. = Error message when trying to connect
    2. Connected pin19 (PA14-Boot0) to 3.3V with a switch in close position. Then powered the board. Connected pin6 (NRST) to ground and released the ground = Error message when trying to connect
    3. Soldered pin19 to 3.3V, then powered the board = Error message when trying to connect
    4. Soldered pin19 to 3.3V, then powered the board and give a pulse of pin6 to ground. = Error message when trying to connect

    Is there a way I can verify that the bootloader has started? 

    I understand that SWD is more productive, but I also need this way so that I can reprogram future boards in production. 

    Kind regards

    Graduate II
    September 6, 2024

    >>Is there a way I can verify that the bootloader has started? 

    Hot plug with the SWD/JTAG debugger, and STOP the MCU. The code should be executing at 0x1FFFxxxx address space.

    Noise on other UARTs, or connections described in AN2606 can occur first and *** the loader, say GNSS or MODEMs that chirp at start-up