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
I have built the Espressif port of MCUboot v2.0.0 (with secure boot and flash encryption) using this guide. I'm using MCUboot with my Zephyr-based (v3.5.0) application to perform OTA updates and so on.
After transferring the update image to slot1, I mark it as test using boot_request_upgrade(BOOT_UPGRADE_TEST) from the zephyr-based application. However, after doing a reset, the module still boots into the old image and no swapping is started. It seems like boot_request_upgrade() does not work as intended when using MCUboot with flash encryption enabled, and it doesn't return any error code either.
The build of MCUboot without flash encryption enabled works as intended, i.e. the update image can be marked as test and on the next reboot the swapping starts as expected.
For reference, I sign the update image as: imgtool.py sign -k <SIGNING_KEY.pem> --align 32 --max-align 32 -v 0 -H 32 --pad-header -S <SLOT_SIZE> <BIN_IN> <BIN_OUT>
To Reproduce:
Build MCUboot v2.0.0 with secure boot and encryption enabled for esp32c3
Flash MCUboot, primary application in slot0 and secondary update applicaiton in slot1
Via the primary application, call boot_request_upgrade(BOOT_UPGRADE_TEST)
Reboot
Expected behavior:
MCUboot swaps primary and secondary applications as expected.
Impact:
Since I'm unable to mark update candidate image for update, I have to transfer images that are already marked as test/permanent. More importantly, I'm unable to revert/downgrade to previous image (swapped and stored in slot1).
Logs:
Below is the log from the boot where I expect swapping to begin:
abdulhayub
changed the title
ESP32C3: boot_request_upgrade() does not work when encryption is enabled
ESP32C3: boot_request_upgrade() does not work when flash encryption is enabled
Nov 27, 2023
Hi @abdulhayub, sorry for the delay.
One of the issues is that Virtual eFuses is still not supported on Zephyr for Espressif chips. I was working on provisionally adding this to Zephyr, but still couldn't finish.
Also when working with Flash Encryption enabled, this must be added to DTS as an overlay:
&flash0 {
write-block-size = <32>;
};
However, I couldn't fully test it (currently I can't risk bricking boards as the Virtual eFuses still are not supported on Zephyr level), so be very careful if trying this without Virtual eFuses enabled.
So if I understood it correctly, I just need to add the DTS overlay and experiment with virtual eFuse disabled, right? I will do some testing and get back to you then.
I have built the Espressif port of MCUboot
v2.0.0
(with secure boot and flash encryption) using this guide. I'm using MCUboot with my Zephyr-based (v3.5.0
) application to perform OTA updates and so on.After transferring the update image to
slot1
, I mark it astest
usingboot_request_upgrade(BOOT_UPGRADE_TEST)
from the zephyr-based application. However, after doing a reset, the module still boots into the old image and no swapping is started. It seems likeboot_request_upgrade()
does not work as intended when using MCUboot with flash encryption enabled, and it doesn't return any error code either.The build of MCUboot without flash encryption enabled works as intended, i.e. the update image can be marked as
test
and on the next reboot the swapping starts as expected.For reference, I sign the update image as:
imgtool.py sign -k <SIGNING_KEY.pem> --align 32 --max-align 32 -v 0 -H 32 --pad-header -S <SLOT_SIZE> <BIN_IN> <BIN_OUT>
To Reproduce:
v2.0.0
with secure boot and encryption enabled foresp32c3
slot0
and secondary update applicaiton inslot1
boot_request_upgrade(BOOT_UPGRADE_TEST)
Expected behavior:
MCUboot swaps primary and secondary applications as expected.
Impact:
Since I'm unable to mark update candidate image for update, I have to transfer images that are already marked as
test/permanent
. More importantly, I'm unable to revert/downgrade to previous image (swapped and stored inslot1
).Logs:
Below is the log from the boot where I expect swapping to begin:
Environment:
v2.0.0
- Espressif port foresp32c3
using default boot/espressif/port/esp32c3/bootloader.confzephyr-v3.5.0
esp32c3
(DevkitM-1)The text was updated successfully, but these errors were encountered: