Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/esp32: use esptool.py from PATH #12028

Closed
wants to merge 2 commits into from

Conversation

gschorcht
Copy link
Contributor

@gschorcht gschorcht commented Aug 17, 2019

Contribution description

This PR removes the use of esptool.py from ESP32 SDK. Instead, esptool.py installed from pip is used. This makes it possible to flash and reset ESP32 without the SDK installed using PORT.
The documentation is updated to clarify esptool.py installation.

Testing procedure

Generate the documentation with

make doc

and install esptool.py according to the documentation.

Compile and flash any application for an ESP32 board using docker:

BUILD_IN_DOCKER=1 make BOARD=esp32-wroom-32 -C examples/default flash term

If the default port doesn't work, use the PORT variable to define the port, for example:

PORT=/dev/ttyUSB1 BUILD_IN_DOCKER=1 \
make BOARD=esp32-wroom-32 -C examples/default flash term

Issues/PRs references

Related to PR #11646.

@cladmi
Copy link
Contributor

cladmi commented Aug 19, 2019

For me the updated documentation makes sense and looks good. (I looked at the html).

It may be better to change already to esptool.py within this PR to match the documentation. I do not mind rebasing.

diff --git a/cpu/esp32/Makefile.include b/cpu/esp32/Makefile.include
index 850a72402..d011791fc 100644
--- a/cpu/esp32/Makefile.include
+++ b/cpu/esp32/Makefile.include
@@ -61,7 +61,7 @@ PSEUDOMODULES += esp_wifi_any
 
 export CPU ?= esp32
 export TARGET_ARCH ?= xtensa-esp32-elf
-export ESPTOOL ?= $(ESP32_SDK_DIR)/components/esptool_py/esptool/esptool.py
+export ESPTOOL ?= esptool.py
 
 USEMODULE += esp_idf
 USEMODULE += esp_idf_driver

@cladmi
Copy link
Contributor

cladmi commented Aug 19, 2019

@MrKevinWeiss you were testing the last esp PRs so may be interested

@MrKevinWeiss MrKevinWeiss self-requested a review August 19, 2019 18:55
@MrKevinWeiss MrKevinWeiss added Area: doc Area: Documentation Platform: ESP Platform: This PR/issue effects ESP-based platforms Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation labels Aug 19, 2019
@MrKevinWeiss MrKevinWeiss added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Aug 28, 2019
@MrKevinWeiss
Copy link
Contributor

I can go through the procedure after the summit! Ping again if I forget.

@gschorcht gschorcht force-pushed the cpu/esp32/doc_esptool branch from 114fdf7 to 2fc7c9c Compare September 6, 2019 12:29
This allows flashing using `esptool.py` install from pip.

The documentation already state that `esptool.py` must be put available in the path and that it is possible to use the `pip` version.
@gschorcht gschorcht force-pushed the cpu/esp32/doc_esptool branch from 2fc7c9c to af95273 Compare September 6, 2019 12:44
@gschorcht gschorcht changed the title cpu/esp32 doc changes to clarify esptool.py installation cpu/esp32: use esptool.py from PATH Sep 8, 2019
@cladmi
Copy link
Contributor

cladmi commented Sep 10, 2019

@MrKevinWeiss ping summit is over :)

@MrKevinWeiss
Copy link
Contributor

Many thanks, I am on it!

@MrKevinWeiss
Copy link
Contributor

I was trying to go through the apt-get install esptool however it doesn't seem like there is a version 2.2 available and the one shipped with stock ubuntu 16.04 doesn't have a esptool.py only a esptool. Can someone can confirm that it is not a problem with the documentation only my system not being able to install the correct version?

The pip install stuff works great though.

@cladmi
Copy link
Contributor

cladmi commented Sep 11, 2019

Indeed, ubuntu seems to ship it named as esptool (debian does the same)

https://packages.ubuntu.com/xenial/amd64/esptool/filelist
https://packages.ubuntu.com/bionic/all/esptool/filelist
https://packages.ubuntu.com/cosmic/all/esptool/filelist

I think because the first versions were binary versions not implemented in python and they kept the name compatibility.

Also only disco ships a version >=2.2.

https://packages.ubuntu.com/disco/esptool

I do not expect any packages from 'xenial' (16.04) to be supported though.

@cladmi
Copy link
Contributor

cladmi commented Sep 11, 2019

The esptool.py is shipped in /usr/share/esptool/esptool.py (as I looked in the file list).

@gschorcht
Copy link
Contributor Author

Sorry, I'm on vacation and can't do much from here.

The esptool shipped with Ubuntu 16.04 and older Debian versions ist too old. Therefore, the minimum required version in the documentation is version 2.2. That's why you have to use pip for Ubuntu 16.04.

@MrKevinWeiss
Copy link
Contributor

Does this become obsolete with #11108?

@gschorcht
Copy link
Contributor Author

Hm, if dist/tool/esptool works, it could also be used by ESP32 toolchain.

@gschorcht
Copy link
Contributor Author

Closed in favor of PR #12750

@gschorcht gschorcht closed this Nov 20, 2019
@gschorcht gschorcht deleted the cpu/esp32/doc_esptool branch December 24, 2019 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: doc Area: Documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ESP Platform: This PR/issue effects ESP-based platforms Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants