IDF component include missing

jomi26@gmail.com
Posts: 8
Joined: Wed Nov 18, 2020 12:59 pm

IDF component include missing

Postby jomi26@gmail.com » Wed Nov 18, 2020 4:27 pm

Hi,

I am new to ESP32 and the IDF tools so I guess I am making a rookie mistake here but I cannot figure it out and the forum search function doesnt work right now (at least for me)
I am using IDF 4.1

Here is my problem:
1. When I include esp_spi_flash.h in main.c everything compiles fine
2. When I create a new component and include esp_spi_flash.h the compilation fails.

Looking at the error in the terminal I can see that the include path to the IDF tools folder where esp_spi_flash.h is located is missing. I guess I just need to change that and it should work but how can I do that?

Below is the error message which does not include the path to esp_spi_flash.h

FAILED: esp-idf/sys_config/CMakeFiles/__idf_sys_config.dir/sys_config.c.obj
ccache C:\Users\Jomi\.espressif\tools\xtensa-esp32-elf\esp-2020r2-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe -Iconfig -I../components/sys_config
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/newlib/platform_include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/freertos/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/heap/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/log/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/lwip/include/apps
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/lwip/include/apps/sntp
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/lwip/lwip/src/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/lwip/port/esp32/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/lwip/port/esp32/include/arch
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/soc/esp32/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/soc/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/esp_rom/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/esp_common/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/xtensa/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/xtensa/esp32/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/esp32/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/driver/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/driver/esp32/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/esp_ringbuf/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/efuse/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/efuse/esp32/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/vfs/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/esp_wifi/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/esp_wifi/esp32/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/esp_event/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/esp_netif/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/esp_eth/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/tcpip_adapter/include
-IH:/EmbeddedProjects/Tools/espressif/esp-idf/components/app_trace/include -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Og -std=gnu99 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_VER=\"v4.1-dirty\" -DESP_PLATFORM -MD -MT esp-idf/sys_config/CMakeFiles/__idf_sys_config.dir/sys_config.c.obj -MF esp-idf\sys_config\CMakeFiles\__idf_sys_config.dir\sys_config.c.obj.d -o esp-idf/sys_config/CMakeFiles/__idf_sys_config.dir/sys_config.c.obj -c ../components/sys_config/sys_config.c
In file included from ../components/sys_config/sys_config.c:32:
../components/sys_config/sys_config.h:27:10: fatal error: esp_spi_flash.h: No such file or directory
#include "esp_spi_flash.h"



Hope anyone can help me
Thanks


jomi26@gmail.com
Posts: 8
Joined: Wed Nov 18, 2020 12:59 pm

Re: IDF component include missing

Postby jomi26@gmail.com » Wed Nov 18, 2020 9:08 pm

Hi Chegewara,

thank you for your quick reply. It works now!

I added "REQUIRES spi_flash" to the CMake file and it works.

Thank you for your help!

Who is online

Users browsing this forum: Baidu [Spider] and 100 guests