Skip to main content
Associate
April 27, 2026
Question

STM32H745I-DISCO – External flash erase/init failure with TouchGFX project

  • April 27, 2026
  • 1 reply
  • 50 views

Hi Community,

I am using STM32H745I-DISCO board and generated a TouchGFX project and attempted to flash/debug from CubeIDE. The flashing process fails during the erase stage.

Observed Errors

  • Initially: “Error: failed to erase memory”
  • After enabling external loader (without initialization):
    • Erase still fails
  • After enabling external loader with Initialize = true:
    • “Failed to initialize external memory”
    • “Error in initializing ST-LINK device”
  • In CubeProgrammer:
    • External flash is detected when selecting loader MT25TL01_STM32H745I-DISCO
    • However:
      • Mass erase fails
      • Sector erase also fails
      • Error message:
        • “Sector erase operation has failed… please verify flash protection” 

I am using STM32CubeIDE v1.18.1 and STM32CubeProgrammer: v2.16.x

I have attached screenshots.

Can someone help what could be the issue?

Thanks.

 

1 reply

mƎALLEm
Technical Moderator
April 27, 2026

Hello,


@Tharun123 wrote:
  • In CubeProgrammer:
    • External flash is detected when selecting loader MT25TL01_STM32H745I-DISCO
    • However:
      • Mass erase fails
      • Sector erase also fails
      • Error message:
        • “Sector erase operation has failed… please verify flash protection” 

Based on this statement I have the impression there is a problem with the external memory.

Try to run the QSPI example provided in CubeH7: https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/STM32H745I-DISCO/Examples/QSPI/QSPI_MemoryMappedDual

If it doesn't work there is an issue with the external memory, either the memory is broken or there is something gone wrong on the board/PCB!

"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."