Arduino-esp32: Using arduino-esp32 as a component fails on ESP-IDF v4.1

Created on 7 Nov 2019  路  16Comments  路  Source: espressif/arduino-esp32

Hardware:

Board: ESP32-Devkit-C
Core Installation version: Master branch, v4.1-dev-815-ga45e99853
IDE name: IDF component
Computer OS: macOS Catalina 10.15.1

Description:

Trying to use arduino-esp32 as a component, using this guide.

How to reproduce the errors:

  1. Setup the latest master branch of ESP-IDF
  2. Make sure hello_world project from ESP-IDF/examples/get-started/hello_world builds
  3. Use this guide to add arduino-esp32 as a component
  4. Configure Arduino component to work either as setup/loop functions or without. It doesn't matter.
  5. Run idf.py build or make - both fail, but with different errors:

make fails with:

/Users/radon/Dev/esp/hello_world/components/arduino/cores/esp32/libb64/cdecode.c: In function 'base64_decode_block_signed':
/Users/radon/Dev/esp/hello_world/components/arduino/cores/esp32/libb64/cdecode.c:42:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         *plainchar    = (fragment & 0x03f) << 2;
         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/radon/Dev/esp/hello_world/components/arduino/cores/esp32/libb64/cdecode.c:43:7: note: here
       case step_b:
       ^~~~
/Users/radon/Dev/esp/hello_world/components/arduino/cores/esp32/libb64/cdecode.c:53:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         *plainchar    = (fragment & 0x00f) << 4;
         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/radon/Dev/esp/hello_world/components/arduino/cores/esp32/libb64/cdecode.c:54:7: note: here
       case step_c:
       ^~~~
/Users/radon/Dev/esp/hello_world/components/arduino/cores/esp32/libb64/cdecode.c:64:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         *plainchar    = (fragment & 0x003) << 6;
         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/radon/Dev/esp/hello_world/components/arduino/cores/esp32/libb64/cdecode.c:65:7: note: here
       case step_d:
       ^~~~
make[1]: *** No rule to make target `cores/esp32/libb64/cencode.o', needed by `libarduino.a'.  Stop.
make: *** [component-arduino-build] Error 2

Running idf.py build fails with the following errors:

```Executing action: all (aliases: build)
Running ninja in directory /Users/radon/Dev/esp/hello_world/build
Executing "ninja all"...
[0/1] Re-running CMake...
-- Project is not inside a git repository, or git repository has no commits; will not use 'git describe' to determine PROJECT_VER.
-- Project version: 1
-- Building ESP-IDF components for target esp32
CMake Error at /Users/radon/Dev/esp/esp-idf/tools/cmake/build.cmake:185 (message):
Failed to resolve component 'ethernet'.
Call Stack (most recent call first):
/Users/radon/Dev/esp/esp-idf/tools/cmake/build.cmake:211 (__build_resolve_and_add_req)
/Users/radon/Dev/esp/esp-idf/tools/cmake/build.cmake:425 (__build_expand_requirements)
/Users/radon/Dev/esp/esp-idf/tools/cmake/project.cmake:341 (idf_build_process)
CMakeLists.txt:6 (project)

-- Configuring incomplete, errors occurred!
See also "/Users/radon/Dev/esp/hello_world/build/CMakeFiles/CMakeOutput.log".
FAILED: build.ninja
/usr/local/Cellar/cmake/3.15.5/bin/cmake -S/Users/radon/Dev/esp/hello_world -B/Users/radon/Dev/esp/hello_world/build
ninja: error: rebuilding 'build.ninja': subcommand failed
ninja failed with exit code 1```

stale

Most helpful comment

I tried re-installing esp-idf with v4.0 branch and still got:
CMake Error at C:/Derrick/esp-idf/tools/cmake/build.cmake:185 (message):
Failed to resolve component 'ethernet'.

All 16 comments

IDF v4 is not yet supported. When it is, this will compile.

Hi, do you know when support for version 4.x will be released?

@elad30300 there is no timeline set for it yet as there has not been a stable release yet (only alpha and beta release so far). IDF v3.3 will soon be integrated though.

@atanisoft Its at release candidate stage now, does that mean work on supporting it might start soon?

@frankdownunder there is a v4.0 branch on this repo that should work with it now. There isn't a timeline for going beyond the current v4.0 rc.

I tried re-installing esp-idf with v4.0 branch and still got:
CMake Error at C:/Derrick/esp-idf/tools/cmake/build.cmake:185 (message):
Failed to resolve component 'ethernet'.

When will this be resolved? Still have this issue with v4.1-beta1
https://esp32.com/viewtopic.php?f=13&t=15148&sid=0b9ca47a32dcccd0f0110dde6f608bc0

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

I tried switching to idf-release/v4.0 branch and it works with esp-idf release/v4.0:
git checkout -b idf-release/v4.0 remotes/origin/idf-release/v4.0 --

There are a few more errors during the compilation:

  1. error: 'rtc_gpio_desc' undeclared (first use in this function)
    Solution: Run menuconfig and select Component config > Driver configurations > RTCI0 configuration -> [*] Support array ``rtc_gpio_desc`` for ESP32
  1. error: #error "Please configure IDF framework to include mbedTLS -> Enable pre-shared-key ciphersuites and activate at least one cipher"
    Solution: Component config -> mbedTLS -> TLS Key Exchange Methods -> [*] Enable pre-shared-key ciphersuites

PS: Also I think it's to heavy to clone this repo into EVERY esp-idf project, so I use mklink (in Windows) and all go smoothly.

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

This is still an issue on idf version 4.0.1 (stable). The full error is
Failed to resolve component 'ethernet'. Call Stack (most recent call first): $IDF_PATH/tools/cmake/build.cmake:211 (__build_resolve_and_add_req) $IDF_PATH/tools/cmake/build.cmake:425 (__build_expand_requirements) $IDF_PATH/tools/cmake/project.cmake:348 (idf_build_process)

IDF v4 is not yet supported. When it is, this will compile.

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.

The problem still exists with the released esp-idf v4.1 and also with RC of v4.2 (I tried it in Windows with idf.py)
So this issue does now exist for more than a year :-(

Is there any chance that it will ever be fixed?
Is there any workaround to make it work?

There is workaround:

  • use arduino-esp32 branch idf-release/v4.2 with
  • esp-idf master

Yes, i know that idf-release/v4.2 should match esp-idf v4.2 and maybe it will any time soon, but now, due to some API breaking changes in esp-idf, this combination works, with just small CMakeLists.txt changes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

docloulou picture docloulou  路  3Comments

ComputerLag picture ComputerLag  路  3Comments

huming2207 picture huming2207  路  4Comments

paramono picture paramono  路  4Comments

AsafFisher picture AsafFisher  路  4Comments