How to an ESP32 library and reuse it on other projects

jgfrmesp
Posts: 6
Joined: Mon May 15, 2017 11:06 pm

How to an ESP32 library and reuse it on other projects

Postby jgfrmesp » Mon Sep 25, 2017 7:48 pm

Hi,

Currently, I build a library that can be used to configure the esp32 using wifi.
What I want to do is to consider this library as a separate project (e.g. in terms of git) and include it in other projects (since most of my projects need some way to configure the esp32.

My questions are twofold:
1) how can I build an esp32 library with esp-idf build system
2) how can I include the resulting library in another esp32 project.

Thanks.
-- Jaap

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: How to an ESP32 library and reuse it on other projects

Postby ESP_Angus » Tue Sep 26, 2017 1:24 am

Hi Jaap,

The build system docs should explain everything you need to know for this:
https://esp-idf.readthedocs.io/en/lates ... ystem.html

Short version is:
  • Create a component for your library.
  • Put the component in the "components" directory of your project (maybe as a git submodule), or put it somewhere else and set EXTRA_COMPONENT_DIRS in your project Makefile to pick it up.
Please let us know if there's anything that isn't explained adequately in the docs.

Angus

Who is online

Users browsing this forum: Bing [Bot] and 168 guests