cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G030 Will Not Program. Please help!

Ryan Coleman
Associate II

Hello,

My company recently rolled 20 boards with STM32G030's. We have a lot of experience working with the G070 but not the G030 MCU.

We're having a tremendous amount of trouble programming these. The MCU will not connect with either CubeProgrammer or CubeIDE.

We've used both an STLink V2 and STLink V3 Mods. We know the programmers are working because they program our G070 boards without issue.

Here is the console output from CubeIDE. It's the standard no device on target message.

STMicroelectronics ST-LINK GDB server. Version 6.0.0
Copyright (c) 2021, STMicroelectronics. All rights reserved.
 
Starting server with the following options:
        Persistent Mode            : Disabled
        Logging Level              : 1
        Listen Port Number         : 41234
        Status Refresh Delay       : 15s
        Verbose Mode               : Disabled
        SWD Debug                  : Enabled
        InitWhile                  : Enabled
 
Target no device found
 
Error in initializing ST-LINK device.
Reason: No device found on target.

And here is the pop-up message.

Error in final launch sequence:
 
Failed to start GDB server
Failed to start GDB server
Error in initializing ST-LINK device.
Reason: (4) No device found on target.

We've verified that the target is powered and looked at the signal's coming out of the STLink.

SWDIO:

0693W00000KcvvUQAR.jpgSWCLK:0693W00000KcvveQAB.jpg 

RST:

0693W00000KcvvoQAB.jpg 

I'm not exactly sure what these are supposed to look like, so any comment would be appreciated. I know the programmer works with the other boards so I assume they are correct.

Attached is our project file. I don' think there is anything in code or configuration that should be causing this.

I'm also going to attach our schematic and layout. Maybe the issue is somewhere in there?

Thanks in advance for any help! I've been pulling out my hair for two weeks trying to get this figured out and have gotten nowhere. With the community help I'm sure we can get it sorted.

Ryan

18 REPLIES 18
KnarfB
Principal III

Hmm. Since you have experience with the G070 there should be not much differences. The TSSOP20 package is new for you, right?

Connect under Reset, otherwise the "empty check" may switch to system boot mode which might use the pins for own purposes.

The SWD connect will start with a line reset whicht is 56 (?) SWCLK toggles while SDWIO high. Don't see that in the pictures. Maybe a LA helps here.

The code (.zip) shouldn't matter, because it all happens before the firmware configures the IOs.

hth

KnarfB

Make sure grounds are common, with external ST-LINK/V2 make sure pin 1 or 2 connect to the VTarget (target side power) so that the buffers are suitably powered/driven.

CM0(+) cores want relatively slow SWCLK, so perhaps try 1 MHz vs 4 MHz, in my experience 24 MHz on the ST device definitely doesn't work.

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

There is no capacitor on NRST.

Hey KnarfB,

Thanks for the response!

Could you elaborate what LA means? The acronym isn't clear for me.

Thanks,

Ryan

Sorry, a logic analyzer. There are even cheap ones ($10, USB connector) with a software that can decode the SWD protocol. You don't have to understand the protocol details, but you see if there are protocol errors, much better that in the above scope screen dumps. In addition, lowering SWD speed might help.

hth

KnarfB

This is a great idea. I haven't used one yet but will get one on order.

We tried down to the minimum frequency but it didn't seem to make any difference. About 6 hours of troubleshooting yesterday and all we got was for Cube Programmer to randomly and intermittently connect to the board a small number of times.

Any idea what could be different between this chip and the G070? Is it more susceptible to noise? Everything else is exactly the same...

Perhaps with the low-pin-count device ST has gotten more creating with the pins, perhaps bonding to different/dual pads on the die, or having functionality adapted via option bytes. Also some option settings latch at power-up, to make things robust from glitching attacks, but does cause power-up vs pin-reset behave subtly different.

If BOOT0 is pulled HIGH, does predictability improve?

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

I don't think I can leave BOOT0 pulled high because the pin is shared with SWDIO on this chip... Maybe I'm misunderstanding.

It seems that they've moved away from using BOOT0 and BOOT1 for configuration and are using the Options Bits in Cube Programmer instead.

I have a cheap LA on order from Amazon. Will get cracking on using that when it shows up tomorrow.

Good catch. We tried adding the cap as shown in the reference design and it didn't seem to help