I am new to the ESP-IDF but have used Eclipse with NXP, TI, Silicon Labs, and ST.
The installation of ESP-IDF and Eclipse went pretty well after I ignored the "minimum version" requirements for Python and git and just installed the latest versions of those tools before installing ESP-IDF.
ESP-IDF Instructions:
https://docs.espressif.com/projects/esp ... t-started/
Eclipse Instructions:
https://github.com/espressif/idf-eclipse-plugin
Now it is possible to import an ESP-IDF example project, compile it in Eclipse, and resolve symbols just like a real IDE. Perfect.
But the example project that I want to use is not in the ESP-IDF examples. It is
https://github.com/espressif/esp-aws-iot
The difference seems to be that to manually build the ESP-IDF examples, you run idf.py build from the project directory. To build the esp-aws-iot examples, you have to run idf.py build from the subdirectories: examples/subscribe_publish or examples/thing_shadow.
In the Launch Configuration that I made when importing the project, I set the build directory to examples/subscribe_publish and the build command to idf.py build.
The build messages show that it is still attempting to build in the top project directory and getting confused with CMakeLists.txt.
Building manually in a CMD window would be tolerable but the project also does not resolve any of the ESP headers or functions which is the best part of Eclipse.
I realize that it would be possible to completely restructure the project to resemble the examples but that would impair the ability to get upstream changes via git.
Here is the command window output:
Building in: C:\Users\Mark\esp\projects\esp-aws-iot\build
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=C:\Users\Mark\Desktop\esp-idf\tools\cmake\toolchain-esp32.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DIDF_TARGET=esp32 C:\Users\Mark\esp\projects\esp-aws-iot
CMake Error at CMakeLists.txt:26 (register_component):
Unknown CMake command "register_component".
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.13)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring incomplete, errors occurred!
See also "C:/Users/Mark/esp/projects/esp-aws-iot/build/CMakeFiles/CMakeOutput.log".
idf.py build
Executing action: all (aliases: build)
CMakeLists.txt not found in project directory c:\users\mark\esp\projects\esp-aws-iot\build
Build complete (0 errors, 0 warnings): C:\Users\Mark\esp\projects\esp-aws-iot\build
What is the best way to get Eclipse working for this project??
Thank you,
Mark
Eclipse build in subdirectory configuration
-
- Posts: 16
- Joined: Thu Dec 31, 2020 3:34 am
Re: Eclipse build in subdirectory configuration
I am not at my machine, so this is from memory. I think there is also a directory entry for the “start build in” or whatever it is called. That would (hopefully) be the directory eclipse would use to start the idfbuild.py command.
I have not compiled any examples like this, so I am not sure, but the idfbuild.py command is normally not used in a build configuration I think, so I would not want to enter it now. The only thing that needs to change is the directory from which it is being called. From the log that now seems to be the build directory of the root folder, which has no cmakelists.txt file, so that is reported as error.
Maybe you can find the directory used to “start the build” in, like I said above.
I have not compiled any examples like this, so I am not sure, but the idfbuild.py command is normally not used in a build configuration I think, so I would not want to enter it now. The only thing that needs to change is the directory from which it is being called. From the log that now seems to be the build directory of the root folder, which has no cmakelists.txt file, so that is reported as error.
Maybe you can find the directory used to “start the build” in, like I said above.
-
- Posts: 16
- Joined: Thu Dec 31, 2020 3:34 am
Re: Eclipse build in subdirectory configuration
There is no "Start Build In" setting.
There is a "Working Directory" box under "Edit Configuration" in the "Main" tab but it has no effect. This dialog appears to be for configuring an external tool.
There is a "Working Directory" box under "Edit Configuration" in the "Main" tab but it has no effect. This dialog appears to be for configuring an external tool.
Re: Eclipse build in subdirectory configuration
Ah right, "Working Directory", that was the name. I remember now...
OK, pity that did not work, I hoped it would.
Two possible other options:
1 There is an option to add cmake arguments under the "Build Settings". Cmake documentation says that the source path can be specified using "-S <path-to-source>". So maybe if you enter "-S <path-to-example-root>" that will do the trick. I have no idea however if these are passed and if so at what stage of the process. Seems worth a try I'd say.
2 Another approach entirely: what if you place the eclipse project files in the root of the example? Or create a new project there, if only for test purposes.
OK, pity that did not work, I hoped it would.
Two possible other options:
1 There is an option to add cmake arguments under the "Build Settings". Cmake documentation says that the source path can be specified using "-S <path-to-source>". So maybe if you enter "-S <path-to-example-root>" that will do the trick. I have no idea however if these are passed and if so at what stage of the process. Seems worth a try I'd say.
2 Another approach entirely: what if you place the eclipse project files in the root of the example? Or create a new project there, if only for test purposes.
Who is online
Users browsing this forum: No registered users and 62 guests