Skip to main content
Visitor II
July 15, 2026
Question

STM32H533 Flash Programming Failure with ST-LINK V3SET – Request for Investigation

  • July 15, 2026
  • 1 reply
  • 27 views

Dear Team,

I am facing an issue while programming an STM32H533 device using the ST-LINK V3SET. I have observed different behavior depending on the compiler optimization level and programming interface. The details are provided below.

Case 1 – Flash Programming Failure

Please find the debug log below:

-------------------------------------------------------------------
STM32CubeProgrammer v2.20.0
-------------------------------------------------------------------

Log output file: C:\Users\29397\AppData\Local\Temp\STM32CubeProgrammer_a36804.log

ST-LINK SN : 0042001A3234510537333934
ST-LINK FW : V3J17M11B6S1
Board : STLINK-V3SET
Voltage : 0.00V
SWD freq : 8000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x478
Revision ID : --
Device name : STM32H533/523
Flash size : 512 KBytes
Device type : MCU
Device CPU : Cortex-M33
BL Version : 0xE2
SFSP Version: v1.2.0
Debug in Low Power mode enabled

Opening and parsing file: ST-LINK_GDB_server_a36804.srec

Memory Programming ...

File : ST-LINK_GDB_server_a36804.srec
Size : 300.51 KB
Address : 0x08000000

Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 37]

Download in Progress:
Error: failed to download Sector[0]
Error: failed to download the File


Shutting down...
Exit.

Case 2 – Flash Programming Successful

When the project is built with the compiler optimization level set to -Os, the programming completes successfully.

Relevant programming log:

Device name : STM32H533/523
Flash size : 512 KBytes
Device type : MCU
Device CPU : Cortex-M33
BL Version : 0xE2
SFSP Version: v1.2.0
Debug in Low Power mode enabled

Opening and parsing file: ST-LINK_GDB_server_a03496.srec

Memory Programming ...

File : ST-LINK_GDB_server_a03496.srec
Size : 175.14 KB
Address : 0x08000000

Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 21]

Download in Progress:
File download complete

Time elapsed during download operation: 00:00:00.847

Observations

  • In Case 1, the generated image size is approximately 300.51 KB, and the programmer attempts to erase flash sectors [0–37], after which programming fails with the error "failed to download Sector[0]".
  • In Case 2, enabling -Os optimization reduces the image size to 175.14 KB, resulting in flash erase sectors [0–21], and programming completes successfully.
  • An additional observation is that the same binary from Case 1 can be programmed successfully when using the USB-C interface, whereas programming fails only when using the ST-LINK V3SET.

Request

Could you please help us understand the following?

  1. Why is the ST-LINK V3SET unable to program the image in Case 1, while the same image can be programmed successfully using the USB-C interface?
  2. Is there any known limitation or configuration related to ST-LINK V3SET, STM32H533, or STM32CubeProgrammer that could explain this behavior?
  3. Are there any recommended debugger, flash programming, or memory configuration settings that should be verified or modified to resolve this issue?

Your guidance on identifying the root cause and resolving this programming issue would be greatly appreciated.

Kind Regards,

Bhavesh Raju

1 reply

Aziz BRIGUI
ST Technical Moderator
July 23, 2026

Hi ​@Bhavesh Raju,

Could you provide your option bytes setting as well as the full part number of the device you’re using ?

An easy option bytes dump can be done with: >STM32_Programmer_CLI -c port=SWD -ob displ

Aziz

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.