cancel
Showing results for 
Search instead for 
Did you mean: 

Uploading code to STM32G030F6 IC

SRauf
Associate II

Hi all.

I am having some trouble with communicating with an STM32G030F6 IC. I am using STM32CubeIDE to code and STlink-v3 mini to upload the code. The SWCLK and SWDIO pins are being used to upload the code. 3.3V is being supplied from elsewhere and the voltage reference for all the peripherals connected (STlink, STM32 IC, Power supply) are common. At first I was not able to upload the code at all, and was getting the "Target device held at reset" error which was resolved by pulling up the NRST pin. At this point the code is uploading, and the IDE goes into debug mode but I cannot get the code to function. The code is a simple blink code which toggles Pin 5 of Port A every second. This is being done using HAL_GPIO_TogglePin() and HAL_DELAY() functions. Any insight to what the problem could be?

Any and all help will be greatly appreciated.0693W00000Nq4anQAB.png

1 ACCEPTED SOLUTION

Accepted Solutions
Markus GIRDLAND
ST Employee

Hello there,

It's difficult to say without additional information.

If the code is being flashed successfully with CubeProgrammer and the debug session runs without issue but the code is not doing what you wish it to do then I see two potential problems:

  1. The code on the board is not the actual code of your application. Potential solution would be to mass erase the board and flash it again.
  2. The code is not written correctly. This is harder to provide a potential solution to, would probably need further analyzing.

View solution in original post

2 REPLIES 2
gbm
Lead III

There is something wrong with the schematic or assembly and since you didn't show it there is no way to point out the problem. Normally NRST may be left unconnected.

Markus GIRDLAND
ST Employee

Hello there,

It's difficult to say without additional information.

If the code is being flashed successfully with CubeProgrammer and the debug session runs without issue but the code is not doing what you wish it to do then I see two potential problems:

  1. The code on the board is not the actual code of your application. Potential solution would be to mass erase the board and flash it again.
  2. The code is not written correctly. This is harder to provide a potential solution to, would probably need further analyzing.