Skip to main content
Associate III
September 1, 2026
Question

Creating Custom External Loader for STM32H573RIVx

  • September 1, 2026
  • 4 replies
  • 75 views

Hello ST Community,

I’m developing a custom external loader for a GD25Q64E flash device and cannot get STM32CubeProgrammer to read/write/erase the external flash. I’ve attached a screenshot of the error reported by the programmer.

What I’ve done

  • Followed the ST tutorial “External QSPI loader how to” External QSPI loader how to - STMicroelectronics.
  • Verified read/write/erase work when exercised from main.c — no errors there.
  • When running the loader, I see a hardfault reported in the CubeProgrammer “HardFault” tab. There is a hardfault at the end of loader_src.c in init(); I’m not sure whether that is expected.
  • Project uses SPI3 with DMA and interrupts to talk to the external flash.
    • I have also tested this with just polling and verified read/writing/erase work when exercised from main.c

Device and external flash info

  • Flash: GD25Q64E
  • SPI instance: SPI3 (Polling)

Questions: 
 

  1. Any troubleshooting tips for getting the custom loader working with STM32CubeProgrammer (and diagnosing the hardfault shown in the programmer)?

 

4 replies

Aziz BRIGUI
ST Technical Moderator
September 8, 2026

Hi ​@A_Bit_More,

Try adding optimize for size in your IDE and let us know if it resolved the issue.

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.
Associate III
September 8, 2026

Where can I find this in the ide?

Aziz BRIGUI
ST Technical Moderator
September 9, 2026

It can be found in “Project properties → C/C++ build → Tool setting → Optimization”

 

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.
Associate III
September 9, 2026

Tried it and sadly it’s still not working.