Skip to content

cpu/esp32: fix documentation about toolchain installation#12170

Merged
gschorcht merged 1 commit intoRIOT-OS:masterfrom
benpicco:esp32-fix_doc
Sep 5, 2019
Merged

cpu/esp32: fix documentation about toolchain installation#12170
gschorcht merged 1 commit intoRIOT-OS:masterfrom
benpicco:esp32-fix_doc

Conversation

@benpicco
Copy link
Contributor

@benpicco benpicco commented Sep 4, 2019

Contribution description

It looks like the submodule folders in esp-idf got renamed, this breaks the instructions in the documentation as it instructs the user to get them all to the latest state immediately (git clone --recursive):

$ git clone --recursive https://github.com/espressif/esp-idf.git # checks out all the submodules to the current state/name
$ cd esp-idf
$ git checkout -q f198339ec09e90666150672884535802304d23ec # uh oh
warning: unable to rmdir 'components/asio/asio': Directory not empty
warning: unable to rmdir 'components/bootloader/subproject/components/micro-ecc/micro-ecc': Directory not empty
warning: unable to rmdir 'components/bt/controller/lib': Directory not empty
warning: unable to rmdir 'components/bt/host/nimble/nimble': Directory not empty
warning: unable to rmdir 'components/cbor/tinycbor': Directory not empty
warning: unable to rmdir 'components/esp_wifi/lib_esp32': Directory not empty
warning: unable to rmdir 'components/expat/expat': Directory not empty
warning: unable to rmdir 'components/lwip/lwip': Directory not empty
warning: unable to rmdir 'components/mqtt/esp-mqtt': Directory not empty
warning: unable to rmdir 'components/protobuf-c/protobuf-c': Directory not empty
warning: unable to rmdir 'components/unity/unity': Directory not empty
warning: unable to rmdir 'examples/build_system/cmake/import_lib/main/lib/tinyxml2': Directory not empty
$ cd components/esp32/lib
$ git checkout -q 534a9b14101af90231d40a4f94924d67bc848d5f

fatal: reference is not a tree: 534a9b14101af90231d40a4f94924d67bc848d5f

Now when trying to build e.g. examples/gnrc_networking, this results in errors that the libraries can not be found for linking, the build fails.

If instead we checkout the submodules after bringing the main repo to a known state, things work again

Testing procedure

Follow the instructions for installing the toolchain:

mkdir -p $HOME/esp
cd $HOME/esp
git clone https://github.com/gschorcht/xtensa-esp32-elf.git

git clone https://github.com/espressif/esp-idf.git
cd esp-idf
git checkout f198339ec09e90666150672884535802304d23ec
git submodule init
git submodule update
# the submodule are now already in a known good state, no extra checkout needed

In RIOT, do

export PATH=$HOME/esp/xtensa-esp32-elf/bin:$PATH
export ESP32_SDK_DIR=$HOME/esp/esp-idf

sed -i '1iUSEMODULE += esp_wifi' examples/gnrc_networking/Makefile
make -j BOARD=esp32-wroom-32 -C examples/gnrc_networking

Issues/PRs references

discovered when testing #11997

Checking out the submodules first and then the commit makes a mess.
Doing it the other way round results in a working toolchain.
@benpicco benpicco added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: doc Area: Documentation Area: toolchain Area: toolchains; everything related to compilation, libc, linking, … labels Sep 4, 2019
@benpicco benpicco requested a review from gschorcht September 4, 2019 23:39
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 5, 2019
git checkout -q f198339ec09e90666150672884535802304d23ec
cd components/esp32/lib
git checkout -q 534a9b14101af90231d40a4f94924d67bc848d5f
git checkout f198339ec09e90666150672884535802304d23ec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work. Wouldn't it be better to checkout with -q option? The whole warning/information text might be misleading for the use.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Different tastes I guess. At first I was wondering if -q was doing anything special since I usually don't use it.

But I also think it's good to see what's going on, no warnings afair.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Different tastes I guess.

Indeed. You know the UNIX principle. No messages are good messages.

But I also think it's good to see what's going on, no warnings afair.

OK

@gschorcht
Copy link
Contributor

@benpicco Many thanks for figuring it out. I didn't realize it. When I was writing the documentation it worked in documented way.

@gschorcht gschorcht merged commit b373771 into RIOT-OS:master Sep 5, 2019
@benpicco benpicco deleted the esp32-fix_doc branch September 5, 2019 10:59
@kb2ma kb2ma added this to the Release 2019.10 milestone Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: doc Area: Documentation Area: toolchain Area: toolchains; everything related to compilation, libc, linking, … CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants