cancel
Showing results for 
Search instead for 
Did you mean: 

Can not connect STM32G030 to CubeProgrammer

Bhavil
Associate II

Hi,

I recently created a custom board based on STM32G030 IC and programmed it via UART to run my application. Now, I want to make some changes to my firmware, but I can not connect to the CubeProgrammer. I have tried connecting it via UART and ST-LINK. Below are the errors i get when I try to connect the board via different methods

via UART- "Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again... "

via ST-Link- "Error: No STM32 target found! If your product embeds Debug Authentication, please perform a discovery using Debug Authentication". The interesting thing here is that CubeProgrammer reads the board as a Nucleo-F303RE(I am using the ST-LINK from this board and have removed the necessary jumpers i.e on CN2)

I have tried to give 3.3V to pin 19(PA14) of the IC which is the Boot0 pin and restarting the board, but I am still not able to program the board. I can confirm that the IC is running the firmware which I uploaded as I can view it on one of my COM ports. How do I get the board back into programming mode? Even the SWD debugging is not working

Bhavil_0-1719049242418.png

 

14 REPLIES 14

Thanks Ascha,

That worked well, now I can access the device using SWD. Pardon me as I am fairly new to STM32 and am a little confused regarding the BOOT select and all the option bytes. I am reading the reference manual and the data sheet but the wordings confuse me.

Would you be able to help me set my option bytes so that I do not face a similar issue in the future?

:)

Option now "normal" , swd access with reset .

What other setting you want ?

+

First try also : software reset

AScha3_0-1719217468478.png

(I dont have G03 , so i cannot try...working, or not.)

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

Yupp, Normal and Software reset works too. If possible can you help out with the nBoot bits as well. I would like to reprogram the board using UART, which is not possible at the moment as, I think the code is directly jumping to the firmware regardless of the state of the NRST pin.

Thanks

Ok. 

+

> I would like to reprogram the board using UART

Then you have to use the Boot pin , PA14/15 ; + pulldown (10k) ; + 100nF cap on NRST .

+ set nBOOT_SEL bit -> 0 (with swd connection -> option bytes )

Then (after reset, with boot pin PA14 : high ) you get bootloader access on Rx/Tx .

So you need : nrst, swd, swc, boot pin, and Rx, Tx ; 6 pins for this !

-----

If you just use st-link , swd, then : nrst, swd, swc ; 3 pins .

And you can even the swd+swc pins use for other function, if dont need debug any more;

still have access to swd with hard-reset/under reset , to flash/program/set option bytes .

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

Great,

So I am better off with Serial-wire debugging while using the same settings then. Thanks a lot for your help.