-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Secure Boot V2, flash encryption and merged binary for production ESP32-S3 (IDFGH-11700) #12807
Comments
|
Hi @mahavirj
|
And Security features settings @mahavirj |
It appears that flash encryption is not yet enabled on this device, May I ask how you programmed the flash encryption key, was it programmed externally using Additionally, please enable debug logs in the bootloader and see if there is any problem while enabling the flash encryption workflow. |
@mahavirj |
Okay. Most likely the device could not complete the entire workflow to enable the flash encryption feature, or it was aborted interim of its execution (e.g., by a reset) somehow. For the bootloader size issue, please change the partition table offset as highlighted in this doc guide here. Also, its better to fallback to flash encryption development mode for this device. Just in case, if anything goes wrong we have 1 chance to disable the flash encryption. Please see this guide for development mode here. |
@mahavirj Thank you, |
@mahavirj It seems that something is wrong with the partition map. Partition map:
Logs:
|
Since you have enabled
|
I sign the bootloader additionally with the command add signature. I check partition data with command Let me remind you of the command I use to merge files: If I first upload the signed bootloader and then execute -p /dev/cu.usbserial-11101 monitor flash with the same settings and addresses as I execute merge_bin, the application starts. The merged file, however, does not want to run. Is it possible to find somewhere documentation that shows step by step how to prepare merged file for factory upload with encryption and signature enabled? |
There is no separate documentation for the Do you see same contents in the merged binary at offset 0xc000 as what you read from the flash? Or they are different? |
Hi @mahavirj Ok. In the flash memory zone for the partition map there are some data that I can not associate with anything. Today I will check on a new, clean copy of the device, but all operations in the code that I perform using writing to flash memory concern other addresses, and in addition, the application itself is not even launched. |
JFYI, here is the documentation for merge_bin: https://docs.espressif.com/projects/esptool/en/latest/esp32/esptool/basic-commands.html#merge-binaries-for-flashing-merge-bin @mahavirj's statement is correct. It just joins pieces together. |
@dobairoland Thank you, this documentation I know and use. |
Hi @mahavirj, @dobairoland After completion, it was able to upload and run with developer encryption mode and signature secyreboot v2. Signed OTA updates also work. I'm still waiting for a test in release mode, but I'd rather hold off until a response from you.
|
@MacWyznawca Any further update on this or we can close the issue? |
Answers checklist.
General issue report
What steps should be taken to generate a merged binary file for production with Secure Boot V2 and flash encryption enabled?
Boot loader signed with 3 keys, flash memory encrypted with the key generated in the device.
I upload the signed BootLoader and then the other files without any problem. The problem is with the merged file.
I also have no problem uploading the linked binary file to the encrypted module in development mode.
Also, there was no problem with the linked file and flash encryption enabled, but without SecureBoot v2.
For the merge, I use the command:
esptool.py --chip esp32s3 merge_bin --flash_mode dio --flash_size keep --flash_freq 80m 0x0 bootloader-s.bin 0x9000 base/partition_table/partition-table.bin 0x5d000 base/ota_data_initial.bin 0x60000 base/Base.bin -o Base_TotalEncrypted.bin
The module falls into a loop:
The text was updated successfully, but these errors were encountered: