Skip to content

espidf-arduino-blink example uncompilable because of missing branch #524

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

Open
maxgerhardt opened this issue Apr 4, 2021 · 14 comments
Open

Comments

@maxgerhardt
Copy link
Contributor

Per espressif/arduino-esp32#5007 and espressif/arduino-esp32#4998

The espidf-arduino-blink is uncompilable because the referenced #idf-release/v4.0 was killed in the repo.

platform_packages =
; use a special branch
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#idf-release/v4.0

grafik

@maxgerhardt maxgerhardt changed the title ardiuno espidf-arduino-blink example uncompilable because of missing branch Apr 4, 2021
@sguarin
Copy link

sguarin commented Apr 12, 2021

Same problem here. If I use master branch I also got:

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.2.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 0.0.0+sha.371f382 
 - framework-espidf 3.40001.200521 (4.0.1) 
 - tool-cmake 3.16.4 
 - tool-esptoolpy 1.30000.201119 (3.0.0) 
 - tool-ninja 1.7.1 
 - toolchain-esp32ulp 1.22851.191205 (2.28.51) 
 - toolchain-xtensa32 2.80400.210211 (8.4.0)
Reading CMake configuration...
-- Project version: e11a3b7
-- Building ESP-IDF components for target esp32
-- Configuring incomplete, errors occurred!
See also "/home/sguarin/MEGA/Electronics/ESP32/src/espidf-arduino-blink/.pio/build/stable/CMakeFiles/CMakeOutput.log".

fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
CMake Error at /home/sguarin/.platformio/packages/framework-espidf/tools/cmake/build.cmake:185 (message):
  Failed to resolve component 'arduino_tinyusb'.
Call Stack (most recent call first):
  /home/sguarin/.platformio/packages/framework-espidf/tools/cmake/build.cmake:216 (__build_resolve_and_add_req)
  /home/sguarin/.platformio/packages/framework-espidf/tools/cmake/build.cmake:425 (__build_expand_requirements)
  /home/sguarin/.platformio/packages/framework-espidf/tools/cmake/project.cmake:348 (idf_build_process)
  CMakeLists.txt:3 (project)

It seems this files are needed as an extra idf component: https://github.com/espressif/esp32-arduino-lib-builder/tree/master/components/arduino_tinyusb

@maxgerhardt
Copy link
Contributor Author

Does the workaround here work?

@sguarin
Copy link

sguarin commented Apr 12, 2021

Well I gave this a try. Besides I will be stucked in that commit (https://github.com/marcovannoord/arduino-esp32.git), it gives me the error that requires another component:

  Failed to resolve component 'ethernet'.
Call Stack (most recent call first):                                                                                                    
  /home/sguarin/.platformio/packages/framework-espidf/tools/cmake/build.cmake:211 (__build_resolve_and_add_req)                         
  /home/sguarin/.platformio/packages/framework-espidf/tools/cmake/build.cmake:425 (__build_expand_requirements)                         
  /home/sguarin/.platformio/packages/framework-espidf/tools/cmake/project.cmake:348 (idf_build_process)                                 
  CMakeLists.txt:3 (project) 

The problem is that arduino-esp32 now has support for esp32s2 and incorporates another component arduino_tinyusb for usb support.
I chat a little in arduino-esp32 channel, and lberstone point me in the espressif/esp32-arduino-lib-builder direction. These are some scripts for building arduino-esp32 to work as idf component.
It seems platformio-espressif32 needs some work here.

@EmilianoQS
Copy link

Is there any solution to this problem?

Can't make it work, tried the workaround mentioned by @maxgerhardt but I get problems with other libraries.

@Jason2866
Copy link
Contributor

Jason2866 commented Apr 21, 2021

This works for IDF4.4

platform                    = https://github.com/Jason2866/platform-espressif32.git#feature/arduino-idf-v4.4
platform_packages           = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git

We are using here https://github.com/arendst/Tasmota/blob/development/platformio_override_sample.ini#L201
the only difference we are using a tarball (faster than using git...)

@yogyyoghurt
Copy link

Hi everybody!
I also have problems building the espidf-arduino-blink example.
Basicly the referenced #idf-release/v4.0 could not be found in the repo. Then I played around with a number of modifications. Latest was Jason2866' approach. But still need a number of modifications for problems with 'arduino_tinyusb', 'main' and 'esp_littlefs'. I tried to eliminate them in CMakeLists.txt. But this lead to more problems and is for sure not the right way.
Since I don't have detailed knowledge about the whole build process, my question is: Is there an actual workaround to get that example running? Or any other examples using espidf together with arduino framework?

@Jason2866
Copy link
Contributor

@yogyyoghurt Just tried, compiled and working with ESP32 and ESP32-S2
You can find my test setup https://github.com/Jason2866/arduino-blink

@yogyyoghurt
Copy link

After doing my very first projects in arduino framework, I would like to test some more professional issues, which seem only be possible under espidf framework. So, as I noticed from a number of discussions (e.g. https://community.platformio.org/t/using-esp-idf-library-within-the-arduino-framework-esp32/17226) this should be possible in a very handy way using both frameworks.

@Jason2866 When I have a look in your platformio.ini, it just uses framework Arduino. Right? So this discussion here is about the espidf-arduino-blink example not arduino-blink. Or didn't I get some details?

Does the workaround here work?

@maxgerhardt I have tried this. Seems to work!!! Compiling and linking is OK. I didn't test the application so far. But by the way I have a more general question. Using such a more 'private' branch of a platform_package doesn't make me really happy, although it works. Is it possible to tell platformio, not to check online if this branch still exists? So I would like to stay and ensure not to destroy my working environment?

@sguarin
Copy link

sguarin commented Apr 26, 2021

@yogyyoghurt Just tried, compiled and working with ESP32 and ESP32-S2
You can find my test setup https://github.com/Jason2866/arduino-blink

Thanks. Your test setup works fine, but the problem we are discussing here is when you use:

framework = arduino, espidf

For example the espidf-arduino-blink

@Jason2866
Copy link
Contributor

Should work too, it uses the same setup as espressif/arduino-esp32#4998 (comment)
Just add espidf to the framework

@Jason2866
Copy link
Contributor

Jason2866 commented Apr 26, 2021

@maxgerhardt I have tried this. Seems to work!!! Compiling and linking is OK. I didn't test the application so far. But by the way I have a more general question. Using such a more 'private' branch of a platform_package doesn't make me really happy, although it works. Is it possible to tell platformio, not to check online if this branch still exists? So I would like to stay and ensure not to destroy my working environment?

Just fork the setup (platform and platform_packages) which is working for you and refer to your own. As long there is no stable version released, you could not expect a setup which will last for early alpha or beta stuff.

@LioRei
Copy link

LioRei commented Apr 26, 2021

maybe the definition of board need to be updated as the latest expressif package is officially supporting esp32s2 : https://github.com/espressif/arduino-esp32#esp32-s2-and-esp32-c3-support

(all branches used for esp32s2 has been deleted by expressif)

@Jason2866
Copy link
Contributor

@apwwn the branch esp32s2 is now integrated in master and so not needed anymore. You can easily define boards yourself. Just place your boards.json in folder boards in root of Platformio project. I have done this for project Tasmota

@maxgerhardt
Copy link
Contributor Author

maxgerhardt commented May 23, 2021

@valeros people are still hitting this issue, see e.g. community topic. Please update the branches / build system of the Arduino+ESP-IDF examples? It's indeed bad that Arduino-ESP32 deletes branches at any time, so maybe a backup fork would be good 🤔

Edit: Ah I see that the example has switched to

platform_packages =
; use a special branch
framework-arduinoespressif32 @ https://github.com/marcovannoord/arduino-esp32.git#idf-release/v4.0

but can we also get support for building the master branch of Arduino-ESP32 with the there-in referenced ESP-IDF version, more dynamically? (E.g., more easily changable ESP-IDF versions by commit-id instead of being able to use only what's in the package repository -- can't use the esp-idf repo directly because they have no package.json)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants