-
-
Notifications
You must be signed in to change notification settings - Fork 564
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
Firmware binaries are missing SHA256 hash of the original ELF #272
Comments
@valeros adding hash to ElfToBin will also add hash to booloader binary. So I believe this might break the bootloader? From IDF, flag is only added if its not bootloader build: ifndef IS_BOOTLOADER_BUILD |
I've been running with this patch for a while and it doesn't seem to break the bootloader. I can send another patch that restricts this to the firmware binary only though. |
That will be appropriate and inline with IDF implementation. |
Bootloader uses the same ElfToBin builder, so a special emitter is used to add extra flag only for application image
When building binaries from an ELF, the ESP-IDF build system adds a SHA256 hash of the original ELF at offset
0xb0
. This is vital for setting up ESP OTA correctly, since the SHA256 hash is an important method of checking whether the device needs to update its firmware, whether an update succeeded, etc.In pratical terms, this means that
esp_ota_get_app_description
always returns anesp_app_desc_t*
with an empty SHA256 hash, andesp_ota_get_app_elf_sha256
returns an empty array as well.You can see the following logs when an ESP-IDF app built with PlatformIO boots up:
The
0000000000000000
should contain the SHA256 prefix of the ELF file.The text was updated successfully, but these errors were encountered: