Bluepill: ST LINK connects but flashes temporary .srec file instead of project .elf
I’m facing an issue while debugging my STM32F103C8T6 (Bluepill) board using ST-LINK V2 and STM32CubeIDE. The connection and flashing both seem successful, but the program doesn’t actually start running on the board.
When I check the console log, I noticed that STM32CubeIDE isn’t flashing my project’s .elf file it’s flashing a temporary .srec file created by the GDB server instead.
I have checked the run and debug configuration and verified. path is pointing to the correct location where .elf file is created.
Here’s the relevant log output:
STMicroelectronics ST-LINK GDB server. Version 7.11.0
Copyright (c) 2025, 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.20.0
-------------------------------------------------------------------
Log output file: C:\Users\safan\AppData\Local\Temp\STM32CubeProgrammer_a38588.log
ST-LINK SN : B55B5A1A0000000082E4F501
ST-LINK FW : V2J46S7
Board : --
Voltage : 3.22V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x412
Revision ID : Rev A
Device name : STM32F101/F102/F103 Low-density
Flash size : 32 KBytes
Device type : MCU
Device CPU : Cortex-M3
BL Version : --
Opening and parsing file: ST-LINK_GDB_server_a38588.srec
Memory Programming ...
File : ST-LINK_GDB_server_a38588.srec
Size : 4.52 KB
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 4]
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:00.402
Verifying...
Time elapsed during verifying operation: 00:00:00.029
Download verified successfully
