@@ -175,10 +175,10 @@ The example configuration for this scenario is available in [/config/examples/st
175175-  User Option Bytes requirement (with STM32CubeProgrammer tool - see below for instructions)
176176
177177``` 
178- TZEN = 1                             System with TrustZone-M enabled 
179- DBANK = 1                            Dual bank mode 
180- SECWM1_PSTRT =0x0  SECWM1_PEND =0x7F  All 128 pages of internal Flash Bank1 set as secure
181- SECWM2_PSTRT =0x1  SECWM2_PEND =0x0   No page of internal Flash Bank2 set as secure, hence Bank2 non-secure
178+ TZEN = 1                          System with TrustZone-M enabled 
179+ DBANK = 1                         Dual bank mode 
180+ SECWM1_STRT =0x0  SECWM1_END =0x7F  All 128 pages of internal Flash Bank1 set as secure
181+ SECWM2_STRT =0x1  SECWM2_END =0x0   No page of internal Flash Bank2 set as secure, hence Bank2 non-secure
182182``` 
183183
184184-  NOTE: STM32CubeProgrammer V2.3.0 is required  (v2.4.0 has a known bug for STM32L5)
@@ -189,7 +189,7 @@ SECWM2_PSTRT=0x1  SECWM2_PEND=0x0   No page of internal Flash Bank2 set as secur
1891892 .  ` make ` 
1901903 .  Prepare board with option bytes configuration reported above
191191    -  ` STM32_Programmer_CLI -c port=swd mode=hotplug -ob TZEN=1 DBANK=1 ` 
192-     -  ` STM32_Programmer_CLI -c port=swd mode=hotplug -ob SECWM1_PSTRT =0x0 SECWM1_PEND =0x7F SECWM2_PSTRT =0x1 SECWM2_PEND =0x0 ` 
192+     -  ` STM32_Programmer_CLI -c port=swd mode=hotplug -ob SECWM1_STRT =0x0 SECWM1_END =0x7F SECWM2_STRT =0x1 SECWM2_END =0x0 ` 
1931934 .  flash wolfBoot.bin to 0x0c00 0000
194194    -  ` STM32_Programmer_CLI -c port=swd -d ./wolfboot.bin 0x0C000000 ` 
1951955 .  flash .\test-app\image_v1_signed.bin to 0x0804 0000
@@ -316,10 +316,10 @@ SRAM memories into two parts:
316316-  User Option Bytes requirement (with STM32CubeProgrammer tool - see below for instructions)
317317
318318``` 
319- TZEN = 1                             System with TrustZone-M enabled 
320- DBANK = 1                            Dual bank mode 
321- SECWM1_PSTRT =0x0  SECWM1_PEND =0x7F  All 128 pages of internal Flash Bank1 set as secure
322- SECWM2_PSTRT =0x1  SECWM2_PEND =0x0   No page of internal Flash Bank2 set as secure, hence Bank2 non-secure
319+ TZEN = 1                          System with TrustZone-M enabled 
320+ DBANK = 1                         Dual bank mode 
321+ SECWM1_STRT =0x0  SECWM1_END =0x7F  All 128 pages of internal Flash Bank1 set as secure
322+ SECWM2_STRT =0x1  SECWM2_END =0x0   No page of internal Flash Bank2 set as secure, hence Bank2 non-secure
323323``` 
324324
325325-  NOTE: STM32CubeProgrammer V2.8.0 or newer is required
@@ -330,7 +330,7 @@ SECWM2_PSTRT=0x1  SECWM2_PEND=0x0   No page of internal Flash Bank2 set as secur
3303302 .  ` make TZEN=1 ` 
3313313 .  Prepare board with option bytes configuration reported above
332332    -  ` STM32_Programmer_CLI -c port=swd mode=hotplug -ob TZEN=1 DBANK=1 ` 
333-     -  ` STM32_Programmer_CLI -c port=swd mode=hotplug -ob SECWM1_PSTRT =0x0 SECWM1_PEND =0x7F SECWM2_PSTRT =0x1 SECWM2_PEND =0x0 ` 
333+     -  ` STM32_Programmer_CLI -c port=swd mode=hotplug -ob SECWM1_STRT =0x0 SECWM1_END =0x7F SECWM2_STRT =0x1 SECWM2_END =0x0 ` 
3343344 .  flash wolfBoot.bin to 0x0c000000
335335    -  ` STM32_Programmer_CLI -c port=swd -d ./wolfboot.bin 0x0C000000 ` 
3363365 .  flash .\test-app\image_v1_signed.bin to 0x08010000
@@ -915,7 +915,7 @@ The example configuration for this scenario is available in [/config/examples/st
915915` STM32_Programmer_CLI -c port=swd -ob TZEN=0xB4 ` 
916916
917917-  set the option bytes to enable flash secure protection of first 384KB and remainder as non-secure:
918- ` STM32_Programmer_CLI -c port=swd -ob SECWM1_PSTRT =0x0 SECWM1_PEND =0x2F SECWM2_PSTRT=0x2F SECWM2_PEND=0x0  ` 
918+ ` STM32_Programmer_CLI -c port=swd -ob SECWM1_STRT =0x0 SECWM1_END =0x2F SECWM2_STRT=0x0 SECWM2_END=0x7F  ` 
919919
920920-  flash the wolfboot image to the secure partition:
921921` STM32_Programmer_CLI -c port=swd -d wolfboot.bin 0x0C000000 ` 
@@ -925,6 +925,19 @@ The example configuration for this scenario is available in [/config/examples/st
925925
926926For a full list of all the option bytes tested with this configuration, refer to [ STM32-TZ.md] ( /docs/STM32-TZ.md ) .
927927
928+ You can use the "update" command and XMODEM to send a newly signed update (see docs/flash-OTP.md) or use the steps below using the STM32_Programmer:
929+ 
930+ ``` sh 
931+ IMAGE_HEADER_SIZE=1024 tools/keytools/sign --ecc256 test-app/image.bin wolfboot_signing_private_key.der 2
932+ echo  -n " pBOOT"   >  trigger_magic.bin
933+ ./tools/bin-assemble/bin-assemble \
934+   update.bin \
935+     0x0     test-app/image_v2_signed.bin \
936+     0x9FFFB trigger_magic.bin
937+ STM32_Programmer_CLI -c port=swd -d update.bin 0x0C100000
938+ ``` 
939+ 
940+ 
928941### Scenario 2: TrustZone Enabled, wolfCrypt as secure engine for NS applications  
929942
930943This is similar to Scenario 1, but also includes wolfCrypt in secure mode, and
@@ -975,7 +988,7 @@ To initiate an update, sign a new version of the app and upload the v3 to the up
975988on the second bank:
976989
977990``` sh 
978- tools/keytools/sign --ecc256 test-app/image.bin wolfboot_signing_private_key.der 3
991+ IMAGE_HEADER_SIZE=1024  tools/keytools/sign --ecc256 test-app/image.bin wolfboot_signing_private_key.der 3
979992STM32_Programmer_CLI -c port=swd -d test-app/image_v3_signed.bin 0x08160000
980993``` 
981994
0 commit comments