@@ -44,9 +44,10 @@ Flash Allocation:
44440xffc10000: Primary partition (Header)
45450xffc10100: Primary partition (Application image) /* When it uses IMAGE_HEADER_SIZE 256, e.g. ED25519, EC256, EC384 or EC512 */
46460xffc10200: Primary partition (Application image) /* When it uses IMAGE_HEADER_SIZE 512, e.g. RSA2048, RSA3072 */
47- 0xffdf0000: Update partition (Header)
48- 0xffdf0100: Update partition (Application image)
49- 0xfffd0000: Swap sector
47+ 0xffdf8000: Update partition (Header)
48+ 0xffdf8100: Update partition (Application image) /* When it uses IMAGE_HEADER_SIZE 256, e.g. ED25519, EC256, EC384 or EC512 */
49+ 0xffdf8200: Update partition (Application image) /* When it uses IMAGE_HEADER_SIZE 512, e.g. RSA2048, RSA3072 */
50+ 0xfffe0000: Swap sector
5051
5152```
5253
@@ -75,13 +76,13 @@ $ export PATH:$PATH:<wolfBoot>/tools/keytools
7576$ keygen --ecc256 -g ./pri-ecc256.der
7677```
7778
78- This generates a pair of private and public keys with -g option. The private key is stored
79- in the specified file. The public key is stored in a key store as a C source code
79+ This generates a pair of private and public keys with -g option. The private key is stored
80+ in the specified file. The public key is stored in a key store as a C source code
8081in "src/keystore.c" soo that it can be compiled and linked with wolfBoot.
8182If you have an existing key pair, you can use -i option to import the pablic
8283key to the store.
8384
84- You can specify various signature algorithms such as
85+ You can specify various signature algorithms such as
8586
8687```
8788--ed25519 --ed448 --ecc256 --ecc384 --ecc521 --rsa2048 --rsa3072
@@ -140,7 +141,7 @@ Pre-Include
140141Code Origin and entry point (PResetPRG) is "0xffc10200" (See Section Viewer of Linker Section).
141142```
142143
143- app_RenesasRx01.x in ELF is generated under HardwareDebug. You can derive bair binary file
144+ app_RenesasRx01.x in ELF is generated under HardwareDebug. You can derive bair binary file
144145(app_RenesasRx01.bin) by rx-elf-objcopy.exe command as follows. -R are for eliminate unnecessary
145146secrions.
146147
@@ -189,7 +190,7 @@ $ rx-elf-objcopy.exe -I binary -O srec --change-addresses=0xffc10000 app_Renesas
189190Now, you can download and start wolfBoot program by e2Studio debugger.
190191After starting the program, you can see the partition information as follows.
191192If the boot program succeeds integrity and authenticity check, it initiate the
192- application V1.
193+ application V1.
193194
194195
195196```
@@ -201,73 +202,84 @@ application V1.
201202=== Boot Partition[ffc10000] ===
202203Magic: WOLF
203204Version: 01
204- Status: ff
205- Tail Mgc: ????
205+ Status: ff (New)
206+ Tail Mgc: ����
206207
207- === Update Partition[ffdf0000 ] ===
208- Magic: WOLF
209- Version: 02
210- Status: ff
211- Tail Mgc: ????
208+ === Update Partition[ffdf8000 ] ===
209+ Magic: ����
210+ Version: 00
211+ Status: ff (New)
212+ Tail Mgc: ����
212213
213214Current Firmware Version: 1
214215Hit any key to call wolfBoot_success the firmware.
215216```
216217
217218After hitting any key, the application calls wolfBoot_success() to set boot partition
218- state and wait for any key again.
219-
220- If you re-start the boot program at this moment,
221- after checking the integrity and authenticity, it jumps to the application.
222- You can see the state is Success("00").
219+ state and wait for any key again.
223220
224221```
225222=== Boot Partition[ffc10000] ===
226223Magic: WOLF
227224Version: 01
228- Status: 00
225+ Status: 00 (Success)
229226Tail Mgc: BOOT
230227
231- === Update Partition[ffdf0000 ] ===
232- Magic: WOLF
233- Version: 02
234- Status: ff
235- Tail Mgc: ????
228+ === Update Partition[ffdf8000 ] ===
229+ Magic: ����
230+ Version: 00
231+ Status: 00 (Success)
232+ Tail Mgc: BOOT
236233
237- Hit any key to update the firmware.
238234```
235+ You can see the state is Success("00").
239236
240237### 3-8 Generate Signed app V2 and download it
241238
242- Similar to V1, you can signe and generate a binary of V2. The update partition starts at "0xffdf0000 ".
239+ Similar to V1, you can signe and generate a binary of V2. The update partition starts at "0xffdf8000 ".
243240You can download it by the flash programmer.
244241
245242
246243```
247244$ sign --ecc256 app_RenesasRx01.bin ../../../../../pri-ecc256.der 2.0
248- rx-elf-objcopy.exe -I binary -O srec --change-addresses=0xffdf0000 app_RenesasRx01_v2.0_signed.bin app_RenesasRx01_v2.0_signed.hex
245+ rx-elf-objcopy.exe -I binary -O srec --change-addresses=0xffdf8000 app_RenesasRx01_v2.0_signed.bin app_RenesasRx01_v2.0_signed.hex
249246```
250247
251248
252249### 3-9 Re-boot and secure update to V2
253250
254251Now the image is downloaded but note that the partition status is not changed yet.
255252When it is re-boot, it checks integrity and authenticity of V1 and initiate V1 as in
256- step 6.
253+ step 8.
257254
258255```
259256| ------------------------------------------------------------------- |
260257| Renesas RX User Application in BOOT partition started by wolfBoot |
261258| ------------------------------------------------------------------- |
262259
263260Current Firmware Version: 1
261+ ....
264262Hit any key to update the firmware.
265- Firmware Update is triggered
266263```
267264
268265After you see the message, hit any key so that the application calls
269266wolfBoot_update_trigger() which changes the partition status and triggers
270- updating the firmware.
267+ updating the firmware. You will see the following messages.
268+
269+ ```
270+ Firmware Update is triggered
271+ === Boot Partition[ffc10000] ===
272+ Magic: WOLF
273+ Version: 01
274+ Status: 00 (Success)
275+ Tail Mgc: BOOT
276+
277+ === Update Partition[ffdf8000] ===
278+ Magic: ����
279+ Version: 00
280+ Status: 70 (Updating)
281+ Tail Mgc: BOOT
282+ ```
271283
272284Since this is just a trigger, the application can continue the process.
273285In the demo application it outputs a message "Firmware Update is triggered" and enters
@@ -291,11 +303,11 @@ Version: 02
291303Status: 10
292304Tail Mgc: BOOT
293305
294- === Update Partition[ffdf0000 ] ===
306+ === Update Partition[ffdf8000 ] ===
295307Magic: WOLF
296308Version: 01
297- Status: ff
298- Tail Mgc: ????
309+ Status: 30
310+ Tail Mgc: BOOT
299311
300312Current Firmware Version: 2
301313```
0 commit comments