Skip to main content
Visitor II
September 26, 2022
Question

Cannot connect to target STM32G0316-DISCO

  • September 26, 2022
  • 6 replies
  • 3137 views

I had a working STM32G0316-DISCO board, but after programming the STM31G031 I cannot connect to the MCU anymore using ST-LINK. This is because I set pin 7 and 8 to a digital input whereas pin 7 and 8 are SWDIO and SWCLK respectively as well. This messes up the communication. I tried to pull pin 8 high (which is the boot0 pin as well) when powering the board in order to force it in a different boot mode, but STM32CubeProgrammer still cannot connect to the board, reporting "Error: No STM32 target found!"

I also tried setting the program mode to "under reset" as well as "power down" and the reset mode to "Software reset", but nothing seems to work. What I can do?

    This topic has been closed for replies.

    6 replies

    Technical Moderator
    September 26, 2022

    Hello @PPott.1​ ,

    Maybe your ST-Link need upgrade firmware.

    Check connectivity options and the jumper position on the board (according to the UM2603)

    Try on another hardware and check if you have the same issue.

    Otherwise, It will be better to share your log. For that, Go into your Debug Configuration and in the "Debugger" tab under the "Misc" category > checkbox "Log to file", you should enable that, then launch a new debug session and share the log.

    Imen

    Graduate II
    September 26, 2022

    If the board provides a means to pull BOOT0 HIGH, do that.

    PPott.1Author
    Visitor II
    September 26, 2022

    Thanks for the replies. I forgot to mention that I'm not using an external ST-LINK, but just the one of the discovery board (just to be clear). To my best knowledge, it has the latest firmware, since STM32CubeIDE asked to upgrade this. I don't see any pinheader for the boot0 pin, however. Here is the log:

    Attached is the log file. I already bricked 2 STM32G031-DISCO boards like this.

    Graduate II
    September 26, 2022

    It's one of these ridiculously low pin count devices.

    Perhaps put a delay in the Reset_Handler so that you don't break all the debug pins immediately upon starting, or add some code so you can erase the part via some user/pin level interaction in your normal use case.

    BOOT0? Perhaps pull-up Pin 8 ?

    https://www.st.com/resource/en/schematic_pack/mb1454-g031j6-b02_schematic.pdf

    PPott.1Author
    Visitor II
    September 26, 2022

    I tried to pull-up pin 8, then reset the device and then connect with ST-LINK, but it seems like it still doesn't go into a different boot mode. It keeps saying it cannot connect. No idea why. I can add your delay suggestion once I have a new chip. Still am hoping if I can use the other ones..

    Visitor II
    June 27, 2023

    Hi,

    Did you find any solution about the issue? I tried that way, but I couldn't any solution.

    Visitor II
    June 27, 2023

    Hello PPott.1

    Use CubeProgrammer. Try to hold the small reset button, push the yellow Connect in CubeProgrammer and release the button. Just have a feeling for the good timing. Do a full chip erase. Maybe this helps.

    Gr.RFM

    Visitor II
    July 3, 2023

    I solved the problem. Due to a code I threw, I could see the board but could not communicate. So I had to delete the program inside. But I couldn't connect with cube programmer to delete the code inside. For this, I removed the current protection pin on the board. In Cube Programmer, I put it in "power down" mode, pressed the "connect" button continuously, plugged the current protection pin and started communicating. Then I deleted the code inside.