CMake, custom components and Windows

Palonso
Posts: 31
Joined: Tue Sep 24, 2019 8:43 pm

CMake, custom components and Windows

Postby Palonso » Wed Mar 18, 2020 7:22 pm

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,

User avatar
gunar.kroeger
Posts: 142
Joined: Fri Jul 27, 2018 6:48 pm

Re: CMake, custom components and Windows

Postby gunar.kroeger » Thu Mar 19, 2020 1:01 pm

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.
"Running was invented in 1612 by Thomas Running when he tried to walk twice at the same time."

Palonso
Posts: 31
Joined: Tue Sep 24, 2019 8:43 pm

Re: CMake, custom components and Windows

Postby Palonso » Mon Mar 23, 2020 9:56 pm

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.

User avatar
gunar.kroeger
Posts: 142
Joined: Fri Jul 27, 2018 6:48 pm

Re: CMake, custom components and Windows

Postby gunar.kroeger » Mon Mar 23, 2020 11:57 pm

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.
"Running was invented in 1612 by Thomas Running when he tried to walk twice at the same time."

Who is online

Users browsing this forum: No registered users and 22 guests