cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G031 programming with ST-Link and CubeIDE failed

Samweis
Associate

Hello,

i am trying to program a STM32G031. unfortunately it does not work with cubeIDE i want to use for. please see the following message from the console:

STMicroelectronics ST-LINK GDB server. Version 7.0.0
Copyright (c) 2022, STMicroelectronics. All rights reserved.
 
Starting server with the following options:
        Persistent Mode            : Disabled
        Logging Level              : 1
        Listen Port Number         : 61234
        Status Refresh Delay       : 15s
        Verbose Mode               : Disabled
        SWD Debug                  : Enabled
        InitWhile                  : Enabled
 
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.11.0-RC1                  
      -------------------------------------------------------------------
 
 
 
Log output file:   C:\Users\PETE\AppData\Local\Temp\STM32CubeProgrammer_a07592.log
ST-LINK SN  : 55FF6D067880565348432067
ST-LINK FW  : V2J40S7
Board       : --
Voltage     : 3.21V
SWD freq    : 4000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x466
Revision ID : Rev 1.1
Error: Database: There's no active configuration for this device. All the 6 configurations are disabled!
Error: Database: There's no active configuration for this device. All the 6 configurations are disabled!
Device name : STM32G03x/STM32G04x
Flash size  : 63 KBytes (default)
Device type : MCU
Device CPU  : Cortex-M0+
BL Version  : --
 
 
 
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a07592.srec
  File          : ST-LINK_GDB_server_a07592.srec
  Size          : 11.37 KB 
  Address       : 0x08000000 
 
 
Erasing memory corresponding to segment 0:
Erasing external memory sectors [0 5]
File segment @0x08000000 is not 255-bytes aligned. It will be aligned to @0x07FFFFF8
Download in Progress:
 
 
Error: failed to download Segment[0]
Error: failed to download the File
Shutting down...
Exit.

With the Keil software the programming works with the same ST-Link V2 but without further problems. So the problem is a incorrect setting in the debug configurations?

2 REPLIES 2
mattias norlander
ST Employee

Hi @Samweis​,

Did you solve this?

Looks like a CubeProgrammer issue.

  • Knowing if you have the same issue when connecting in stand-alone mode using only CubeProgrammer would help us to narrow the issue down.
  • Also please specify which stand-alone version of CubeProgrammer that you have used.
  • You can use the bundled CubeProg CLI tool inside the IDE package, for the test. It is the best way to narrow down this issue... Look here: C:\ST\STM32CubeIDE_1.11.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.0.500.202209151145\tools\bin

I'm getting the same error. It was happening with STM32CubeProgrammer v2.13 both standalone and in the IDE, so I downgraded to v2.10. Now standalone works fine but IDE still gives the same error, even in v2.10, which I find a little stange.

Something I noticed is that the standalone programmer writes to 0x08000000 while the IDE one aligns it to 0x07FFFFF8 for some reason. Do you think that could be the issue?