2026-02-01 2:45 AM
Hello everyone,
I’m working with the STM32U5G9J-DK2 and trying to implement a Bootloader + XIP (Execute-In-Place) application architecture using the external flash.
Target setup:
A minimal bootloader running from internal flash
The main application linked to and executing from external flash (memory-mapped at 0x90000000)
The main motivation is to free internal flash and validate this approach for a future MCU with very limited internal flash.
Proper CubeMX / .ioc configuration for the bootloader
Which peripherals must be enabled (RCC, PWR, ICACHE, OSPI, etc.)
Which peripherals should not be enabled to avoid conflicts with the XIP app
Any STM32U5-specific gotchas when initializing OSPI for XIP
Proper configuration of the application project
Recommended changes to the application .ioc
What initialization should be removed from the app (HAL_Init, clock, OSPI, FLASH, etc.)
Reference samples
STM32Cube examples that demonstrate a full bootloader + XIP app flow on STM32U5
Any internal / unofficial sample projects that ST recommends adapting
I’m mainly looking for end-to-end guidance on how ST recommends structuring and configuring both the bootloader and the application for this use case.
Any pointers, samples, or best-practice recommendations would be greatly appreciated.
Thanks in advance,
AJ