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

Can't compile Arduino as an ESP-IDF component when using PIO release v5.3.0 #1031

Closed
GKFernandes opened this issue Feb 14, 2023 · 5 comments
Closed

Comments

@GKFernandes
Copy link

GKFernandes commented Feb 14, 2023

Hello everyone,

So, I've been trying to make a blank code example work using Arduino as an ESP-IDF Component inside Platformio.

I've followed the guidelines at: https://espressif-docs.readthedocs-hosted.com/projects/arduino-esp32/en/latest/esp-idf_component.html

I intend to build this project to work with ESP32-C3, I'll leave a picture of my platformio.ini file, as well as the current error message when trying to build.

inifile
cmakefile1
errorcode1

Edit 1: I see now that Python dependencies may be an issue as well, I know that release 6.0 fixes that, but unfortunately I can't use release 6.0 with Arduino as a component.

Edit 2: Running Menuconfig for the project works fine.

Many thanks!

@Jason2866
Copy link
Contributor

Jason2866 commented Feb 14, 2023

Your setup is wrong

framework = arduino, espidf

You can look at the examples how it should look like https://github.com/platformio/platform-espressif32/tree/develop/examples

Platformio way is different to IDF. You can't use the documentation from IDF 1:1 with VSC/Platformio.

@GKFernandes
Copy link
Author

GKFernandes commented Feb 14, 2023

Hello there @Jason2866 ,

Thank you for the response.

I've changed my setup, now it seems some Arduino function references are not being 'pulled' by the framework, Arduino setup() and loop() functions seem to not be found.

By the way, this same error was happening when using only framework = espidf

In my project, main.cpp includes the same files as the Blink.cpp in the examples, but without the rest of the code, only the includes.

main.zip

undef_reference

@Jason2866
Copy link
Contributor

In my project, main.cpp includes the same files as the Blink.cpp in the examples, but without the rest of the code, only the includes.

It is not the way it works. Look at the examples.

@GKFernandes
Copy link
Author

In my project, main.cpp includes the same files as the Blink.cpp in the examples, but without the rest of the code, only the includes.

It is not the way it works. Look at the examples.

Sorry, which part doesn't work? The file is almost exactly the same as the blink example.

I've tried build the espidf-arduino-blink example using framework = arduino, espidf, it compiles just fine, but I see it does not add the components/arduino folder, like the ESP-IDF documentation mentions.

In a previous project, I managed to use arduino as a component by creating a component folder inside the project directory and placing the Arduino libraries inside the include folder, I was using release espressif32@3.2.1 at the time and framework = espidf.

Guess I will try to use some IDF functions/properties and menuconfig to see if it works.

@valeros
Copy link
Member

valeros commented Feb 17, 2023

I've tried build the espidf-arduino-blink example using framework = arduino, espidf, it compiles just fine, but I see it does not add the components/arduino folder, like the ESP-IDF documentation mentions.

The Arduino component is added automatically when you specify framework = arduino, espidf.

In a previous project, I managed to use arduino as a component by creating a component folder inside the project directory and placing the Arduino libraries inside the include folder, I was using release espressif32@3.2.1 at the time and framework = espidf.

Again, PlatformIO handles downloading and importing Arduino core as an IDF component when you specify framework = arduino, espidf in your platformio.ini. Your previous approach is completely possible, but in that case you're on your own as we cannot help debug your custom setup.

The recommendation here is to build your project on the basis of available examples.

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

No branches or pull requests

3 participants