2025-10-14 1:51 AM
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.
2025-10-15 2:19 AM
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.
Does this answer your request?
Thank you.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-10-15 5:07 AM
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.
2025-10-15 11:29 AM - edited 2025-10-15 11:39 AM
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.
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.
Let me know if it answers to your question.
Best regards,
Romain,
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.