Skip to content
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

sysbuild/with_mcuboot sample does not work on ESP32-S3-WROOM-2-N32R8V #84096

Open
JulianWAS opened this issue Jan 16, 2025 · 2 comments
Open
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug platform: ESP32 Espressif ESP32

Comments

@JulianWAS
Copy link

Describe the bug
Attempting to build and run the sysbuild 'with_mcuboot' sample on a ESP32-S3-WROOM-2-N32R8V devkit does not work as expected (at all)

To Reproduce
Install zephyr as per instructions on the Zephyr website.

west build -p always -b esp32s3_devkitc/esp32s3/procpu --sysbuild zephyr/samples/sysbuild/with_mcuboot/

west flash

Output indicates

...
W: Failed reading image headers; Image=0
E: bad image magic 0x0; Image=0
E: Unable to find bootable image

Expected behavior
Output should indicate MCUBoot is used and application is launched similar to:

...
*** Booting Zephyr OS build v4.0.0-3409-g9ba1f2e1704a ***
Address of sample 0x42000000
Hello sysbuild with mcuboot! esp32s3_devkitc

Impact
This has completely stalled any progress on implementing FUOTA

Logs and console output

Build output:

(.venv) julian@OW-0082:~/zephyrproject$ west build -p always -b esp32s3_devkitc/esp32s3/procpu --sysbuild zephyr/samples/sysbuild/with_mcuboot/
-- west build: making build dir /home/julian/zephyrproject/build pristine
-- west build: generating a build system
Loading Zephyr module(s) (Zephyr base): sysbuild_default
-- Found Python3: /home/julian/zephyrproject/.venv/bin/python3 (found suitable version "3.12.3", minimum required is "3.10") found components: Interpreter 
-- Cache files will be written to: /home/julian/.cache/zephyr
-- Found west (found suitable version "1.3.0", minimum required is "0.14.0")
-- Board: esp32s3_devkitc, qualifiers: esp32s3/procpu
Parsing /home/julian/zephyrproject/zephyr/share/sysbuild/Kconfig
Loaded configuration '/home/julian/zephyrproject/build/_sysbuild/empty.conf'
Merged configuration '/home/julian/zephyrproject/zephyr/samples/sysbuild/with_mcuboot/sysbuild.conf'
Configuration saved to '/home/julian/zephyrproject/build/zephyr/.config'
Kconfig header saved to '/home/julian/zephyrproject/build/_sysbuild/autoconf.h'
-- 
   *****************************
   * Running CMake for mcuboot *
   *****************************

Loading Zephyr default modules (Zephyr base).
-- Application: /home/julian/zephyrproject/bootloader/mcuboot/boot/zephyr
-- CMake version: 3.28.3
-- Found Python3: /home/julian/zephyrproject/.venv/bin/python (found suitable version "3.12.3", minimum required is "3.10") found components: Interpreter 
-- Cache files will be written to: /home/julian/.cache/zephyr
-- Zephyr version: 4.0.99 (/home/julian/zephyrproject/zephyr)
-- Found west (found suitable version "1.3.0", minimum required is "0.14.0")
-- Board: esp32s3_devkitc, qualifiers: esp32s3/procpu
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found host-tools: zephyr 0.17.0 (/home/julian/zephyr-sdk-0.17.0)
-- Found toolchain: zephyr 0.17.0 (/home/julian/zephyr-sdk-0.17.0)
-- Found Dtc: /home/julian/zephyr-sdk-0.17.0/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6") 
-- Found BOARD.dts: /home/julian/zephyrproject/zephyr/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_procpu.dts
-- Found devicetree overlay: /home/julian/zephyrproject/bootloader/mcuboot/boot/zephyr/app.overlay
-- Generated zephyr.dts: /home/julian/zephyrproject/build/mcuboot/zephyr/zephyr.dts
-- Generated pickled edt: /home/julian/zephyrproject/build/mcuboot/zephyr/edt.pickle
-- Generated devicetree_generated.h: /home/julian/zephyrproject/build/mcuboot/zephyr/include/generated/zephyr/devicetree_generated.h
-- Including generated dts.cmake file: /home/julian/zephyrproject/build/mcuboot/zephyr/dts.cmake

warning: BOOT_MAX_IMG_SECTORS (defined at
/home/julian/zephyrproject/bootloader/mcuboot/boot/zephyr/Kconfig:463) was assigned the value '512'
but got the value ''. Check these unsatisfied dependencies: (!BOOT_MAX_IMG_SECTORS_AUTO) (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_BOOT_MAX_IMG_SECTORS and/or look up
BOOT_MAX_IMG_SECTORS in the menuconfig/guiconfig interface. The Application Development Primer,
Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be
helpful too.

Parsing /home/julian/zephyrproject/bootloader/mcuboot/boot/zephyr/Kconfig
Loaded configuration '/home/julian/zephyrproject/zephyr/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_procpu_defconfig'
Merged configuration '/home/julian/zephyrproject/bootloader/mcuboot/boot/zephyr/prj.conf'
Merged configuration '/home/julian/zephyrproject/bootloader/mcuboot/boot/zephyr/socs/esp32s3_procpu.conf'
Merged configuration '/home/julian/zephyrproject/zephyr/samples/sysbuild/with_mcuboot/sysbuild/mcuboot.conf'
Merged configuration '/home/julian/zephyrproject/build/mcuboot/zephyr/.config.sysbuild'
Configuration saved to '/home/julian/zephyrproject/build/mcuboot/zephyr/.config'
Kconfig header saved to '/home/julian/zephyrproject/build/mcuboot/zephyr/include/generated/zephyr/autoconf.h'
-- Found GnuLd: /home/julian/zephyr-sdk-0.17.0/xtensa-espressif_esp32s3_zephyr-elf/xtensa-espressif_esp32s3_zephyr-elf/bin/ld.bfd (found version "2.38") 
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/julian/zephyr-sdk-0.17.0/xtensa-espressif_esp32s3_zephyr-elf/bin/xtensa-espressif_esp32s3_zephyr-elf-gcc
-- Espressif HAL path: /home/julian/zephyrproject/modules/hal/espressif
-- Use the esptool.py: /home/julian/zephyrproject/modules/hal/espressif/tools/esptool_py/esptool.py
-- Image partition /soc/flash-controller@60002000/flash@0/partitions/partition@0
check_callgraph using: /home/julian/zephyrproject/modules/hal/espressif/tools/ci/check_callgraph.py
-- Using ccache: /usr/bin/ccache
Calculated maximum number of sectors: 336
-- Configuring done (5.4s)
-- Generating done (0.1s)
-- Build files have been written to: /home/julian/zephyrproject/build/mcuboot
-- 
   **********************************
   * Running CMake for with_mcuboot *
   **********************************

Loading Zephyr default modules (Zephyr base).
-- Application: /home/julian/zephyrproject/zephyr/samples/sysbuild/with_mcuboot
-- CMake version: 3.28.3
-- Found Python3: /home/julian/zephyrproject/.venv/bin/python (found suitable version "3.12.3", minimum required is "3.10") found components: Interpreter 
-- Cache files will be written to: /home/julian/.cache/zephyr
-- Zephyr version: 4.0.99 (/home/julian/zephyrproject/zephyr)
-- Found west (found suitable version "1.3.0", minimum required is "0.14.0")
-- Board: esp32s3_devkitc, qualifiers: esp32s3/procpu
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found host-tools: zephyr 0.17.0 (/home/julian/zephyr-sdk-0.17.0)
-- Found toolchain: zephyr 0.17.0 (/home/julian/zephyr-sdk-0.17.0)
-- Found Dtc: /home/julian/zephyr-sdk-0.17.0/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6") 
-- Found BOARD.dts: /home/julian/zephyrproject/zephyr/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_procpu.dts
-- Generated zephyr.dts: /home/julian/zephyrproject/build/with_mcuboot/zephyr/zephyr.dts
-- Generated pickled edt: /home/julian/zephyrproject/build/with_mcuboot/zephyr/edt.pickle
-- Generated devicetree_generated.h: /home/julian/zephyrproject/build/with_mcuboot/zephyr/include/generated/zephyr/devicetree_generated.h
-- Including generated dts.cmake file: /home/julian/zephyrproject/build/with_mcuboot/zephyr/dts.cmake

warning: MCUBOOT_UPDATE_FOOTER_SIZE (defined at subsys/dfu/Kconfig:55) was assigned the value
'0x1000' but got the value ''. Check these unsatisfied dependencies: MCUBOOT_IMG_MANAGER (=n),
IMG_MANAGER (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MCUBOOT_UPDATE_FOOTER_SIZE and/or look up
MCUBOOT_UPDATE_FOOTER_SIZE in the menuconfig/guiconfig interface. The Application Development
Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual
might be helpful too.

Parsing /home/julian/zephyrproject/zephyr/Kconfig
Loaded configuration '/home/julian/zephyrproject/zephyr/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_procpu_defconfig'
Merged configuration '/home/julian/zephyrproject/zephyr/samples/sysbuild/with_mcuboot/prj.conf'
Merged configuration '/home/julian/zephyrproject/build/with_mcuboot/zephyr/.config.sysbuild'
Configuration saved to '/home/julian/zephyrproject/build/with_mcuboot/zephyr/.config'
Kconfig header saved to '/home/julian/zephyrproject/build/with_mcuboot/zephyr/include/generated/zephyr/autoconf.h'
-- Found GnuLd: /home/julian/zephyr-sdk-0.17.0/xtensa-espressif_esp32s3_zephyr-elf/xtensa-espressif_esp32s3_zephyr-elf/bin/ld.bfd (found version "2.38") 
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/julian/zephyr-sdk-0.17.0/xtensa-espressif_esp32s3_zephyr-elf/bin/xtensa-espressif_esp32s3_zephyr-elf-gcc
-- Espressif HAL path: /home/julian/zephyrproject/modules/hal/espressif
-- Image partition /soc/flash-controller@60002000/flash@0/partitions/partition@20000
-- Using ccache: /usr/bin/ccache
-- Including signing script: /home/julian/zephyrproject/zephyr/cmake/mcuboot.cmake
-- Configuring done (5.5s)
-- Generating done (0.1s)
-- Build files have been written to: /home/julian/zephyrproject/build/with_mcuboot
-- Configuring done (13.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/julian/zephyrproject/build
-- west build: building application
[9/16] Performing build step for 'mcuboot'
[1/242] Preparing syscall dependency handling

[9/242] Generating include/generated/zephyr/version.h
-- Zephyr version: 4.0.99 (/home/julian/zephyrproject/zephyr), build: v4.0.0-3409-g9ba1f2e1704a
[242/242] Linking C executable zephyr/zephyr.elf
Memory region         Used Size  Region Size  %age Used
        iram_seg:       42068 B        48 KB     85.59%
 iram_loader_seg:        5556 B       6656 B     83.47%
        dram_seg:       25688 B        84 KB     29.86%
        IDT_LIST:          0 GB         8 KB      0.00%
Generating files from /home/julian/zephyrproject/build/mcuboot/zephyr/zephyr.elf for board: esp32s3_devkitc
esptool.py v4.7.0
Creating esp32s3 image...
Merged 10 ELF sections
Successfully created esp32s3 image.
[11/16] Performing build step for 'with_mcuboot'
[3/203] Preparing syscall dependency handling

[8/203] Generating include/generated/zephyr/version.h
-- Zephyr version: 4.0.99 (/home/julian/zephyrproject/zephyr), build: v4.0.0-3409-g9ba1f2e1704a
[203/203] Linking C executable zephyr/zephyr.elf
Memory region         Used Size  Region Size  %age Used
     mcuboot_hdr:          32 B         32 B    100.00%
        metadata:          80 B         96 B     83.33%
           FLASH:      135256 B    8388480 B      1.61%
     iram0_0_seg:       17568 B       329 KB      5.21%
     dram0_0_seg:       12776 B       313 KB      3.99%
     irom0_0_seg:       14654 B         8 MB      0.17%
     drom0_0_seg:       69848 B         8 MB      0.83%
    rtc_iram_seg:          0 GB         8 KB      0.00%
    rtc_slow_seg:          0 GB         8 KB      0.00%
        IDT_LIST:          0 GB         8 KB      0.00%
Generating files from /home/julian/zephyrproject/build/with_mcuboot/zephyr/zephyr.elf for board: esp32s3_devkitc
[16/16] Completed 'with_mcuboot'
(.venv) julian@OW-0082:~/zephyrproject$ 

Flash Output

(.venv) julian@OW-0082:~/zephyrproject$ west flash
-- west flash: rebuilding
[0/6] Performing build step for 'with_mcuboot'
ninja: no work to do.
[1/6] Performing build step for 'mcuboot'
ninja: no work to do.
[6/6] Completed 'mcuboot'
-- west flash: using runner esp32
-- runners.esp32: reset after flashing requested
-- runners.esp32: Flashing esp32 chip on None (921600bps)
esptool.py v4.7.0
Found 1 serial ports
Serial port /dev/ttyACM0
Connecting...
Detecting chip type... ESP32-S3
Chip is ESP32-S3 (QFN56) (revision v0.1)
Features: WiFi, BLE, Embedded PSRAM 8MB (AP_1v8)
Crystal is 40MHz
MAC: 34:85:18:a4:9a:54
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 32MB
Flash will be erased from 0x00000000 to 0x0000efff...
Flash params set to 0x0250
SHA digest in image updated
Wrote 65536 bytes at 0x00000000 in -1.9 seconds...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
-- west flash: using runner esp32
-- runners.esp32: reset after flashing requested
-- runners.esp32: Flashing esp32 chip on None (921600bps)
esptool.py v4.7.0
Found 1 serial ports
Serial port /dev/ttyACM0
Connecting...
Detecting chip type... ESP32-S3
Chip is ESP32-S3 (QFN56) (revision v0.1)
Features: WiFi, BLE, Embedded PSRAM 8MB (AP_1v8)
Crystal is 40MHz
MAC: 34:85:18:a4:9a:54
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 32MB
Flash will be erased from 0x00020000 to 0x00041fff...
Wrote 147456 bytes at 0x00020000 in 1.7 seconds (685.2 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

Device output:

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x0 (DOWNLOAD(USB/UART0))
Saved PC:0x403bc4a4
waiting for download
�OHAI�����B���B��C��C��C��C��C���B���F��C��C���B���B��C��C��C��C��C��C��C���B���B��C��C��C���B���z���R���z���z���R���B���B��B��C��C��C��C���B��C_V��B��B��C�ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40378ca5
SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:2
load:0x3fcb5400,len:0x2f8c
load:0x403ba400,len:0xa454
load:0x403c6400,len:0x15b4
entry 0x403bd240
I (92) soc_init: MCUboot 2nd stage bootloader
I (93) soc_init: compile time Jan 16 2025 09:41:37
W (93) soc_init: Unicore bootloader
W (93) spi_flash: Octal flash chip is using but dio mode is selected, will automatically swich to Octal mode
I (103) spi_flash: detected chip: mxic (opi)
I (107) spi_flash: flash io: opi_str
W (110) spi_flash: Detected size(32768k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (122) soc_init: chip revision: v0.1
I (126) flash_init: Boot SPI Speed : 40MHz
I (129) flash_init: SPI Mode       : FAST READ
I (133) flash_init: SPI Flash Size : 32MB
I (137) soc_random: Enabling RNG early entropy source
I (142) soc_random: Disabling RNG early entropy source
I (147) boot: Disabling glitch detection
I (150) boot: Jumping to the main image...
W (188) spi_flash: Octal flash chip is using but dio mode is selected, will automatically swich to Octal mode
E (188) spi_flash: failed to get chip size
W: Failed reading image headers; Image=0
E: bad image magic 0x0; Image=0
E: Unable to find bootable image
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x0 (DOWNLOAD(USB/UART0))
Saved PC:0x403bc4a4
waiting for download
�OHAI�����B���B��C��C��C��C��C���B���F��C��C���B���B��C��C��C��C��C��C��C���B���B��C��C��C���B���B���B��B��C��C��C��C��C��C��C��C��C���B��Co���B��B��C�ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40378d09
SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:2
load:0x3fcb5400,len:0x2f8c
load:0x403ba400,len:0xa454
load:0x403c6400,len:0x15b4
entry 0x403bd240
I (92) soc_init: MCUboot 2nd stage bootloader
I (93) soc_init: compile time Jan 16 2025 09:41:37
W (93) soc_init: Unicore bootloader
W (93) spi_flash: Octal flash chip is using but dio mode is selected, will automatically swich to Octal mode
I (103) spi_flash: detected chip: mxic (opi)
I (107) spi_flash: flash io: opi_str
W (110) spi_flash: Detected size(32768k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (122) soc_init: chip revision: v0.1
I (126) flash_init: Boot SPI Speed : 40MHz
I (129) flash_init: SPI Mode       : FAST READ
I (133) flash_init: SPI Flash Size : 32MB
I (137) soc_random: Enabling RNG early entropy source
I (142) soc_random: Disabling RNG early entropy source
I (147) boot: Disabling glitch detection
I (150) boot: Jumping to the main image...
W (188) spi_flash: Octal flash chip is using but dio mode is selected, will automatically swich to Octal mode
E (188) spi_flash: failed to get chip size
W: Failed reading image headers; Image=0
E: bad image magic 0x0; Image=0
E: Unable to find bootable image

Environment (please complete the following information):

  • OS: Windows / WSL
  • Toolchain: Zephyr-sdk-0.17.0
@JulianWAS JulianWAS added the bug The issue is a bug, or the PR is fixing a bug label Jan 16, 2025
Copy link

Hi @JulianWAS! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

@rftafas
Copy link

rftafas commented Jan 17, 2025

This is a duplicate of #83743 - same info there applies here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug platform: ESP32 Espressif ESP32
Projects
None yet
Development

No branches or pull requests

4 participants