Espressif32 example issues can't find sdkconfig.h

I’m trying to run the examples provided for the esp32 and all of them are throwing an error that it cannot find sdkconfig.h in a number of files. Here are a few when I try to run the hello-world example:

In file included from /Users/james.fiszer/.platformio/packages/framework-espidf/components/bootloader/src/main/flash_encrypt.c:19:0:
/Users/james.fiszer/.platformio/packages/framework-espidf/components/log/include/esp_log.h:20:23: fatal error: sdkconfig.h: No such file or directory
compilation terminated.
In file included from /Users/james.fiszer/.platformio/packages/framework-espidf/components/bootloader/src/main/secure_boot.c:19:0:
/Users/james.fiszer/.platformio/packages/framework-espidf/components/log/include/esp_log.h:20:23: fatal error: sdkconfig.h: No such file or directory
compilation terminated.

Any idea on what is causing this?

Could you try pio update and build again? We updated ESP32 dev platform yesterday.

I have the same problem and doing a pio update did not fix it for me…

Please file an issue here Issues · platformio/platform-espressif32 · GitHub

I’m having the same problem. It appears that the espressif32 examples (eg. platform-espressif32/examples/espidf-hello-world at develop · platformio/platform-espressif32 · GitHub) have src/sdkconfig.h already available as an “Automatically generated file; DO NOT EDIT.” but I’m not sure how to convince platformio to automatically generate said file.

According to platform.io usering espidf framework , fatal error: sdkconfig.h not found · Issue #16 · platformio/platform-espressif32 · GitHub sdkconfig.h is not “Automatically generated”, but rather manually copied from some other existing project like https://github.com/platformio/platform-espressif32/blob/develop/examples/espidf-hello-world/src/sdkconfig.h

Howdy folks, I fancy myself as an ESP32 kind of guy and am starting my journey on platformio. The sdkconfig.h file is generated from the ESP32 environment. Assuming platformio wasn’t present, one would download the ESP-IDF SDK and then download an application template (both from Github). One would then run the make command to build a tool …

make menuconfig

When run, this produces a terminal based application which shows menus for the configuration of an ESP32 environment. This contains a wealth of options and it is extremely common to modify these options on a project by project basis. For example, one can describe that one wants Bluetooth or WiFi or change the baud rate for upload or change the diagnostics logging levels. Once the tool has been run, a file called “sdkconfig” is generated which contains your saved settings. In addition, a file called “sdkconfig,h” is built which is the missing file needed for ESP32 ESP-IDF application compilation.

From the little study I have done so far, it appears that platformio has no current support for this technique and hence we must download and run a project outside of platformio in order to build the “sdkconfig.h”. This seems to work but is less than ideal. I understand ESP32 pretty well and would be delighted to collaborate with folks knowledgable on platformio to assist in getting an environment which would be natural and positive for ESP32 users. In addition, we can start to look at the ESP-IDF component model (ESP32 libraries) and how those can relate to platformio.

2 Likes

It is very sad that platformio and espidf are not fully integrated. But anyways, as nkolban said, you have to run make menuconfig and the sdkconfig.h is generated in the build/include folder. I will confirm later if you also need to run make flash. Do not forget to follow the installation instructions from espidf website GitHub - espressif/esp-idf: Espressif IoT Development Framework. Official development framework for Espressif SoCs.

I hope this may help till we get a better integration between both.

1 Like

Please sorry, we have fixed this issue in v0.7.4. Please update ESP32 development platform via pio update

I just switched over from arduino framework to the esp-idf one and I am having the same problem trying to run the esp-idf hello-world example.
I just updated the framework and platform io. - any help would be appreciated.

[Update] Figured it out. Lines were missing from my sdkcofig.h file that was imported as part off the example