Skip to main content
Associate III
September 3, 2025
Solved

Example code for SFIx variant of external loader

  • September 3, 2025
  • 2 replies
  • 946 views

The following repository contains examples for creating 'normal' type of external loaders, i.e., to be used with the "-el" argument of the STM32CubeProgrammer (e.g., with output "STM32CubeProgrammer/bin/ExternalLoader/MX66UW1G45G_STM32H7S78-DK.stldr"):

https://github.com/STMicroelectronics/stm32-external-loader 

Where can the source code examples be found for the 'SFIx' type of external loaders, i.e., to be used with the "-elbl" argument of the STM32CubeProgrammer (e.g., with output "STM32CubeProgrammer/bin/ExternalLoader/MX66UW1G45G_STM32H7S78-DK-SFIx.stldr")?

Best answer by Jocelyn RICARD

Hello @Eliasvan ,

The SFIx version of the loader is based on exactly same structure as normal external loader.

Difference is at initialization level. Only XPI should be setup. You should remove all previous initialization regarding sytem, clocking and HAL, this is supposed to be already done.

Best regards

Jocelyn

 

2 replies

Jocelyn RICARD
Jocelyn RICARDBest answer
ST Employee
September 10, 2025

Hello @Eliasvan ,

The SFIx version of the loader is based on exactly same structure as normal external loader.

Difference is at initialization level. Only XPI should be setup. You should remove all previous initialization regarding sytem, clocking and HAL, this is supposed to be already done.

Best regards

Jocelyn

 

Associate II
August 10, 2026

Hello Jocelyn,

Could you please specify whether the clock configuration performed inside the peripheral initialization functions (for example, in `xspi.c`) should also be removed?

Also, should the I-Cache, D-Cache, and SBS initialization be removed as well?

My understanding is that the DMA and GPIO initialization should remain. In the case of GPIO, STM32CubeIDE's ExtMemLoader-generated code initializes all enabled GPIO pins, not only those related to XSPI, so I assume this initialization should still be kept.

I also noticed that `MX_EXTMEM_MANAGER_Init()` calls `HAL_RCCEx_DisableClockProtection()`. I assume that, in the SFIx case, this call is harmless and can therefore be left as it is. Could you please confirm?

Thank you very much for all the support you have provided on the forums regarding this topic. Your explanations have been extremely helpful and have been fundamental for me.

Best regards,