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