cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot upload to STM32G030F6P6 with CUBEIDE and CUBE Programmer :(

Sahiru
Associate II

Hi,

I have a STM32G030F6P6 connected to an STLink. I cannot upload at least an LED toggle code to the chip. I get the following messages in the CubeProgrammer. And I get "Cannot insert all breakpoints" error in the CUBE IDE.

I double triple checked my voltages. They are 3.3V. But still the messages from the Cube Programmer shows as 2.93V. Can you please comment on this and help me.

 09:30:41 : STM32CubeProgrammer API v2.8.0

 09:30:41 : ST-LINK error (DEV_CONNECT_ERR)

 09:31:01 : ST-LINK SN : 34FF6D064155303923251357

 09:31:01 : ST-LINK FW : V2J38S7

 09:31:01 : Board      : --

 09:31:01 : Voltage    : 2.93V

 09:31:01 : SWD freq   : 4000 KHz

 09:31:01 : Connect mode: Normal

 09:31:01 : Reset mode : Hardware reset

 09:31:01 : Device ID  : 0x466

 09:31:01 : Revision ID : Rev 1.1

 09:31:02 : UPLOADING OPTION BYTES DATA ...

 09:31:02 :  Bank         : 0x00

 09:31:02 :  Address      : 0x40022020

 09:31:02 :  Size         : 112 Bytes

 09:31:02 : UPLOADING ...

 09:31:02 :  Size         : 1024 Bytes

 09:31:02 :  Address      : 0x8000000

 09:31:02 : Read progress:

 09:31:02 : Data read successfully

 09:31:02 : Time elapsed during the read operation is: 00:00:00.008

 09:31:04 : Memory Programming ...

 09:31:04 : Opening and parsing file: DryBox Test.hex

 09:31:04 :  File         : DryBox Test.hex

 09:31:04 :  Size         : 5316 Bytes

 09:31:04 :  Address      : 0x08000000

 09:31:04 : Erasing memory corresponding to segment 0:

 09:31:04 : Erasing internal memory sectors [0 2]

 09:31:04 : Error: failed to erase memory

 09:31:04 : Error: failed to erase memory

 09:31:04 : Error: Unable to get core ID

 09:31:04 : Error: Unable to get core ID

 09:31:04 : Warning: Connection to device 0x466 is lost

 09:31:05 : Disconnected from device.

 09:31:05 : ST-LINK error (DEV_CONNECT_ERR)

 09:31:15 : Error: Connection to target must be established before performing file download operation.

 09:31:15 : Error: Connection to target must be established before performing the execute command.

 09:31:18 : ST-LINK SN : 34FF6D064155303923251357

 09:31:18 : ST-LINK FW : V2J38S7

3 REPLIES 3
RRoma.4
Associate II

Hello, this processor is on your board or bought from some site?

I got many of these cheap board with processor locked with a bad cfg word, no idea why they do this. Symptom are unreadable processor and failure on erase like your report. From cube programmer read CFG register and look at value.

From your log programmer report Hardware reset, is reset pin connected? If not change to software reset and retry.

If this doesn't solve, connect reset pin then launch cube programmer and do a full chip erase. After that processor is unlocked and you can access.

Javier1
Principal

I have the same issue with an stm32g030j6, the parts are original stm32 from trusted source.

The mcus were programmed before (no serial wire debugging pins were enabled), now when i want to programm them again i get a similar error than @Sahiru​ 

 I tried in CubeProgrammer Modes :

Power down

0693W00000KdMwUQAV.png

10:16:30:393 : STLinkUSBDriver.dll loaded
  10:16:30:395 : STLinkUSBDriver.dll loaded
  10:16:30:396 : ST-LINK SN  : 50FF6D067788545440291967
  10:16:30:396 : ST-LINK FW  : V2J39S7
  10:16:30:396 : Board       : --
  10:16:30:397 : Voltage     : 3.21V
  10:16:31:608 : SWD freq    : 4000 KHz
  10:16:31:608 : Connect mode: Power Down
  10:16:31:608 : Reset mode  : Hardware reset
  10:16:31:614 : Device ID   : 0x466
  10:16:31:614 : Revision ID : Rev 1.1
  10:16:31:632 : Reading data...
  10:16:31:636 : r ap 0 @0x1FFF77DD 0x00000004 bytes Data 0xFF000030
  10:16:31:636 : Reading data...
  10:16:31:637 : r ap 0 @0x1FFF77DD 0x00000004 bytes Data 0xFF000030
  10:16:31:637 : Database: Config 1 is active.
  10:16:31:638 : flash loader C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/FlashLoader/0x466.stldr is loaded
  10:16:31:639 : Reading data...
  10:16:31:641 : r ap 0 @0x1FFF75E0 0x00000004 bytes Data 0xFFFF0020
  10:16:31:805 : UPLOADING OPTION BYTES DATA ...
  10:16:31:806 :   Bank          : 0x00
  10:16:31:806 :   Address       : 0x40022020
  10:16:31:806 :   Size          : 112 Bytes
  10:16:31:806 : Reading data...
  10:16:31:806 : r ap 0 @0x40022020 0x00000070 bytes Data 0xDFFFE1AA
  10:16:31:807 : UPLOADING OPTION BYTES DATA ...
  10:16:31:807 :   Bank          : 0x00
  10:16:31:807 :   Address       : 0x40022020
  10:16:31:807 :   Size          : 112 Bytes
  10:16:31:807 : Reading data...
  10:16:31:807 : r ap 0 @0x40022020 0x00000070 bytes Data 0xDFFFE1AA
  10:16:31:808 : UPLOADING ...
  10:16:31:808 :   Size          : 1024 Bytes
  10:16:31:808 :   Address       : 0x8000000
  10:16:31:808 : Read progress:
  10:16:31:809 : Reading data...
  10:16:31:809 : r ap 0 @0x08000000 0x00000400 bytes Data 0x20002000
  10:16:31:809 : Data read successfully
  10:16:31:809 : Time elapsed during the read operation is: 00:00:00.006
  10:16:32:786 : Error: Unable to get core ID
  10:16:32:790 : Error: Unable to get core ID
  10:16:32:790 : Warning: Connection to device 0x466 is lost
  10:16:33:116 : Disconnected
  10:16:33:117 : Disconnected from device.
  10:16:33:119 : STLinkUSBDriver.dll loaded

Normal/hot plug/under reset

  10:34:43:880 : STLinkUSBDriver.dll loaded
  10:34:43:881 : STLinkUSBDriver.dll loaded
  10:34:43:882 : ST-LINK SN  : 50FF6D067788545440291967
  10:34:43:882 : ST-LINK FW  : V2J39S7
  10:34:43:883 : Board       : --
  10:34:43:884 : Voltage     : 3.21V
  10:34:43:887 : Error: No STM32 target found!
  10:34:43:902 : Disconnected

we dont need to firmware by ourselves, lets talk

it turned out to be defective wiring, all works for me now

we dont need to firmware by ourselves, lets talk