Skip to main content
Visitor II
March 17, 2022
Question

STM32G030 Will Not Program. Please help!

  • March 17, 2022
  • 5 replies
  • 7171 views

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

    This topic has been closed for replies.

    5 replies

    Super User
    March 17, 2022

    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

    Visitor II
    March 19, 2022

    Hey KnarfB,

    Thanks for the response!

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

    Thanks,

    Ryan

    Super User
    March 19, 2022

    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

    Graduate II
    March 17, 2022

    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.

    Graduate II
    March 17, 2022

    There is no capacitor on NRST.

    Visitor II
    March 19, 2022

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

    Super User
    March 20, 2022

    How do SWDIO and SWCLK behave if you don't connect a ST-LINK? You should be able to detect the internal pull-up / pull-down e.g. with an ammeter.

    hth

    KnarfB

    Explorer II
    March 20, 2022

    I've got no trouble connecting to a bare and virgin G030 in TSSOP20 just by VSS, VDD, SWDIO, SWCLK (even no cap on NRST) to an STLink with test socket and jumper wires at 4MHz SWCLK. Did you test one of your chips before mounting? Maybe defective or faked parts???

    Visitor II
    March 20, 2022

    We had these boards assembled but I have the chip pulled off of one of them. Will check later today or tomorrow AM. We ordered from JLC so I don't think the MCU's are fakes but you never know...