Skip to content

Commit

Permalink
fix: Not reading app description for some SoCs
Browse files Browse the repository at this point in the history
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 #1039
  • Loading branch information
Dzarda7 authored and radimkarnis committed Dec 9, 2024
1 parent b23e60f commit 3555fe1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion esptool/cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions esptool/targets/esp32c5.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"],
Expand Down
4 changes: 2 additions & 2 deletions esptool/targets/esp32c6.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
4 changes: 2 additions & 2 deletions esptool/targets/esp32c61.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit 3555fe1

Please sign in to comment.