@@ -1839,13 +1839,13 @@ XSPI2 NOR Flash (memory-mapped at 0x70000000):
18391839 0x70020000 Boot partition (1MB, app runs from here via XIP)
18401840 0x70120000 Update partition (1MB, device-relative: 0x00120000)
18411841
1842- AXISRAM — without TrustZone (non-secure alias):
1843- 0x34000000 wolfBoot (loaded to SRAM via SWD or Boot ROM FSBL copy )
1844- 0x34020000 Stack / work area
1842+ AXISRAM2 — without TrustZone (non-secure alias):
1843+ 0x34180400 wolfBoot FSBL (Boot ROM copies from NOR to here )
1844+ 0x341A0400 Stack top (128KB above origin)
18451845
1846- AXISRAM — with TrustZone (TZEN=1, secure alias):
1847- 0x24000000 wolfBoot (secure SRAM — IDAU marks 0x24xxxxxx as secure)
1848- 0x24020000 Stack / work area (secure)
1846+ AXISRAM2 — with TrustZone (TZEN=1, secure alias):
1847+ 0x24180400 wolfBoot FSBL (secure — IDAU marks 0x24xxxxxx as secure)
1848+ 0x241A0400 Stack top (secure)
18491849 0x34000000 Application SRAM (SAU region: non-secure)
18501850```
18511851
@@ -1866,14 +1866,65 @@ make flash
18661866```
18671867
18681868` make flash ` uses OpenOCD with the stmqspi driver to:
1869- 1 . Program the signed application to NOR flash at 0x70020000
1870- 2 . Load wolfBoot to SRAM (0x24000000 for TZEN=1, 0x34000000 otherwise)
1871- 3 . Start wolfBoot, which verifies and boots the application via XIP
1869+ 1 . Generate a Boot ROM FSBL header using ` STM32_SigningTool_CLI ` and program
1870+ ` wolfboot-trusted.bin ` to NOR flash at 0x70000000 (for autonomous boot on reset)
1871+ 2 . Load wolfBoot directly to SRAM for immediate execution
1872+ 3 . Program the signed application to NOR flash at 0x70020000
1873+ 4 . Start wolfBoot, which verifies and boots the application via XIP
1874+
1875+ The Boot ROM copies the FSBL from NOR flash to AXISRAM2 at ` 0x34180400 ` .
1876+ wolfBoot is linked at this address so it runs correctly after both
1877+ OpenOCD-initiated and reset-initiated boots.
18721878
18731879Prerequisites:
1874- - OpenOCD 0.12+ with stm32n6x target support (build from source if needed)
1880+ - OpenOCD 0.12+ with stm32n6x target support (build from
1881+ [ openocd-org/openocd] ( https://github.com/openocd-org/openocd ) if needed)
1882+ - ` STM32_SigningTool_CLI ` (included with STM32CubeIDE) for Boot ROM FSBL header
1883+ generation. The flash script auto-detects the tool location. Without it,
1884+ wolfBoot is loaded to SRAM only (no autonomous boot on reset).
18751885- ST-Link connected to the Nucleo board
18761886- arm-none-eabi toolchain in PATH
1887+ - OTP fuse VDDIO3_HSLV programmed (see [ OTP Configuration] ( #otp-configuration )
1888+ below)
1889+
1890+ ### OTP Configuration (One-Time)
1891+
1892+ The STM32N6 Boot ROM requires OTP fuse configuration to boot from external
1893+ XSPI2 NOR flash. This is a ** one-time permanent** operation.
1894+
1895+ ** OTP Word 124** (BSEC_HW_CONFIG) — set bit 15:
1896+
1897+ | Bit | Name | Value | Description |
1898+ | -----| ------| -------| -------------|
1899+ | 15 | VDDIO3_HSLV | 1 | Enable XSPI2 I/O high-speed low-voltage mode |
1900+
1901+ ** Using STM32CubeProgrammer (GUI):**
1902+
1903+ 1 . Connect to the board via SWD (JP2/BOOT1 in position 2-3 for development mode)
1904+ 2 . Select ** OTP** in the left menu
1905+ 3 . Find word 124 and set value to ` 0x00008000 `
1906+ 4 . Click ** Program**
1907+
1908+ ** Using STM32_Programmer_CLI:**
1909+
1910+ ``` sh
1911+ STM32_Programmer_CLI -c port=SWD ap=1 \
1912+ -el < path> /OTP_FUSES_STM32N6xx.stldr \
1913+ -otp write word=124 value=0x00008000
1914+ ```
1915+
1916+ ### Boot Mode Switches (JP1/JP2)
1917+
1918+ The NUCLEO-N657X0-Q has two boot mode jumpers:
1919+
1920+ | Mode | JP1 (BOOT0) | JP2 (BOOT1) | Description |
1921+ | ------| -------------| -------------| -------------|
1922+ | Development | don't care | 2-3 | Boot ROM waits for debugger (OpenOCD/SWD) |
1923+ | External flash | 1-2 | 1-2 | Boot ROM loads FSBL from XSPI2 NOR flash |
1924+
1925+ For development, use JP2=2-3 to flash via OpenOCD. After flashing, switch
1926+ both JP1 and JP2 to position 1-2 and press reset for autonomous boot from
1927+ NOR flash.
18771928
18781929### Build Options
18791930
0 commit comments