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
{{ message }}
This repository was archived by the owner on Sep 16, 2024. It is now read-only.
The Secure Boot key `secure_boot_signing_key.pem` has to be transformed into `secure-bootloader-key.bin`, to be burnt into efuses. This can be done in 2 ways:
**_If the keys are not written in efuse, before flashing the bootloader, then random keys will be generated by the ESP32, they can never be read nor re-written, so bootloader can never be updated. Even more, the application can be re-flashed (by USB) just 3 more times._**
191
+
192
+
### Makefile options:
193
+
194
+
make BOARD=GPY SECURE=on SECURE_KEY=secure_boot_signing_key.pem ENCRYPT_KEY=flash_encryption_key.bin TARGET=[boot|app]
195
+
196
+
-`SECURE=on` is the main flag; it's not optional
197
+
- if `SECURE=on` by default:
198
+
- encryption is enabled
199
+
- secure_boot_signing_key.pem is the secure boot key, located relatively to Makefile
200
+
- flash_encryption_key.bin is the flash encryption key, located relatively to Makefile
201
+
202
+
For flashing the bootloader digest and the encrypted versions of all binaries:
203
+
204
+
make BOARD=GPY SECURE=on flash
205
+
206
+
### Flashing
207
+
208
+
For flashing the bootloader-reflash-digest.bin has to be written at address 0x0, instead of the bootloader.bin (at address 0x1000).
209
+
210
+
Build is done using `SECURE=on` option; additionally, all the binaries are pre-encrypted.
The OTA should be done using the pre-encrypted application image.
224
+
225
+
Because the encryption is done based on the physical flash address, there are 2 application binaries generated:
226
+
- gpy.bin_enc_0x10000 which has to be written at default factory address: 0x10000
227
+
- gpy.bin_enc_0x1A0000 which has to be written at the ota_0 partition address (0x1A0000)
228
+
229
+
*__Hint:__ on micropython interface, the method `pycom.ota_slot()` responds with the address of the next OTA partition available (either 0x10000 or 0x1A0000).*
0 commit comments