cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to flash STM32G031 (8 pins) with STM32CubeProgrammer & ST-LINK/V2.

fancyrat
Associate III

I've have a custom board with a STM32G031,from the board we have access to the following MCU pins:

  • +3V3_BT
  • NRSTBT
  • SWDIO
  • SWCLK_USARTTX

I've connected this 4 pins to a ST-LINK/V2. Like this (left) mcu, (right) st-link.

  • +3V3_BT --> VCC
  • NRSTBT --> NRST
  • SWDIO --> SWDIO
  • SWCLK_USARTTX --> SWCLK

The current delivered by PSU goes to almost 0 after trying to flash (around 0.004A from the correct 0.041A). When trying to flash the uC these are the errors/log I get:

10:37:32 : ST-LINK SN  : 55FF6E067871515343241267
10:37:32 : ST-LINK FW  : V2J39S7
10:37:32 : Board       : --
10:37:32 : Voltage     : 2,60V
10:37:32 : SWD freq    : 4000 KHz
10:37:32 : Connect mode: Normal
10:37:32 : Reset mode  : Software reset
10:37:32 : Device ID   : 0x466
10:37:32 : Revision ID : Rev 1.1
10:37:35 : Error: Database: There's no active configuration for this device. All the 6 configurations are disabled!
10:37:35 : Debug in Low Power mode is not supported for this device.
10:37:36 : UPLOADING OPTION BYTES DATA ...
10:37:36 :   Bank          : 0x00
10:37:36 :   Address       : 0x40022020
10:37:36 :   Size          : 108 Bytes
10:37:36 : Error: Uploading Option Bytes bank: 0 failed
10:37:38 : Error: Initializing the Option Bytes failed
10:37:38 : Disconnected from device.

Isolating the errors:

Error: Database: There's no active configuration for this device. All the 6 configurations are disabled!
Error: Uploading Option Bytes bank: 0 failed
Error: Initializing the Option Bytes failed

Any ideas on how to solve this?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
15 REPLIES 15
Javier1
Principal
  • which specific STM32G031 is?

Im using stm32g030j6Mx without selecting SW pins and i dont have this issue

  •  Which cubeProgr version are you using?

  • Did you do the STlink configuration Mode raindance?

0693W00000YAFdEQAX.pngCheck all posibilities.

we dont need to firmware by ourselves, lets talk

Hi Javier,

I'm using STM32G031J6M6 & CubeProgrammer v2.11.0.

I've tried right now other modes. Normal is the one of my post, hotplug has the same errors but the current doesn't change, under reset same errors & also current drop to almost 0, finally power down doesn't react at all "No STM32 target found!" at all times.

This is the ST-LINK configuration I've been using until now:

0693W00000YAFl8QAH.png

MM..1
Chief II

Disconect power from your board

connect stlink start in power down mode

click connect

plug power to board

KnarfB
Principal III

> 10:37:35 : Error: Database: There's no active configuration for this device. All the 6 configurations are disabled!

looks like your ST-LINK may need a firmware update?

hth

KnarfB

I updated the ST-LINK but same problem:

14:40:07 : ST-LINK SN  : 55FF6E067871515343241267
  14:40:07 : ST-LINK FW  : V2J39S7
  14:40:07 : Board       : --
  14:40:07 : Voltage     : 2,60V
  14:40:07 : SWD freq    : 4000 KHz
  14:40:07 : Connect mode: Normal
  14:40:07 : Reset mode  : Software reset
  14:40:07 : Device ID   : 0x466
  14:40:07 : Revision ID : Rev 1.1
  14:40:10 : Error: Database: There's no active configuration for this device. All the 6 configurations are disabled!
  14:40:11 : UPLOADING OPTION BYTES DATA ...
  14:40:11 :   Bank          : 0x00
  14:40:11 :   Address       : 0x40022020
  14:40:11 :   Size          : 108 Bytes
  14:40:11 : Error: Uploading Option Bytes bank: 0 failed
  14:40:11 : Error: Initializing the Option Bytes failed
  14:40:11 : Disconnected from device.

Can you please expand on that? If I tri to connect with the board disconnected from power and then I try to "connect" with ST-LINK in power down mode I just get the message "No STM32 target found!"

Your pin list omit GND i hope connected

and read How to unlock STM32G031J6M6 (STM32G0316-DISCO)?

It was connected to GND, but that was actually the problem, that part of the PCB wasn't correctly connected to GND, I moved the cable to another part and it worked. Thanks!

KnarfB
Principal III

on my STM32G0316-DISCO:

15:07:11 : ST-LINK SN  : 0669FF3536324D5043013913
  15:07:11 : ST-LINK FW  : V2J39M27
  15:07:11 : Board       : NUCLEO-G031J6
  15:07:11 : Voltage     : 3.23V
  15:07:11 : SWD freq    : 4000 KHz
  15:07:11 : Connect mode: Normal
  15:07:11 : Reset mode  : Hardware reset
  15:07:11 : Device ID   : 0x466
  15:07:11 : Revision ID : Rev 1.1
  15:07:11 : ST-LINK SN  : 0669FF3536324D5043013913
  15:07:11 : ST-LINK FW  : V2J39M27
  15:07:11 : Board       : NUCLEO-G031J6
  15:07:11 : Voltage     : 3.23V
  15:07:11 : SWD freq    : 4000 KHz
  15:07:11 : Connect mode: Normal
  15:07:11 : Reset mode  : Hardware reset
  15:07:11 : Device ID   : 0x466
  15:07:11 : Revision ID : Rev 1.1
  15:07:11 : Debug in Low Power mode is not supported for this device.
  15:07:11 : UPLOADING OPTION BYTES DATA ...
  15:07:11 :   Bank          : 0x00
  15:07:11 :   Address       : 0x40022020
  15:07:11 :   Size          : 112 Bytes
  15:07:11 : UPLOADING ...
  15:07:11 :   Size          : 1024 Bytes
  15:07:11 :   Address       : 0x8000000
  15:07:11 : Read progress:
  15:07:11 : Data read successfully
  15:07:11 : Time elapsed during the read operation is: 00:00:00.006

have a different firmware version, why?

Device..ID are same, so what *is* the difference?

Different voltages?

Try lowering the SWD Speed significantly.

still: "Error: Database" makes me nervous.

hth

KnarfB