Skip to main content
Graduate
October 14, 2025
Question

STM32N6 it's possible to change XSPI2 to XSPI1 for boot using OTP bits ?

  • October 14, 2025
  • 1 reply
  • 234 views

Hello,

I want to change for boot to use XSPI1 interface, but I am not sure about OTP bits, there in description some bits is not very clear, what OTP bits to set to switch if it's possible ?

Additionally if I will use SD card for boot I can set OTP11 value to 0x00000020 (bit5 = 1 = sdcard), write FW to sd and use sd for boot source ?

Thanks.

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    October 15, 2025

    Hello @TheImmortal ;

     

    The OTP configuration depends on the source.

    If a flash boot is selected, the firmware is loaded from an external flash memory. The flash source selection is done through BOOTROM_CONFIG2 - OTP_WORD11[8:5] = boot_source (4 bits). The possible sources are listed below:
    • XSPI serial NOR (in SPI mode, single)
    • XSPI HyperFlash™ (8-bit)
    • e.MMC™ SDMMC1 or e.MMC™ SDMMC2 (up to JEDEC v5.1)
    • SD-Card SDMMC1 (up to SD standard v6.0)

    Fore more information for OTP configuration, I recommend you to look at AN5967 section 10 Boot configuration and at UM3234 Table 22 you can find more details about the boot configuration.

    KDJEM1_0-1760518969464.png

    KDJEM1_1-1760519120882.png

    Does this answer your request?

     

    Thank you.

    Kaouthar

     

    Graduate
    October 15, 2025

    Thanks for reply @KDJEM.1 

    I successfully switched to SDMMC1 and it's working, but questions was more about XSPI1 and XSPI2, if I understand correctly bootloader by default use mux for XSPI2 to port1 and boot is from XSPI2, from documentation it's looks what there is impossible to disable mux and use direct mapping XSPI1 to port1 ? 
    If possible I want to switch because I used almost all GPIOs and searching solutions for more convenient track layout on my PCB.

    ST Employee
    October 15, 2025

    Hello @TheImmortal 

    In Flash Boot (OTP11 flash_boot_source=0) , the BootROM uses always XSPI1 with XSPIM Port2 in SPI legacy mode MOSI/MISO, this is hardcoded. XSPIM-Port2 is the boot peripheral and we recommend to connect external serial flash on it.

    Refer to UM3234 in section 3.4.5 XSPI / XSPIM configuration for serial NOR device. and 3.12.3 Configuration of ports and pads.

    https://www.st.com/resource/en/user_manual/um3234-how-to-proceed-with-boot-rom-on-stm32n6-mcus-stmicroelectronics.pdf

    This is why the XSPIM Port2 Octal I/O port is present on all STM32N6 packages for external flash Boot as the device has no internal flash memory. 

    Then in FSBL, you can configure XSPI1 / XSPI2 / XSPI3 on any XSPIM-P1/ P2.
    You can also refer to AN5050 in section 4 OCTOSPI and XSPI I/O managers.

    https://www.st.com/resource/en/application_note/an5050-getting-started-with-octospi-hexadecaspi-and-xspi-interface-on-stm32-mcus-stmicroelectronics.pdf

    Let me know if it answers to your question.
    Best regards,

    Romain,