Closed Juanc179 closed 1 year ago
@Juanc179
What is the version of the IDF you have installed in your Win11?
idf.py --version
Hi @SuGlider , i tried via CMD and Powershell, also from Python and it doesn't recognize "idf.py" i also tried with "esp-idf.py" and didn't get any results. but, If i search via windows it finds it.... I installed the latest version of IDF (5.0) a few days ago via ESP-IDF extension on vs code. The setup pops up asking for the version and the directory for the install, i choose the latest and didn't touch anything regarding directories. I took a long time installing all the files, time ago i did the same for another project with an older version and it worked just well.
Arduino is not yet compatible with ESP-IDF v5.x, you need to install v4.4.x to use with Arduino :)
Hi @SuGlider , i tried via CMD and Powershell, also from Python and it doesn't recognize "idf.py" i also tried with "esp-idf.py" and didn't get any results. but, If i search via windows it finds it....
In order to be able to run idf.py
, it is necessary to go to the folder where it is installed, C:\Users\jcpis\esp\esp-idf
, and then run 2 scripts, using CMD or Powershell:
C:\Users\jcpis\esp\esp-idf> .\install.bat
C:\Users\jcpis\esp\esp-idf> .\export.bat
C:\Users\jcpis\esp\esp-idf> idy.py --version
ESP-IDF v4.4.2
C:\Users\jcpis\esp\esp-idf>
I installed the latest version of IDF (5.0) a few days ago via ESP-IDF extension on vs code. The setup pops up asking for the version and the directory for the install, i choose the latest and didn't touch anything regarding directories. I took a long time installing all the files, time ago i did the same for another project with an older version and it worked just well.
As @me-no-dev pointed out, Arduino Core 2.0.6 is based on IDF 4.4.3. Each version of Arduino Core has an IDF version linked to it. It is possible to verify it in the Arduino Github site in the Releases area. https://github.com/espressif/arduino-esp32/releases
There is an Espressif Web Site where you can pick the right version of IDF and its Windows Installer: https://dl.espressif.com/dl/esp-idf/?idf=4.4
Hi @SuGlider , thank you all for your time and your responses. I tried the things below.
[1027/1051] Building CXX object esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj FAILED: esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj
before compiling vs code detected "Arduino.h", after build; Arduino.h: No such file or directory. All the CMake files, SDK config, dependencies.lock,CMakeLists.txt are by default.
Looks like it's not finding the Arduino component, or not adding it to the include. What are the contents of both CMakeList.txt
in your project?
content of Project-Template/main/CMakeLists.txt; idf_component_register( SRCS "main.cpp" INCLUDE_DIRS "" ) Content of Project-Template/CMakeLists.txt
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(project-template)
I don't know if it is related, but only after build it doesn't detect Arduino.h header, if i try to go to the definition it goes just as usual and shows me the content of the file.
It seems that there is no `components\arduino\" folder in your project...
This is an example of Folder Project Structure for an Arduino RainMaker exmaple: https://github.com/SuGlider/RainMaker_as_Arduino_Component
Here, there are other 2 examples in the same repository: https://github.com/chegewara/arduino-as-component
In order to verify if the project is correctly strucutured, please refer to the documentation: https://espressif-docs.readthedocs-hosted.com/projects/arduino-esp32/en/latest/esp-idf_component.html
This post and the whole issue may also help you:
Hi, the components are in another folder stored in my computer. in the ESP32 programming guide it suggest to have a single componets folder for multiple projects to avoid having to copy and paste the same folder every single time you create a project. I added that path before building and it detected de arduino.h header file. I did this when i created the project, before building.
Adding to my previous comment; should i add that path to a Cmake file? i only added the path in the Browse Path and Include Path inside the c_cpp_properties.json contained in the project folder. Before adding the path:
After adding the path;
(i created a new project in this example). You can see that it detects the Arduino.h header. After building it stops detecting it but it appears underlined in a different way. Usually the whole line is underlined(before adding paths) but after building it appears only the space between include & "Arduino.h". This happens when i build the project as you've seen before; during building it uses files that are inside the components folder just as usual, but when it gets to this stepp it fails: [1027/1051] Building CXX object esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj FAILED: esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj
@SuGlider i read more in detail the https://github.com/espressif/arduino-esp32/issues/7839 and he's doing another thing, im just trying to compile the code (without any outside library). he's adding libraries outside the usual components. I saw his error message was the same, but im not (yet) trying to add any library. anyways, thank you for tag that issue, i'll look it out again in the future.
Hi, @SuGlider i changed my project conguration like you said and the problem persist. For instance i reinstalled my computer so i have a clean install of ESP-IDF v4.4.4. I added at the start of the project (using New Project command of the extension) the path of my componets folder. The project created succesfully with VS code showing the folder as the image shows below. The same problem persits....
Looks like your arduino is in components/components/arduino
, while it should be components/arduino
Platformio/VSC provides the possibility to compile Arduino as a Component without the need to setup anything yourself. See the example projects how to do.
Looks like your arduino is in
components/components/arduino
, while it should becomponents/arduino
Thank you, i checked that box now. I'm adding the components folder directly in the "New project" in the section "add components directory"; there i am putting the path to the /components/arduino folder that i created before. but a new problem came out with cmake. Down below (at the middle, inside the IDF blue bar) you can see that no kit is selected. wich one should i choose?(i have the mingw64, scan for kits or let cmake decide. neither of 3 options work) i think that an error with the cmake installation has ocurred and the cmake path it not being detected properly. i tried reinstalling the extension but had no luck. im installing all on the defaults paths. This is what i get during the process....
Platformio/VSC provides the possibility to compile Arduino as a Component without the need to setup anything yourself. See the example projects how to do.
Yes, i know that IDE. I tried it last year but i'am more keen towards IDF. at the time PlatformIO had tons of problems and IDF worked well at the first time. Now i tried to update to the latest version and ruined it all :(...
Yes, it was dangerous/tricky to use native IDF and VSC IDF. Latest release (espressif32 @ 6.0.1) does install in an pyenv not anymore global. So this havoc should not happen anymore.
Yes, it was dangerous/tricky to use native IDF and VSC IDF. Latest release (espressif32 @ 6.0.1) does install in an pyenv not anymore global. So this havoc should not happen anymore.
Okay, i'll try platformIO again then. thank you very much all of you @me-no-dev @Jason2866 @SuGlider . I've been more time solving problems than coding
Board
ESP32 DEV MODULE
Device Description
Only the devkit for testing compilation, build and flash.
Hardware Configuration
plain devkit
Version
latest master (checkout manually)
IDE Name
ESP-IDF (Arduino as a component)
Operating System
win 11 21h2
Flash frequency
Default
PSRAM enabled
yes
Upload speed
115200
Description
I am creating a project using Vs code with ESP-IDF with Arduino as a component. When building the project the compilation ends and gives an error code related to the route to this bootloader: "bootloader_flash_config_esp32.c" i looked after it manually and i got to it. The problem is when CMake tries to find it and "edit" or changes the route to it. The route given in the compilation error is ok but the dependency is not. I don't know where to change this, or if it is a problem of Cmake. The project never built before and i haven't changed anything since it was created. i only added the browse and include path to the c_cpp_properties.json for the components. the rest is "stock".
Sketch
Debug Message
Other Steps to Reproduce
I have checked existing issues, online documentation and the Troubleshooting Guide