cancel
Showing results for 
Search instead for 
Did you mean: 

I can't write to my STM32G03 when connect in Hot plug mode, and I get DEV_TARGET_CMD_ERR whenever I try to connect in Normal mode.

LMeye.1
Associate III

I am trying to directly write to some STM32G03 chips.

I have an "STM32G030J6M6" and a "STM32G031F6P6" but I am unable to write to them.

I can connect to them, using the CubeProgrammer, but only in "Hot plug" mode, and when I try to write anything, like flash or erase, it just disconnects.

If I try erasing it, it says "Please verify write protection" but there shouldn't be any, as this is a new chip.

If I try and connect to the chip in "Normal" mode, it just gives me an error, saying "DEV_TARGET_CMD_ERR"

I have tried holding down the reset pin, but that doesn't help. When I release it, it just gives me the same error.

This is the output when I try to connect in normal mode.

09:42:02 : ST-LINK SN  : 36FF73065648343826450743
09:42:02 : ST-LINK FW  : V2J38S7
09:42:02 : Board       : --
09:42:02 : Voltage     : 1.50V
09:42:02 : Error: ST-LINK error (DEV_TARGET_CMD_ERR)

This is the output for "Hot plug" + erase.

09:45:33 : ST-LINK SN  : 36FF73065648343826450743
09:45:33 : ST-LINK FW  : V2J38S7
09:45:33 : Board       : --
09:45:33 : Voltage     : 1.50V
09:45:33 : SWD freq    : 4000 KHz
09:45:33 : Connect mode: Hot Plug
09:45:33 : Reset mode  : Hardware reset
09:45:33 : Device ID   : 0x466
09:45:33 : Revision ID : Rev 1.1
09:45:33 : UPLOADING OPTION BYTES DATA ...
09:45:33 :   Bank          : 0x00
09:45:33 :   Address       : 0x40022020
09:45:33 :   Size          : 112 Bytes
09:45:33 : UPLOADING ...
09:45:33 :   Size          : 1024 Bytes
09:45:33 :   Address       : 0x8000000
09:45:33 : Read progress:
09:45:33 : Data read successfully
09:45:33 : Time elapsed during the read operation is: 00:00:00.008
09:45:38 : MASS ERASE ... 
09:45:38 : Error: Mass erase operation failed.Please verify flash protection
09:45:38 : Error: Unable to get core ID
09:45:38 : Warning: Connection to device 0x466 is lost
09:45:38 : Disconnected from device.

1 ACCEPTED SOLUTION

Accepted Solutions
Bruno_ST
ST Employee

@LMeye.1​ 

In fact the target power is measured by pin 1/2 so you need to connect pin 19+pin1 (or 2) together.

I have checked OutputPowerToTarget but it is not specified. According to schematics, pin 19, output power behind the regulator LD3985M33R through 10Ohms resistance. So it should be fine if you are not powering to much components...

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

11 REPLIES 11
Bruno_ST
ST Employee

Hello @LMeye.1​ ,

Voltage : 1.50V seems a little bit low. Can you try with higher voltage ?

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I don't really know how to change the voltage. It is the CubeProgrammer that has set it as "Target Voltage"

I have used an external 3.3v power supply to power the chip, but that doesn't seem to work either.

LMeye.1
Associate III

I have directly connected the ST-Link/V2 to my chip using the following pins.

19 - Power (constant 3.3v)

20 - Gnd

15 - Reset (NRST)

9 - CLK (TCK_SWCLK)

7 - DIO (TMS_SWDIO)

TDK
Guru

The "Target voltage" is what is detected by ST-Link, not something it sets.

If your board has VDD=1.5V, that would explain why it's not working. Verify power rails.

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

I have tried connecting the VDD to Pin 1/2 on the programmer, which is defined as "VAPP", and that changes the "Target voltage" to between 2.0v and 2.5v, but it still doesn't want to connect.

With this wiring, not even "Hot plug" mode seems to work.

Did you measure the VDD voltage on your target board? What is it? What is it supposed to be per the design? Is your board being powered externally or through the ST-Link device?

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

Currently I am powering the board, using the ST-Link, with the "VAPP" pins. I measure 2.4v on the board, which is within the specs (2v - 3.6v).

I have tried using the constant 3.3v power from the ST-Link, as well as an external 3.3v power supply.

Using the "VAPP" pins, I can't connect to the chip at all, not even using "Hot plug" mode, as I could using constant 3.3v

TDK
Guru

If you are powering the board with 3.3V, and the board is pulling that down to 2.4V, there is a hardware error on your board. Verify pinout is valid, part orientation, and other issues which would cause the voltage to get pulled down.

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

@LMeye.1​ 

In fact the target power is measured by pin 1/2 so you need to connect pin 19+pin1 (or 2) together.

I have checked OutputPowerToTarget but it is not specified. According to schematics, pin 19, output power behind the regulator LD3985M33R through 10Ohms resistance. So it should be fine if you are not powering to much components...

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.