Description
Describe the bug
The Zephyr DFU subsystem is not compatible with the Espressif MCUBoot Port when Flash Encryption is enabled, as it is not possible (at least for the Espressif chip) to adjust the value of MCUBOOT_BOOT_MAX_ALIGN
with Zephyr build-in options. There is also a discussion about this in the Zephyr Discord server.
Currently, a Zephyr Sysbuild with the Espressif MCUBoot Port is also not possible, which would possibly avoid or solve the problem.
According to a discussion in the Zephyr Discord, it should be possible to customize the MCUBOOT_BOOT_MAX_ALIGN
define via the device tree and the write-block-size
parameter of the flash. However, this does not work without Sybuild or with an Espressif chip.
In detail, the problem is caused by the fact that the Zephyr DFU subsystem also depends on the value of MCUBOOT_BOOT_MAX_ALIGN
(which then differs between the application and the Espressif MCUBoot port), because it uses the bootutil
of MCUBoot to write its header.
To Reproduce
- Activate Flash Encryption in the Espressif MCUBoot port. (
CONFIG_SECURE_FLASH_ENC_ENABLED=y
) - Flash MCUBoot with activated Flash Encryption to an ESP32S3 chip, for example.
- Flash any example that uses the Zephyr DFU subsystem to the controller.
- Update the application via the Zephyr DFU subsystem.
- The update will not be bootable.
Expected behavior
A possibility in Zephyr without Sysbuild to customize the Define MCUBOOT_BOOT_MAX_ALIGN
so that the Zephyr DFU subsystem is compatible with the Espressif MCUBoot Port.
Impact
Manual patching of Zephyr to ensure compatibility.
Environment
- OS: Ubuntu 24.04.2 LTS within WSL2
- Toolchain: zephyr-sdk-0.17.0