Skip to main content
Associate
Oct 27, 2026 9:35 AM UTC
Question

OTA Firmware Update on STM32H7S78-DK: NeededDesign Pattern / Examples for Updating External NOR Flash a

Hello ST Community & ST Engineers,      

     I am building a field Over-The-Air (OTA) firmware update system on the STM32H7S78-DK discovery board. The system uses an ESP32 connected over high-speed UART to transfer the updated firmware binary (2.4MB containing the application and TouchGFX GUI assets). 

Because the STM32H7S7 is a BootFlash MCU with only 64 KB internal flash and executes the application from the external 128 MB Octo-SPI NOR Flash there is no direct out-of-the-box dual-bank OTA example in the STM32Cube_FW_H7S7 package for this board.
 

  1. Background Streaming while TouchGFX is Active: The running application Appli receives 1024-byte chunks from the ESP32 over UART and stages the full 2.4 MB binary directly into external Hexa-SPI PSRAM at (on XSPI1).
    Note : Since the binary file i use is only 2.4MB is use PSRAM to store it but actually i wanted to do in NOR flash since the excepted binary is around 40-50MB(so PSRAM can’t be used in final application binary file).

  2. Safety Interlock & Warm Reset: Once 100% of the binary is staged, the user clicks "Install & Reboot" in TouchGFX. 

  3. Flashing from Bootloader : The MCU reboots into internal flash. Before launching the app via Boot_Application(), the bootloader checks PSRAM. If the flag is set, it erases the active application sectors in external NOR Flash , copies the staged image from PSRAM  into NOR Flash, clears the flag.

Problem i’m facing 

  • STM32CubeProgrammer successfully downloads and verifies the  customboot.elf at internal flash 

  • The instant the core starts running, the board disconnects from ST-LINK:

  • The LCD stays black, and STM32CubeProgrammer cannot reconnect in Normal mode. Can able to connect in Under reset mode

  • Conversely, if we flash an unmodified TouchGFX Designer demo, the board boots and runs normally.

    Note : I also tried the Boot.elf which is not modified, flashing through STM32CubeProgrammer causes me same problem as customboot.elf  

My Questions 

  • Does ST provide an official application note, GitHub reference, or recommended design pattern for OTA updates on the STM32H7S/H7R series?

    • Standard AN3155 / dual-bank internal flash examples do not apply to BootFlash MCUs where the application lives in external XSPI NOR flash. What is ST's recommended architecture for updating the external XSPI NOR Flash image?

  • MPU & HardFault Lockup in Boot :

    • Why does accessing or attempting to read external memory before Boot_Application(), cause a severe bus fault that terminates the SWD connection (Error: Unable to get core ID)?

    • why even flashing unchanged / defualt boot.elf is causing the same problem . i don’t know what the real problem is.

       

       

  • Flashing Procedure with STM32CubeProgrammer:

    • When programming Boot vs Appli , should the external loader to  be unchecked when programming Boot to prevent loader conflict on reset?. Cause I unchecked it. 

Any guidance, code snippet, or architectural advice for safely copying staged firmware into external NOR Flash during boot would be greatly appreciated.

Thank you!
 

7 replies

ST Technical Moderator
Oct 27, 2026 2:20 PM UTC

Hello ​@Yuvaraj0612 

Please refer to the application note AN6228.

How to implement XSPI read-while-write feature on STM32 MCUs - Application note

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om
Associate
Oct 28, 2026 8:07 AM UTC

Hi ​@Saket_Om 
   Thank you for pointing me to Application Note AN6228 ("How to implement XSPI read-while-write feature on STM32 MCUs") and the XSPI_NOR_ReadWhileWrite_DTR example.I thoroughly reviewed AN6228 and examined the reference project. While the XSPIM multiplexing and Macronix multi-bank RWW architecture. But it appears incompatible with an active TouchGFX GUI application on the STM32H7S78-DK due to physical hardware resource allocation due to the usage of both XSPI via the XSPI I/O manager (XSPI2 → for Bank0 and XSPI1 → Bank1) where i need PSRAM  for my GUI function which is physically mapped to port1 of XSPI. Do i really need to built a custom board for ota with gui compatibility or is there any other options for me available.

juliawhites
Visitor II
Oct 28, 2026 8:49 AM UTC

I’d first isolate the boot issue before implementing the OTA copy process. Since even the unmodified Boot.elf causes the same behavior, check the boot configuration, XSPI initialization, and memory mapping rather than assuming the PSRAM access is the root cause. Have you verified the boot address and external loader configuration against the original TouchGFX demo?

Associate
Oct 28, 2026 11:35 AM UTC

Hi @juliawhites,

Thank you for pointing that out—I should clarify what I meant by "unmodified Boot.elf."

What I meant by "unmodified" is that the Boot.elf was generated by STM32CubeMX directly from the copied .ioc file of the working TouchGFX demo project, without adding any custom user code.

Regarding your checks:

  1. External Loader: Yes, the external loader (MX66UW1G45G_STM32H7S78) is unchecked / disabled in STM32CubeProgrammer when flashing Boot.elf. into internal flash (0x08000000).

  2. Boot Address : The boot address is set to 0x08000000 (BOOT_ADD0), and hardware switch SW1 is at 0 .

  3. Behavior Difference: When flashing the original pre-compiled Boot.elf provided directly with the TouchGFX board package, the board boots normally, initializes both memories, and runs the UI cleanly. However, rebuilding the new project generated from the copied .ioc in STM32CubeIDE leads to the core lockup and ST-LINK disconnection (Error: Unable to get core ID) which pointed to differences introduced during CubeMX code generation (memory parameters, timing, or optimization level).

Regarding AN6228: Because AN6228 requires multiplexing both XSPI1 and XSP2  to Port 2 (NOR Flash) for Read-While-Write, it leaves no controller available to drive Port 1 (where the PSRAM framebuffers reside). For a TouchGFX application we need both external memories PSRAM and NOR  . 

 

Associate
Oct 29, 2026 7:40 AM UTC

Hi ST Community,

On the STM32H7S78-DK, default routing maps:

  • XSPI1 →  Port 1: 32 MB PSRAM (TouchGFX framebuffers)

  • XSPI2 → Port 2: 128 MB Octal NOR Flash (XIP application execution)

My Application has to be featured with  HMI UI with resolution of 860x480 pixels 24 bits RGB and field OTA upgrade 

so my questions are as follows :

  1. Can XSPIM and XSPI1 be dynamically reconfigured at runtime to map both XSPI to Port 2 (NOR Flash) for an RWW write session, and then switched back to Port 1 (PSRAM) once finished?

  2. Can this switch be performed while code executes from NOR Flash via XSPI2, or must all re-initialization and XSPIM register updates run strictly from internal SRAM (.RamFunc)?

  3. Does dynamically changing the XSPIM multiplexer generate any clock or chip-select glitches on Port 2 that could corrupt active XSPI2 instruction fetches?

Thanks!

juliawhites
Visitor II
Oct 29, 2026 8:07 AM UTC

Since even the unmodified Boot.elf causes the same issue, I'd first investigate the boot configuration and startup sequence before focusing on OTA logic. Check the XSPI initialization, boot address, and debugger connection settings. Have you tried debugging the bootloader step by step to identify exactly where the core loses connection?

Associate
Nov 3, 2026 7:00 PM UTC

 Hi @juliawhites,

    Thanks for following up ,sorry for my delayed response, i checked the xspi initialization on both the projects( touchgfx generator project and  cube mx generator project ) they are same. Boot address (0x08000000) and debugger mode is also same “Connect Under Reset”  and i also copied the linkerscript file “stm32h7s7xx_flash.ld” from the touchgfx generator project and pasted in “Example_05_Boot” . when i press suspend button while debugging the “Example_05_Boot” project . the debugger is disconnected automatically when i press suspend button.