@@ -1685,6 +1685,82 @@ arm-none-eabi-gdb
16851685```
16861686
16871687
1688+ ## STM32U3
1689+
1690+ The STM32U3 family (for example the STM32U385RG on NUCLEO-U385RG-Q) is a
1691+ Cortex-M33 part **without TrustZone**, so the port is single-image only
1692+ (no `-tz` or `-ns` variants). 1 MB internal flash, 256 KB SRAM, 8 KB
1693+ pages, 128-bit (quad-word) flash write quantum.
1694+
1695+ ### Flash layout (stm32u3.config)
1696+
1697+ Dual-bank flash (2 x 512 KB, 4 KB pages). Bank 1 holds wolfBoot + BOOT,
1698+ bank 2 holds UPDATE + SWAP:
1699+
1700+ ```
1701+ Bank 1:
1702+ 0x08000000 - 0x0800FFFF wolfBoot bootloader (64 KB)
1703+ 0x08010000 - 0x0807FFFF BOOT partition (0x70000, 448 KB)
1704+ Bank 2:
1705+ 0x08080000 - 0x080EFFFF UPDATE partition (0x70000, 448 KB)
1706+ 0x080F0000 - 0x080F0FFF SWAP sector (4 KB)
1707+ ```
1708+
1709+ ### Clock and UART
1710+
1711+ UART is always available in the test-app and enabled in wolfBoot via
1712+ `DEBUG_UART=1` (on by default in the example config). USART1 on PA9
1713+ (TX) / PA10 (RX), AF7, 115200 8N1 — the ST-LINK VCP on NUCLEO-U385RG-Q.
1714+
1715+ ### Building
1716+
1717+ ```sh
1718+ cp config/examples/stm32u3.config .config
1719+ make clean
1720+ make
1721+ ```
1722+
1723+ `DEBUG_UART=1` is enabled by default. To also run the flash self-test:
1724+
1725+ ```sh
1726+ make TEST_FLASH=1
1727+ ```
1728+
1729+ ### Flashing
1730+
1731+ Use `STM32_Programmer_CLI` (from STM32CubeIDE or STM32CubeProgrammer).
1732+ `st-flash` does not yet support chipid 0x454.
1733+
1734+ ```sh
1735+ STM32_Programmer_CLI -c port=SWD reset=HWrst -e all \
1736+ -d factory.bin 0x08000000 -v -rst
1737+ ```
1738+
1739+ The test app blinks LD2 (PA5): slow on v1, fast on v2 (post-update).
1740+
1741+ ### Testing an Update
1742+
1743+ Sign the test application as version 2 and write the update trigger
1744+ magic (`pBOOT`) at the tail of the partition:
1745+
1746+ ```sh
1747+ tools/keytools/sign --ecc384 --sha384 test-app/image.bin \
1748+ wolfboot_signing_private_key.der 2
1749+ echo -n "pBOOT" > trigger_magic.bin
1750+ ./tools/bin-assemble/bin-assemble \
1751+ update.bin \
1752+ 0x0 test-app/image_v2_signed.bin \
1753+ 0x6FFFB trigger_magic.bin
1754+ STM32_Programmer_CLI -c port=SWD reset=HWrst \
1755+ -d update.bin 0x08080000 -v -rst
1756+ ```
1757+
1758+ Reset the board — wolfBoot verifies v2, swaps partitions, and jumps to
1759+ the new image. LD2 transitions from the slow (v1) blink to the fast
1760+ (v2) blink; with `DEBUG_UART=1` the UART log shows the v1 → v2
1761+ transition.
1762+
1763+
16881764## STM32H5
16891765
16901766Like [STM32L5](#stm32l5) and [STM32U5](#stm32u5), STM32H5 support is also demonstrated
0 commit comments