You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: IDE/Renesas/e2studio/RA6M4/Readme.md
+30-12Lines changed: 30 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,14 @@
2
2
3
3
## 1. Overview
4
4
5
-
This example demonstrates simple secure firmware update by wolfBoot. A sample application v1 is securely updated to v2. Both versions behave the same except displaying its version of v1 or v2. They are compiled by e2Studio and running on the target board.
5
+
This example demonstrates simple secure firmware update by wolfBoot.
6
+
A sample application v1 is securely updated to v2. Both versions behave the same except displaying its version of v1 or v2.
7
+
They are compiled by e2Studio and running on the target board.
6
8
7
-
In this demo, you may download two versions of application binary file by Renesas Flash Programmer. You can download and excute wolfBoot by e2Studio debugger. Use a USB connection between PC and the board for the debugger and flash programmer.
9
+
In this demo, you may download two versions of the application binary file by Renesas Flash Programmer.
10
+
You can download and excute wolfBoot by e2Studio debugger. Use a USB connection between PC and the board for the debugger and flash programmer.
8
11
9
12
Please see `Readme_wSCE.md` for Renesas SCE use case.
10
-
11
13
## 2. Components and Tools
12
14
13
15
@@ -62,7 +64,8 @@ Flash Allocation:
62
64
This section describes about how to build wolfBoot and application and use them.
63
65
64
66
### 1) Key generation
65
-
It has key tools running under the host environment such as Linux, Windows or MacOS. For comiling the tools, follow the instruction described in the user manual.
67
+
It has key tools running under the host environment such as Linux, Windows or MacOS.
68
+
For compiling the tools, follow the instruction described in the user manual.
The `keygen` tool generates a pair of private and public key with -g option. The private key is stored in the specified file. The public key is stored in a key store as a C source code in "src/keystore.c" so that it can be compiled and linked with wolfBoot. If you have an existing key pair, you can use -i option to import the pablic key to the store.
78
+
The `keygen` tool generates a pair of private and public key with -g option.
79
+
The private key is stored in the specified file.
80
+
The public key is stored in a key store as a C source code in "src/keystore.c" so that it can be compiled and linked with wolfBoot.
81
+
If you have an existing key pair, you can use -i option to import the public key to the store.
76
82
77
83
You can specify various signature algorithms such as
78
84
@@ -112,7 +118,8 @@ Modify `g_flash0 Flash(r_flash_hp)` properites as follows:
112
118
+ Build `wolfBoot` projet
113
119
### 3) Compile the sample application
114
120
115
-
Open project under IDE/Renesas/e2studio/RA6M4/app_RA with e2Studio, and build the project. Project properties are preset for the demo.
121
+
Open project under IDE/Renesas/e2studio/RA6M4/app_RA with e2Studio, and build the project.
122
+
Project properties are preset for the demo.
116
123
117
124
#### 3-1). Prepare SEGGER_RTT for logging
118
125
+ Download J-Link software from [Segger](https://www.segger.com/downloads/jlink)
@@ -167,7 +174,10 @@ You can derive bair binary file (app_RA.bin) by objcopy command as follows.
"sign" command under tools/keytools benerates a signature for the binary with a specified version. It generates a file contain a partition header and application image. The partition header contain generated signature and other control fields. Output file name is made up from the input file name and version like app_RenesasRx01_v1.0_signed.bin.
177
+
"sign" command under tools/keytools benerates a signature for the binary with a specified version.
178
+
It generates a file contain a partition header and application image.
179
+
The partition header contain generated signature and other control fields.
180
+
Output file name is made up from the input file name and version like app_RenesasRx01_v1.0_signed.bin.
Now, you can download and start wolfBoot program by e2Studio debugger. After starting the program, you can see the partition information as follows. If the boot program succeeds integrity and authenticity check, it initiate the application V1. To initially run `wolfBoot` project,
209
+
Now, you can download and start wolfBoot program by e2Studio debugger.
210
+
After starting the program, you can see the partition information as follows.
211
+
If the boot program succeeds integrity and authenticity check, it initiate the application V1. To initially run `wolfBoot` project,
You can see the state is Success("00") and Tail Magic number becomes "BOOT". You can also see flashing each LED light in 1 second. Notable things about V1 application, it will also call wolfBoot_update_trigger() so that it tells wolfBoot that new version exists. We are going to generate and download V2 application into "Update pertition".
263
+
You can see the state is Success("00") and Tail Magic number becomes "BOOT".
264
+
You can also see flashing each LED light in 1 second. Notable things about V1 application,
265
+
it will also call wolfBoot_update_trigger() so that it tells wolfBoot that new version exists.
266
+
We are going to generate and download V2 application into "Update partition".
252
267
253
268
### 7) Generate Signed app V2 and download it
254
269
255
-
Similar to V1, you can signe and generate a binary of V2. The update partition starts at "0x00080000". You can download it by the flash programmer.
270
+
Similar to V1, you can signe and generate a binary of V2. The update partition starts at "0x00080000".
The boot program checks integrity and authenticity of V2, swap the partition safely and initiates V2. You will see following message after the partition
285
+
The boot program checks integrity and authenticity of V2, swap the partition safely and initiates V2.
286
+
You will see following message after the partition
270
287
information. You can also see flashing each LED light in 5 second.
271
288
272
289
```
@@ -310,4 +327,5 @@ Status: FF
310
327
Tail Mgc:
311
328
```
312
329
313
-
You can see "Current Firmware Version : 2". The state is Success("00") and Tail Magic number becomes "BOOT". You can also see flashing each LED light in 5 second at this new version.
330
+
You can see "Current Firmware Version : 2". The state is Success("00") and Tail Magic number becomes "BOOT".
331
+
You can also see flashing each LED light in 5 second at this new version.
Copy file name to clipboardExpand all lines: IDE/Renesas/e2studio/RA6M4/Readme_wSCE.md
+39-15Lines changed: 39 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,10 @@
2
2
3
3
## 1. Overview
4
4
5
-
This example demonstrates simple secure firmware update by wolfBoot and uses Renesas SCE. A sample application v1 is securely updated to v2. Both versions behave the same except displaying its version of v1 or v2. They are compiled by e2Studio and running on the target board.
5
+
This example demonstrates simple secure firmware update by wolfBoot and uses Renesas SCE.
6
+
A sample application v1 is securely updated to v2. Both versions behave the same except displaying its version of v1 or v2. They are compiled by e2Studio and running on the target board.
6
7
7
-
In this demo, you may download two versions of application binary file by Renesas Flash Programmer. You can download and excute wolfBoot by e2Studio debugger. Use a USB connection between PC and the board for the debugger and flash programmer.It is only available RSA with Renesas SCE now.
8
+
In this demo, you may download two versions of the application binary file by Renesas Flash Programmer. You can download and excute wolfBoot by e2Studio debugger. Use a USB connection between PC and the board for the debugger and flash programmer.It is only available RSA with Renesas SCE now.
8
9
9
10
## 2. Components and Tools
10
11
@@ -56,7 +57,8 @@ Flash Allocation:
56
57
This section describes about how to build wolfBoot and application and use them.
57
58
58
59
### 1) Key generation
59
-
It has key tools running under the host environment such as Linux, Windows or MacOS. For comiling the tools, follow the instruction described in the user manual.
60
+
It has key tools running under the host environment such as Linux, Windows or MacOS.
61
+
For compiling the tools, follow the instruction described in the user manual.
The `keygen` tool generates a pair of private and public key with -g option. The private key is stored in the specified file. The public key is stored in a key store as a C source code in "src/keystore.c" so that it can be compiled and linked with wolfBoot. If you have an existing key pair, you can use -i option to import the pablic key to the store.
71
+
The `keygen` tool generates a pair of private and public key with -g option.
72
+
The private key is stored in the specified file.
73
+
The public key is stored in a key store as a C source code in "src/keystore.c" so that it can be compiled and linked with wolfBoot.
74
+
If you have an existing key pair, you can use -i option to import the public key to the store.
70
75
71
76
### 2) Compile wolfBoot
72
77
73
-
Open project under IDE/Renesas/e2studio/RA6M4/wolfBoot with e2Studio, and build the project. Project properties are preset for the demo. `WOLFBOOT_PARTION_INFO` is for debug information about partitions. Eliminate them for operational use.
78
+
Open project under IDE/Renesas/e2studio/RA6M4/wolfBoot with e2Studio, and build the project.
79
+
Project properties are preset for the demo. `WOLFBOOT_PARTION_INFO` is for debug information about partitions.
80
+
Eliminate them for operational use.
74
81
75
82
Enabled `WOLFBOOT_RENESAS_SCEPROTECT` expects to use Renesas SCE.
76
83
@@ -153,7 +160,11 @@ Modify `g_flash0 Flash(r_flash_hp)` properites as follows:
153
160
Code Origin and entry point is "0x00020200". app_RA.elf is gnerated under Debug.
154
161
### 4) Generate Wrapped Key for SCE
155
162
156
-
SCE needs to have a wrapped key for sign verification installed in advance. This section describes how to use wolfBoot with SCE. Current version supports RSA2048. SCE RSA Signature supports #PKCS 1, v1.5. You can generate a RSA key pair by wolfBoot "keygen" command along with Renesas Security Key Management Tool `skmt`. `skmt` command wraps the RAW key and generates C language initial data and a header file for an application program with SCE.
163
+
SCE needs to have a wrapped key for sign verification installed in advance.
164
+
This section describes how to use wolfBoot with SCE. Current version supports RSA2048.
165
+
SCE RSA Signature supports #PKCS 1, v1.5. You can generate a RSA key pair by
166
+
wolfBoot "keygen" command along with Renesas Security Key Management Tool `skmt`.
167
+
`skmt` command wraps the RAW key and generates C language initial data and a header file for an application program with SCE.
157
168
158
169
Please refer SCE User Manual for generating product provisioning.
Please refer Renesas Manual to generate ufpk.key and upfk.key_enc.key.
170
181
171
-
After generating "rfp" format key, you can download it to flash data area by using Renesas flash programmer. The default address for "rfp" key is `0x08001000U` which is set at `user_settings.h`.
182
+
After generating "rfp" format key, you can download it to flash data area by using Renesas flash programmer.
183
+
The default address for "rfp" key is `0x08001000U` which is set at `user_settings.h`.
172
184
173
185
### 4) Generate Signature for app V1
174
186
You can derive bair binary file (app_RA.bin) by objcopy command as follows.
@@ -177,7 +189,11 @@ You can derive bair binary file (app_RA.bin) by objcopy command as follows.
`sign` command under tools/keytools benerates a signature for the binary with a specified version. It generates a file contain a partition header and application image. The partition header contain generated signature and other control fields. Output file name is made up from the input file name and version like app_RenesasRx01_v1.0_signed.bin. It needs to specify `--rsa2048enc` option to sign the image because SCE assumes to have DigestInfo structure before hashed data.
192
+
`sign` command under tools/keytools benerates a signature for the binary with a specified version.
193
+
It generates a file contain a partition header and application image.
194
+
The partition header contain generated signature and other control fields.
195
+
Output file name is made up from the input file name and version like app_RenesasRx01_v1.0_signed.bin.
196
+
It needs to specify `--rsa2048enc` option to sign the image because SCE assumes to have DigestInfo structure before hashed data.
You can see the state is Success("00") and Tail Magic number becomes "BOOT". You can also see flashing each LED light in 1 second. Notable things about V1 application, it will also call wolfBoot_update_trigger() so that it tells wolfBoot that new version exists. We are going to generate and download V2 application into "Update partition".
279
+
You can see the state is Success("00") and Tail Magic number becomes "BOOT".
280
+
You can also see flashing each LED light in 1 second. Notable things about V1 application,
281
+
it will also call wolfBoot_update_trigger() so that it tells wolfBoot that new version exists.
282
+
We are going to generate and download V2 application into "Update partition".
262
283
263
284
### 7) Generate Signed app V2 and download it
264
285
265
-
Similar to V1, you can sign and generate a binary of V2. The update partition starts at "0x00090000". You can download it by the flash programmer.
286
+
Similar to V1, you can sign and generate a binary of V2. The update partition starts at "0x00090000".
The boot program checks integlity and authenticity of V2, swap the partition safely and initiates V2. You will see following message after the partition
278
-
information. You can also see flashing each LED light in 5 second.
299
+
The boot program checks integlity and authenticity of V2, swap the partition safely and initiates V2.
300
+
You will see following message after the partition information.
301
+
You can also see flashing each LED light in 5 second.
You can see "Current Firmware Version : 2". The state is Success("00") and Tail Magic number becomes "BOOT". You can also see flashing each LED light in 5 second at this new version.
342
+
You can see "Current Firmware Version : 2". The state is Success("00") and Tail Magic number becomes "BOOT".
343
+
You can also see flashing each LED light in 5 second at this new version.
0 commit comments