@@ -885,6 +885,7 @@ arm-none-eabi-gdb
885885(gdb) target remote:3333
886886```
887887
888+
888889## STM32H5
889890
890891Like [ STM32L5] ( #stm32l5 ) and [ STM32U5] ( #stm32u5 ) , STM32H5 support is also demonstrated
@@ -902,8 +903,8 @@ For more information, see [/docs/flash-OTP.md](/docs/flash-OTP.md).
902903The implementation shows how to switch from secure application to non-secure application,
903904thanks to the system isolation performed, which splits the internal Flash and internal
904905SRAM memories into two parts:
905- - the first 256KB are used by wolfboot running in secure mode and the secure application
906- - the remaining available space is used for non-secure application and update partition
906+ - the first 384KB are used by wolfboot running in secure mode and the secure application
907+ - the remaining available space (640KB) is used for non-secure application and update partition
907908
908909The example configuration for this scenario is available in [ /config/examples/stm32h5.config] ( /config/examples/stm32h5.config ) .
909910
@@ -913,14 +914,14 @@ The example configuration for this scenario is available in [/config/examples/st
913914
914915` STM32_Programmer_CLI -c port=swd -ob TZEN=0xB4 `
915916
916- - set the option bytes to enable flash secure protection of first 256KB :
917- ` STM32_Programmer_CLI -c port=swd -ob SECWM1_PSTRT=0x0 SECWM1_PEND=0x1F SECWM2_PSTRT=0x1F SECWM2_PEND=0x0 `
917+ - set the option bytes to enable flash secure protection of first 384KB :
918+ ` STM32_Programmer_CLI -c port=swd -ob SECWM1_PSTRT=0x0 SECWM1_PEND=0x2F SECWM2_PEND=0x0 SECWM2_PSTRT=0x2F `
918919
919920- flash the wolfboot image to the secure partition:
920921` STM32_Programmer_CLI -c port=swd -d wolfboot.bin 0x0C000000 `
921922
922923- flash the application image to the non-secure partition:
923- ` STM32_Programmer_CLI -c port=swd -d test-app/image_v1_signed.bin 0x08040000 `
924+ ` STM32_Programmer_CLI -c port=swd -d test-app/image_v1_signed.bin 0x08060000 `
924925
925926For a full list of all the option bytes tested with this configuration, refer to [ STM32-TZ.md] ( /docs/STM32-TZ.md ) .
926927
@@ -946,50 +947,54 @@ For DUALBANK with TrustZone use `stm32h5-tz-dualbank-otp.config`.
946947
947948DUALBANK configuration (Tested on NUCLEO-STM32H563ZI):
948949
950+ ```
949951BANK A: 0x08000000 to 0x080FFFFFF (1MB)
950952BANK B: 0x08100000 to 0x081FFFFFF (1MB)
953+ ```
951954
952955First of all, ensure that the ` SWAP_BANK ` option byte is off when running wolfBoot
953956for the first time:
954-
955- ```
956- STM32_Programmer_CLI -c port=swd -ob SWAP_BANK=0
957- ```
957+ ` STM32_Programmer_CLI -c port=swd -ob SWAP_BANK=0 `
958958
959959It is a good idea to start with an empty flash, by erasing all sectors via:
960+ ` STM32_Programmer_CLI -c port=swd -e 0 255 `
960961
961- ```
962- STM32_Programmer_CLI -c port=swd -e 0 255
963- ```
964962Compile wolfBoot with ` make ` . The file ` factory.bin ` contains both wolfboot and the
965963version 1 of the application, and can be uploaded to the board at the beginning
966964of the first bank using ` STM32_Programmer_CLI ` tool:
967-
968- ```
969- STM32_Programmer_CLI -c port=swd -d factory.bin 0x08000000
970- ```
965+ ` STM32_Programmer_CLI -c port=swd -d factory.bin 0x08000000 `
971966
972967Optionally, you can upload another copy of wolfboot.bin to the beginning of the second bank.
973- Wolfboot should take care of copying itself to the second bank upon first boot if you don't.:
974-
975- ```
976- STM32_Programmer_CLI -c port=swd -d wolfboot.bin 0x08100000
977- ```
968+ Wolfboot should take care of copying itself to the second bank upon first boot if you don't:
969+ ` STM32_Programmer_CLI -c port=swd -d wolfboot.bin 0x08100000 `
978970
979971After uploading the images, reboot your board. The green LED should indicate that v1 of the
980972test application is running.
981973
982974To initiate an update, sign a new version of the app and upload the v3 to the update partition
983975on the second bank:
984976
985- ```
977+ ``` sh
986978tools/keytools/sign --ecc256 test-app/image.bin wolfboot_signing_private_key.der 3
987- STM32_Programmer_CLI -c port=swd -d test-app/image_v3_signed.bin 0x08110000
979+ STM32_Programmer_CLI -c port=swd -d test-app/image_v3_signed.bin 0x08160000
988980```
989981
990982Reboot the board to initiate an update via DUALBANK hw-assisted swap.
991983Any version except the first one will also turn on the orange LED.
992984
985+ ### STM32H5 Debugging
986+
987+ OpenOCD: ` openocd -s /usr/local/share/openocd/scripts -f board/st_nucleo_h5.cfg `
988+
989+ ``` sh
990+ arm-none-eabi-gdb
991+ source .gdbinit
992+ add-symbol-file test-app/image.elf 0x08060000
993+ mon reset init
994+ b main
995+ c
996+ ```
997+
993998
994999## STM32H7
9951000
0 commit comments