Page 1 of 1

CMake, custom components and Windows

Posted: Wed Mar 18, 2020 7:22 pm
by Palonso
Hi,

I used to work with the IDF under Linux distro, but due to external forces I have to change to Windows. My problem is that is not even similar to use the IDF under linux, so I can't make it work.

After installing the toolchain, and following the installation guide (and some video tutorial) I should have the IDF working but at the moment of compiling I have the next error:

Code: Select all

../components/nvs/include/custom_nvs.h:9:10: fatal error: nvs_flash.h: No such file or directory
 #include "nvs_flash.h"
          ^~~~~~~~~~~~~
compilation terminated.
As far as I know this is an IDF internal library, should be found by the compiler itself with the "idf.py" command.

Does someone know what's happening?

Best regards,

Re: CMake, custom components and Windows

Posted: Thu Mar 19, 2020 1:01 pm
by gunar.kroeger
in your custom components you have to add the requirements for all required components except a few like freertos etc.
have a look here: https://docs.espressif.com/projects/esp ... quirements
You will have to work a bit correcting the CMakeLists.txt of your components before getting your system up and running again.
I'm currently in the same process.

Re: CMake, custom components and Windows

Posted: Mon Mar 23, 2020 9:56 pm
by Palonso
Can you give me an example of your CMake files? because i can't add the esp32 components folder which hold the IDF libraries, and using absolute path for every component in every files is not code friendly (at least for me).

Best regards.

Re: CMake, custom components and Windows

Posted: Mon Mar 23, 2020 11:57 pm
by gunar.kroeger
here you go:

Code: Select all

idf_component_register(SRCS BT_hal.c
                    INCLUDE_DIRS include
                    REQUIRES bt connectag)
bt is the bluetooth component in idf and connectag is a custom component.