Skip to main content
NAmam.2
Associate III
October 14, 2026
Solved

XIP (Execute-In-Place) from external QSPI flash on the STM32U5G9

Hello,

I am working on a requirement involving XIP (Execute-In-Place) from external QSPI flash on the STM32U5G9 and am encountering an issue executing the application from external flash.

I have developed a working external flash loader for my QSPI memory and successfully programmed a simple GPIO toggle application into external flash.

In the bootloader, I initialize the QSPI interface, configure the flash in memory-mapped mode, and then jump to the application located at 0xA0000000.

Using the debugger, I can confirm that execution reaches the application's Reset_Handler at 0xA00002B4. However, when executing the very first assembly instruction, the processor enters HardFault_Handler at 0xA0000458.

The fault status registers indicate:

  • CFSR = 0x00000001 (Instruction Access Violation)

  • HFSR = 0x40000000 (Forced HardFault)

  • MPU is disabled

  • VTOR = 0xA0000000

I have also verified that the application vector table contains valid stack-pointer and reset-handler addresses, and that the external flash contents can be read correctly through the debugger.

I am unable to determine why XIP execution is failing despite the QSPI memory-mapped interface appearing to work correctly.

Has anyone encountered a similar issue or have any suggestions on what I should check?

I would be happy to share my bootloader and application code for further review if needed.

Thank you in advance for your help.
Naga.

Pavel A.
Pavel A.Best answer
October 14, 2026

Why MPU is disabled? is this deliberate?  The address 0xA0000000 by default is non-executable, you need to define the code area in the MPU.

 

2 replies

Pavel A.
Pavel A.Best answer
October 14, 2026

Why MPU is disabled? is this deliberate?  The address 0xA0000000 by default is non-executable, you need to define the code area in the MPU.

 

NAmam.2
NAmam.2Author
Associate III
October 15, 2026

Hi Pavel,

That helped, Thank you for the response.

Regards,

Naga.