cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G030F6P6 STMCubeProgrammer

T.Die
Associate II

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. 

1 ACCEPTED SOLUTION

Accepted Solutions

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.

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

View solution in original post

5 REPLIES 5
TDK
Guru

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.

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

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

>>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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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.

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

Hi TDK,

Thank you for the feedback. 

After setting the nBootSel to unchecked I was able to program and reprogram the microcontroller 

TDie_0-1725968661252.png

Now I just have to wait for my st-link to unlock my other 2 microcontrollers. 

Kind regards,

Dieter