pkg: use esptool.py v4.9.0 as package#21557
Merged
benpicco merged 3 commits intoRIOT-OS:masterfrom Jun 23, 2025
Merged
Conversation
`esptool.py` is now used as a package within a virtual Python environment. Since `esptool.py` is used for compilation on the one hand and for flashing on the other, `esptool.py` is installed in two separate virtual Python environments, one for compilation and one for flashing only. This is required 1. to be able to flash a precompiled application only without compiling the package and 2. to be able to compile an application in RIOT Docker and flash it on the host system.
benpicco
approved these changes
Jun 23, 2025
Contributor
benpicco
left a comment
There was a problem hiding this comment.
Thank you, works like a charm! (tried with esp8266-esp-12x)
Contributor
Author
Hm, for the ESP8266, the old and simple version 2.4.0 in |
Contributor
Author
|
@benpicco Thanks for reviewing, testing and merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
This PR adds
esptool.pyv4.9.0 as a package and installs it in virtual Python environments.For newer ESP32x variants like ESP32-H2 and ESP32-C6 a newer version of
esptool.pyis required, for example version v4.9.0 However, this version became a more complex Python project with a number of dependencies instead of a single Python file. Therefore, I decided to useesptool.pyas a package from now on and install it in a virtual Python environment.Since
esptool.pyis required for compilation as well as for flashing,esptool.pyis installed in two separate virtual Python environments, one for compilation and one for flashing only. This is needed to be ableIt is still possible to use your own installation of
esptool.pyby overriding the variableESPTOOLin the make command.Since the virtual Python environments are created in
$(RIOTBASE)/build, it could be that the compilation in CI takes too long and it would be better to install it once directly in$(RIOTBASE)/dist/tools/esptools, which would also require an update of RIOT Docker. On my local system the installation ofesptool.pyin a fresh build directory costs about 15 seconds.Testing procedure
should install
esptool.pyin$(RIOTBASE)/build/pkg/esptool/venvand should use it for the preparation of the.binfile.should install
esptool.pyin$(RIOTBASE)/build/pkg/esptool/venv_flashand should work.should install
esptool.pyin/data/riotbuild/riotbase/build/pkg/esptool/venvin RIOT docker and in$(RIOTBASE)/build/pkg/esptool/venv_flashon host and should work.Issues/PRs references
Prerequisite for PR #21522