Closed brandon-exact closed 1 hour ago
If I modify memory.h
to get it to compile
diff --git a/soc/espressif/esp32s3/memory.h b/soc/espressif/esp32s3/memory.h
index cd9a0ef984b..5dc2b3aa633 100644
--- a/soc/espressif/esp32s3/memory.h
+++ b/soc/espressif/esp32s3/memory.h
@@ -45,9 +45,9 @@
/* For safety margin between bootloader data section and startup stacks */
#define BOOTLOADER_STACK_OVERHEAD 0x0
-#define BOOTLOADER_DRAM_SEG_LEN 0x8000
+#define BOOTLOADER_DRAM_SEG_LEN 0xa000
#define BOOTLOADER_IRAM_LOADER_SEG_LEN 0x1a00
-#define BOOTLOADER_IRAM_SEG_LEN 0xa800
+#define BOOTLOADER_IRAM_SEG_LEN 0xc800
I get a boot loop of
Checksum failure. Calculated 0xe5 stored 0x3c
ets_main.c 329
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0xa (SPI_FAST_FLASH_BOOT)
Saved PC:0x40043ac8
SPIWP:0xee
mode:DIO, clock div:2
load:0x3fcbfc00,len:0x3094
load:0x403b9c00,len:0xc258
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x10 (RTCWDT_RTC_RST),boot:0xa (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:2
load:0x3fcbfc00,len:0x3094
load:0x403b9c00,len:0xc258
load:0x403c6400,len:0x1898
Checksum failure. Calculated 0xe5 stored 0x3c
ets_main.c 329
Is there going to be a fix for this in the next 3-4 months? Thanks!
@brandon-exact Really sorry I missed this. I have just tried using latest main and I get no overflow issues. Would you retry?
@sylvioalves I tried on main and still get the same overflow. I ran west update
and west blobs fetch hal_espressif
@brandon-exact, would you manually increase the iram size for the mcuboot bootloader? https://github.com/zephyrproject-rtos/zephyr/blob/main/soc/espressif/esp32s3/memory.h#L50
#define BOOTLOADER_IRAM_SEG_LEN 0xb000
@marekmatej PTAL.
Edit: I see that you already tried and it worked. This is indeed the resolution for the overflow issue. We will check whether there is an alternative way to improve it somehow.
I think we could increase the IRAM and DRAM to accommodate different build scenarios as it is safe and doesn't make any difference in the user/application memory available.
@brandon-exact, would you manually increase the iram size for the mcuboot bootloader? https://github.com/zephyrproject-rtos/zephyr/blob/main/soc/espressif/esp32s3/memory.h#L50
#define BOOTLOADER_IRAM_SEG_LEN 0xb000
@marekmatej PTAL.
Edit: I see that you already tried and it worked. This is indeed the resolution for the overflow issue. We will check whether there is an alternative way to improve it somehow.
This fixes and works on my dev board with SB_CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256
.
When using SB_CONFIG_BOOT_SIGNATURE_TYPE_RSA
there is still overflows in iram and dram
/home/brandon/zephyr-sdk-0.16.8/xtensa-espressif_esp32s3_zephyr-elf/bin/../lib/gcc/xtensa-espressif_esp32s3_zephyr-elf/12.2.0/../../../../xtensa-espressif_esp32s3_zephyr-elf/bin/ld.bfd: region `iram_seg' overflowed by 2348 bytes
/home/brandon/zephyr-sdk-0.16.8/xtensa-espressif_esp32s3_zephyr-elf/bin/../lib/gcc/xtensa-espressif_esp32s3_zephyr-elf/12.2.0/../../../../xtensa-espressif_esp32s3_zephyr-elf/bin/ld.bfd: region `dram_seg' overflowed by 1272 bytes
but increasing their segments even more allowed it to work on my dev board.
@brandon-exact right, thanks. We will increase it and evaluate properly.
Describe the bug
esp32s3 iram overflows when trying to build with mcuboot and
CONFIG_BOOT_SIGNATURE_TYPE_*
To ReproduceExpected behavior
The sample builds Impact
cannot use mcuboot and esp32s3 Logs and console output
Environment (please complete the following information):