cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G473RC - Error in Launch Sequence - when Flash File > 128kB

CBerg
Senior II

I guess I have found a Bug in the G473RC debug launch script:

I have a STM32G473RC MCU with 128k RAM and 256k Flash.

memory.png

As long as the Flash File stays below the size of 128k all works fine. I can develop, test and debug with CubeIDE. As soon as the flash file becomes larger than 128k, I can no longer debug the Software, because the Launch of the debugger exits with an error message:

error dialogerror dialog

The complete output in the console is:

STMicroelectronics ST-LINK GDB server. Version 7.4.0
Copyright (c) 2023, 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.14.0
-------------------------------------------------------------------

Log output file: C:\Users\CBerg\AppData\Local\Temp\STM32CubeProgrammer_a09660.log
ST-LINK SN : 48FF6D064884534942320687
ST-LINK FW : V2J42S7
Board : --
Voltage : 3.30V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x469
Revision ID : Rev X
Device name : STM32G47x/G48x
Flash size : 256 KBytes
Device type : MCU
Device CPU : Cortex-M4
BL Version : 0xD5
Debug in Low Power mode enabled

Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a09660.srec
File : ST-LINK_GDB_server_a09660.srec
Size : 128.99 KB
Address : 0x08000000

Erasing memory corresponding to segment 0:
Error: Operation exceeds memory limits

Error: failed to erase memory
Encountered Error when opening C:\ST\STM32CubeIDE_1.13.2\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.1.0.202305091550\tools\bin\STM32_Programmer_CLI.exe
Error in STM32CubeProgrammer

Shutting down...
Exit.

 

I have checked the MCU on the PCB: it IS a G473RC. I have checked the connection with Cube Programmer, it says the device has 256k Flash. The Linker Script is correct (128k RAM, 256k Flash) - it is orignal as CubeMX created it, i did not change it. The MCU in the CubeIDE Project is G473RC. The Project compiles without errors and warnings. So far all seems to be correct, which brings me to the asumption, that there might be a bug in the startup script.

How can I solve this? This is URGENT because this prevents me effectively from developing this project. Can I hack the startup scripts or something? Where can I find these? Thanks a lot!

What leads me to the conclusion, that this might be a bug in the IDE / the drivers / the setup script is, that when the size of the flash file is below 128k, the console output is:

Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 63]
Download in Progress:

As i have some experience with Flash memory, i asume there could be some wrong entries about the sector or cluster size. Where can I find those information, so i can hack them in order to get it running again? Thank you!

10 REPLIES 10