Skip to content

Commit

Permalink
fix: Unknown chip (ID or magic number) error
Browse files Browse the repository at this point in the history
  • Loading branch information
radimkarnis committed Feb 17, 2023
1 parent 7b28699 commit 11e6425
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions esptool/cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ def detect_chip(
except UnsupportedCommandError:
inst.secure_download_mode = True
inst._post_connect()
break
else:
err_msg = f"Unexpected chip ID value {chip_id}."
except (UnsupportedCommandError, struct.error, FatalError) as e:
# UnsupportedCommmanddError: ESP8266/ESP32 ROM
# struct.error: ESP32-S2
Expand All @@ -130,6 +133,9 @@ def detect_chip(
inst = cls(detect_port._port, baud, trace_enabled=trace_enabled)
inst._post_connect()
inst.check_chip_id()
break
else:
err_msg = f"Unexpected chip magic value {chip_magic_value:#010x}."
except UnsupportedCommandError:
raise FatalError(
"Unsupported Command Error received. "
Expand All @@ -145,8 +151,8 @@ def detect_chip(
print("") # end line
return inst
raise FatalError(
"Unexpected CHIP magic value 0x%08x. Failed to autodetect chip type."
% (chip_magic_value)
f"{err_msg} Failed to autodetect chip type."
"\nProbably it is unsupported by this version of esptool."
)


Expand Down

0 comments on commit 11e6425

Please sign in to comment.