How to include Espressif vendor components and files?

For #include “common/common.h” to work, you would need to have the common.h header file inside of a folder named “common” and the path to the folder in your compiler’s include path.

The #include “freertos/FreeRTOS.h” statement compiles because the header file exists in a folder called “freertos” and the path to that folder is in your compiler’s include path.

For including the lwip component, you will need to build with the “AFR_ESP_LWIP” flag set to one. For example:
“cmake -S . -B build -DAFR_ESP_LWIP=1 -DCMAKE_TOOLCHAIN_FILE=freertos/tools/cmake/toolchains/xtensa-esp32.cmake -GNinja”

The lwip component is an exception because of a conditional used for choosing between the FreeRTOS+ TCP stack and the lwip stack.

You can see an example of how to use the lwip component in Archit’s response here:

1 Like