From 3555fe101d47533ea0636d777afd79dd877e186d Mon Sep 17 00:00:00 2001 From: Jaroslav Burian Date: Fri, 6 Dec 2024 13:38:54 +0100 Subject: [PATCH] fix: Not reading app description for some SoCs This commit updates the DROM and IROM addresses for the ESP32-C5, ESP32-C6, and ESP32-C61. This also fixes the issue when reading app description using image_info command when there are multiple DROM sections. Closes https://github.com/espressif/esptool/issues/1039 --- esptool/cmds.py | 3 ++- esptool/targets/esp32c5.py | 10 +++++----- esptool/targets/esp32c6.py | 4 ++-- esptool/targets/esp32c61.py | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/esptool/cmds.py b/esptool/cmds.py index 30a12f3b02..4e23aeedef 100644 --- a/esptool/cmds.py +++ b/esptool/cmds.py @@ -875,7 +875,8 @@ def get_key_from_value(dict, val): for idx, seg in enumerate(image.segments): segs = seg.get_memory_type(image) seg_name = ", ".join(segs) - if "DROM" in segs: # The DROM segment starts with the esp_app_desc_t struct + # The DROM segment starts with the esp_app_desc_t struct + if "DROM" in segs and app_desc is None: app_desc = seg.data[:256] elif "DRAM" in segs: # The DRAM segment starts with the esp_bootloader_desc_t struct diff --git a/esptool/targets/esp32c5.py b/esptool/targets/esp32c5.py index 2604fb77cf..4dba3e6d80 100644 --- a/esptool/targets/esp32c5.py +++ b/esptool/targets/esp32c5.py @@ -44,9 +44,9 @@ class ESP32C5ROM(ESP32C6ROM): EFUSE_SECURE_BOOT_EN_MASK = 1 << 20 IROM_MAP_START = 0x42000000 - IROM_MAP_END = 0x42800000 - DROM_MAP_START = 0x42800000 - DROM_MAP_END = 0x43000000 + IROM_MAP_END = 0x44000000 + DROM_MAP_START = 0x42000000 + DROM_MAP_END = 0x44000000 PCR_SYSCLK_CONF_REG = 0x60096110 PCR_SYSCLK_XTAL_FREQ_V = 0x7F << 24 @@ -65,12 +65,12 @@ class ESP32C5ROM(ESP32C6ROM): MEMORY_MAP = [ [0x00000000, 0x00010000, "PADDING"], - [0x42800000, 0x43000000, "DROM"], + [0x42000000, 0x44000000, "DROM"], [0x40800000, 0x40860000, "DRAM"], [0x40800000, 0x40860000, "BYTE_ACCESSIBLE"], [0x4003A000, 0x40040000, "DROM_MASK"], [0x40000000, 0x4003A000, "IROM_MASK"], - [0x42000000, 0x42800000, "IROM"], + [0x42000000, 0x44000000, "IROM"], [0x40800000, 0x40860000, "IRAM"], [0x50000000, 0x50004000, "RTC_IRAM"], [0x50000000, 0x50004000, "RTC_DRAM"], diff --git a/esptool/targets/esp32c6.py b/esptool/targets/esp32c6.py index 16b5531d19..a7e620ac3a 100644 --- a/esptool/targets/esp32c6.py +++ b/esptool/targets/esp32c6.py @@ -89,12 +89,12 @@ class ESP32C6ROM(ESP32C3ROM): MEMORY_MAP = [ [0x00000000, 0x00010000, "PADDING"], - [0x42800000, 0x43000000, "DROM"], + [0x42000000, 0x43000000, "DROM"], [0x40800000, 0x40880000, "DRAM"], [0x40800000, 0x40880000, "BYTE_ACCESSIBLE"], [0x4004AC00, 0x40050000, "DROM_MASK"], [0x40000000, 0x4004AC00, "IROM_MASK"], - [0x42000000, 0x42800000, "IROM"], + [0x42000000, 0x43000000, "IROM"], [0x40800000, 0x40880000, "IRAM"], [0x50000000, 0x50004000, "RTC_IRAM"], [0x50000000, 0x50004000, "RTC_DRAM"], diff --git a/esptool/targets/esp32c61.py b/esptool/targets/esp32c61.py index 2132bda3fd..740500a7a0 100644 --- a/esptool/targets/esp32c61.py +++ b/esptool/targets/esp32c61.py @@ -53,12 +53,12 @@ class ESP32C61ROM(ESP32C6ROM): MEMORY_MAP = [ [0x00000000, 0x00010000, "PADDING"], - [0x41800000, 0x42000000, "DROM"], + [0x42000000, 0x44000000, "DROM"], [0x40800000, 0x40860000, "DRAM"], [0x40800000, 0x40860000, "BYTE_ACCESSIBLE"], [0x4004AC00, 0x40050000, "DROM_MASK"], [0x40000000, 0x4004AC00, "IROM_MASK"], - [0x41000000, 0x41800000, "IROM"], + [0x42000000, 0x44000000, "IROM"], [0x40800000, 0x40860000, "IRAM"], [0x50000000, 0x50004000, "RTC_IRAM"], [0x50000000, 0x50004000, "RTC_DRAM"],