cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G031: cannot program the Discovery Kit

MCerv.1
Associate II

Hey guys and gals!

Just received the STM32G031 Discovery Kit with the stm32g031j6m6 chip in the SO8 package. The thing is all my   attempts to program it failed.

When the usb cable is plugged in a 'drive' connects where there are two files:

1. DETAILS.TXT containing (probably) a result after the ST-LINK firmware update: "Version: V2J42M27
Build: Mar 7 2023 17:19:20"

2. FAIL.TXT containing "The interface firmware FAILED to reset/halt the target MCU"

When attempting to upload a "blinky" code (a new project, just flipping the LED) the process fails with

"""

Target no device found

Error in initializing ST-LINK device.

Reason: No device found on target.

"""

Having read through numerous posts even this one did not help: https://community.st.com/t5/stm32-mcu-products/solved-stm32g031j6-disco-can-no-longer-program-the-chip-no/m-p/98007 

Jumper IDD (JP1) is in position. The user led (LD2) flashes in regular intervals but with no effect from the user button (as mentioned in the pdf document).

I attempted to run the program from the CUBE IDE, with Reset behaviour configured through all the options: Connect under reset, Software system reset, Hardware reset, Core reset (have no idea what that stands for), and None. All with the same result.

Normally I would say he programmer (ST-LINK) is not properly connected to the target, but this is a fresh dev board straight out of the box.

Could anyone suggest what could be wrong?

With kind regards,

Mirek

1 ACCEPTED SOLUTION

Accepted Solutions
MCerv.1
Associate II

Problem *SOLVED*. The trouble was reassigning the programming pins to UART. Henece, unless full flash erase the chip cannot be programmed again. The solution is to chop the uC off the dev board, wire it on the bredboard while connecting (an arbitrary) ST-LINK programmer and keeping boot0 (pin#4) low upon power-on. Then the chip can be erased using the STM32CubeProgrammer. The exact procedure is once again as follows:

 

* If i set the ST-LINK configuration to:

Mode: Normal

Reset Mode: Software Reset

Then, I can successfully connect if I:

Press and hold the reset button on the board

Click the Connect button in the cube programmer

Release the reset button

 

(found it somewhere on stack overflow, just do not have the link anymore). Its alive again!

View solution in original post

1 REPLY 1
MCerv.1
Associate II

Problem *SOLVED*. The trouble was reassigning the programming pins to UART. Henece, unless full flash erase the chip cannot be programmed again. The solution is to chop the uC off the dev board, wire it on the bredboard while connecting (an arbitrary) ST-LINK programmer and keeping boot0 (pin#4) low upon power-on. Then the chip can be erased using the STM32CubeProgrammer. The exact procedure is once again as follows:

 

* If i set the ST-LINK configuration to:

Mode: Normal

Reset Mode: Software Reset

Then, I can successfully connect if I:

Press and hold the reset button on the board

Click the Connect button in the cube programmer

Release the reset button

 

(found it somewhere on stack overflow, just do not have the link anymore). Its alive again!