# How to include Espressif vendor components and files?

**URL:** <https://forums.freertos.org/t/how-to-include-espressif-vendor-components-and-files/9014>\
**Category:** AWS\
**Created:** [February 19, 2020, 7:45pm UTC](https://forums.freertos.org/t/how-to-include-espressif-vendor-components-and-files/9014 "2020-02-19T19:45:04Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![yanjos](https://avatars.discourse-cdn.com/v4/letter/y/6a8cbe/32.png) [@yanjos](https://forums.freertos.org/u/yanjos)\
**Post date:** [February 25, 2020, 4:33am UTC](https://forums.freertos.org/t/how-to-include-espressif-vendor-components-and-files/9014/6 "2020-02-25T04:33:17Z")

</div>

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.

> <https://github.com/aws/amazon-freertos/blob/987d9697ad4dc924bd71333c57b2f68bbe81b172/vendors/espressif/boards/esp32/CMakeLists.txt#L52>

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

> [@Linking/using Espressif (esp32) components in a Amazon FreeRTOS project](https://forums.freertos.org/t/linking-using-espressif-esp32-components-in-a-amazon-freertos-project/9000/8):
>
> Here is an example of how you can include the lwIP stack for the custom CMake project and the Espressif Wifi port on amazon-freertos: [https://github.com/yanjos-dev/amazon-freertos-examples/tree/example/lwip\_on\_esp32](https://github.com/yanjos-dev/amazon-freertos-examples/tree/example/lwip_on_esp32) You just need to specify the the -DAFR\_ESP\_LWIP=1 flag in the cmake command as mentioned on the README file. I realized that you don’t need to explicitly include the lwip directory path in your project’s CMakeLists file as the [Espressif CMakeLists.txt on amazon-freertos](https://github.com/aws/amazon-freertos/blob/master/vendors/espressif/boards/esp32/CMakeLists.txt) gets aut…

---

_[View the full topic](https://forums.freertos.org/t/how-to-include-espressif-vendor-components-and-files/9014)._
