-
-
Notifications
You must be signed in to change notification settings - Fork 734
Description
Summary
After updating to platform = espressif32@6.12.0, PlatformIO installs tool-esptoolpy@2.40900.0. This version of esptool.py contains the following unconditional import:
from intelhex import HexRecordError, IntelHex
This causes builds to fail with:
ModuleNotFoundError: No module named 'intelhex'
—even when the project doesn't use .hex files and doesn't require intelhex.
Environment Details
- PlatformIO Core: 6.1.18
- Platform: espressif32@6.12.0
- Tool: tool-esptoolpy@2.40900.0
- Python used by PlatformIO: "~\Local\Programs\Python\Python311\python.exe"
- Host OS: Windows 10 (Git Bash + VSCode)
- Framework: Arduino
- Board: nodemcu-32s
How to Reproduce
-
Use a basic PlatformIO platformio.ini:
platform = espressif32@6.12.0
board = nodemcu-32s
framework = arduino -
Ensure intelhex is not installed in the Python environment used by PlatformIO
-
Run platformio run or call a build script
-
Observe this crash:
File "...tool-esptoolpy\esptool\bin_image.py", line 16, in
from intelhex import HexRecordError, IntelHex
ModuleNotFoundError: No module named 'intelhex'
Expected Behavior
- If .hex functionality is unused, intelhex should not be required
- Builds should succeed without forcing intelhex installation
Actual Behavior
- Even .bin-only ESP32 builds fail due to an import in bin_image.py that is not guarded by a try-except
Suggested Fixes
- Move the from intelhex import ... inside the function that needs it
- Or wrap in a try-except ImportError block and emit a clear message if .hex usage is triggered
- Or add intelhex to tool-esptoolpy's install-time requirements
Workaround
Manually install intelhex into the Python environment used by PlatformIO:
"~\Local\Programs\Python\Python311\python.exe" -m pip install intelhex
Impact
This silently breaks ESP32 builds for users after updating to espressif32@6.12.0, even for projects that don't need .hex support. The crash is non-obvious and unrelated to the user's code or libraries.