Sysprogs forums › Forums › VisualGDB › Adding component to ESP32 build causes it not to load
Tagged: ESP32 ESP-IF
- This topic has 14 replies, 2 voices, and was last updated 6 years, 2 months ago by support.
-
AuthorPosts
-
May 15, 2018 at 15:54 #20926dedvalsonParticipant
Hi,
Fairly new to VisualGDB. Created a new ESP32 IDF project based on the smart_config sample and the current master ESP-IDF. This worked properly. I added a component (libesphttpd) to the components directory. Then, in the VisualGDB properties window I enabled the esphttpd component. I also had to add an html directory to my project.
I did that, and it then built and ran fine. But if I close the solution and reopen it I get a message that states: Load failed. Double-click for details.
The details of the error are as follows:
Loading cached code model from C:\Users\Don\source\repos\EmbeddedProject9\EmbeddedProject9\VisualGDBCache\EmbeddedProject9-Debug\BuildCommandLines.txt... Failed to parse code model from cached file: System.Exception: ESP-IDF build log did not report any built executables at t11.i.c_2(IEnumerable'1 a) at uv.d_2() Checking if any source files need uploading... C:\SysGCC\esp32\bin\bash.exe --login -c "export IDF_PATH=/esp-idf/master && export BATCH_BUILD=1 && export LANG=en_US && cd /cygdrive/c/Users/Don/source/repos/EmbeddedProject9/EmbeddedProject9 && make -n -k BUILD_DIR_BASE='/cygdrive/c/Users/Don/source/repos/EmbeddedProject9/EmbeddedProject9/VisualGDBCache/EmbeddedProject9-Debug/CodeSenseDir' SDKCONFIG='/cygdrive/c/Users/Don/source/repos/EmbeddedProject9/EmbeddedProject9/VisualGDBCache/EmbeddedProject9-Debug/sdkconfig' V=0" Saved the code model to C:\Users\Don\source\repos\EmbeddedProject9\EmbeddedProject9\VisualGDBCache\EmbeddedProject9-Debug\BuildCommandLines.txt System.Exception: ESP-IDF build log did not report any built executables at t11.i.c_2(IEnumerable'1 a) at uv.d_2() at b4.i()
If I turn off the component the project reloads properly.
Am I missing something obvious here?
Don
May 15, 2018 at 16:02 #20929dedvalsonParticipantI should have stated that I see this with both 5.3 and with 5.4 preview 3.
May 15, 2018 at 17:19 #20930supportKeymasterHi,
Yes, most likely something goes wrong with the build scripts. Please try building the project and check the build log – it should show what exactly is stopping the ESP-IDF build system from proceeding.
May 15, 2018 at 18:36 #20932dedvalsonParticipantDo you mean build it outside of Visual Studio? I can’t build it in Visual Studio because the project won’t even load.
May 15, 2018 at 19:18 #20933supportKeymasterHi,
Building with VS should actually work (as in produce the relevant error message). The ESP-IDF projects work differently from the regular VS projects – instead of storing a redundant copy of the project structure in the .vcxproj file, they query the up-to-date structure directly from ESP-IDF and render it in the Solution Explorer. Hence if the ESP-IDF is not able to configure and produce a list of the built files, VisualGDB won’t be able to show anything in Solution Explorer, although it will still be able to kick off the build command.
Once you resolve the build errors (just the ones in the build scripts, errors in source files won’t affect anything), VisualGDB will load the project structure and let you use the convenient GUI to manage it.
May 16, 2018 at 14:16 #20934dedvalsonParticipantAhh, silly me. I assumed that because the load failed I couldn’t run build. So I ran the build and it built successfully within Visual Studio. However the project still wont load in the Solution Explorer.
After a lot of looking around, I think I have figured out what is going on, though I don’t know how to fix it.
When the project loads in visual studio, the following command is issued:
C:\SysGCC\esp32\bin\bash.exe --login -c "export IDF_PATH=/esp-idf/master && export BATCH_BUILD=1 && export LANG=en_US && cd /cygdrive/c/Users/Don/Documents/esphttpd-freertos && make -n -k BUILD_DIR_BASE='/cygdrive/c/Users/Don/source/repos/EmbeddedProject12/EmbeddedProject12/VisualGDBCache/EmbeddedProject12-Debug/CodeSenseDir' SDKCONFIG='/cygdrive/c/Users/Don/source/repos/EmbeddedProject12/EmbeddedProject12/VisualGDBCache/EmbeddedProject12-Debug/sdkconfig' V=0
If I run this same command from a Windows command prompt, the following appears on stderr (not on stdout)
make[2]: *** /cygdrive/c/Users/Don/source/repos/EmbeddedProject12/EmbeddedProject12/VisualGDBCache/EmbeddedProject12-Debug/CodeSenseDir/libesphttpd/mkespfsimage: No such file or directory. Stop. make[1]: *** [/cygdrive/c/Users/Don/Documents/esphttpd-freertos/components/libesphttpd/component.mk:53: mkespfsimage/mkespfsimage] Error 2 make: *** [/esp-idf/master/make/project.mk:467: component-libesphttpd-build] Error 2
mkespfsimage is a windows executable that is built as part of the build process. The libesphttpd component creates mkespfsimage.exe which ends up located in the original esp-idf project directory under Debug/libesphttpd/mkespfsimage.exe
The problem appears to be that during the load, make is told that BUILD_DIR_BASE is the CodeSenseDir, so the executable is not there causing the make -n -k to fail.
So the project builds fine both from Visual studio and from esp-idf, but it can’t load because of this error.
May 17, 2018 at 19:46 #20943supportKeymasterHi,
Thanks for the detailed description, it indeed explains what is going on, so we will try to suggest a good workaround.
The advanced ESP-IDF subsystem works by running the ESP-IDF build command in a special “dry run” mode where it simply prints the gcc command lines that would be used during the build (it still generates config files and a few others). This works for the regular ESP-IDF projects, however it appears to be breaking the custom component you imported.
The easiest fix would be to simply copy the mkespfsimage binary from the actual build directory to the equivalent path under VisualGDBCache/EmbeddedProject12-Debug/CodeSenseDir and then reload the project. It should unblock the ESP-IDF build logic and VisualGDB will be able to pick up the project structure from it. Another option would be to remove the ‘-n -k’ arguments from the build command line you mentioned and rerun it manually. This should build the necessary files automatically and let VisualGDB load the project.
Also if you could point us to the specific version of the library that is causing the issue, we might be able to add a better workaround.
May 22, 2018 at 15:22 #20972dedvalsonParticipantHi,
Copying the executable as you suggested does solve the problem.
The library I am using is available at:
https://github.com/Spritetm/libesphttpd
Thanks,
Don
May 22, 2018 at 15:29 #20973dedvalsonParticipantAs a related question, the ESP-IDF project contains the main and components folder as you would expect, but at the same level there is a directory called “html” that includes sub directories with html pages, jpeg images and so forth to build a website with. How could I make that folder appear in the solution explorer. It would be great to use Visual Studio to edit and manage these file also.
THanks,
Don
May 23, 2018 at 04:52 #20980supportKeymasterHi,
Thanks for the link. That version actually uses a completely custom makefile layout, so minor glitches are to be expected. If manually copying the file works, this is the recommended way to go around it.
Regarding HTML, we could add an option to show the contents of additional manually specified directories in Solution Explorer for ESP-IDF projects. Would that work for you?
May 23, 2018 at 16:19 #20987dedvalsonParticipantThe option for additional directories is what I was looking for, that sounds good.
Don
May 24, 2018 at 23:45 #20997supportKeymasterHi,
No problem. We will try to fit this in the next preview build of VisualGDB.
June 18, 2018 at 13:01 #21149dedvalsonParticipantHi,
I appreciate your great support and help.
Earlier in this chain you stated:
Regarding HTML, we could add an option to show the contents of additional manually specified directories in Solution Explorer for ESP-IDF projects. Would that work for you?
I just wanted to mention that I would still find that extremely helpful if you get time to do it sometime.
Thanks,
Don
June 18, 2018 at 21:30 #21151supportKeymasterHi,
Sorry for the delay. We are still planning to add this in the near future, as soon as we complete finalizing the Arduino support. Please expect this to be available in the next 3-6 weeks.
October 3, 2018 at 06:50 #22182supportKeymasterHi All,
Just wanted to share an update that we have added support for resource folders to the CMake-based ESP-IDF projects (and other Advanced CMake projects) to VisualGDB 5.4 Preview 6.
You can use the Add->Pin a Resource Folder in Solution Explorer command to attach an arbitrary folder with the specified file masks to Solution Explorer.
-
AuthorPosts
- You must be logged in to reply to this topic.