esp-idf-notes

Notes for esp idf, cmake, make and kconfig

View on GitHub

ESP IDF

idf.py

The idf.py command line tool provides a front-end for easily managing your project builds. It manages the following tools:

We can build our app without idf.py too, let’s try that.

cd hello_world
mkdir -p build
cd build
#cmake .. -G Ninja   # or 'Unix Makefiles'
#ninja
cmake ..
make -j8

project cmake

cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(myProject)

The inclusion of these three lines, in the order shown above, is necessary for every project:

The build system provides special treatment to the main component. It is a component that gets automatically added to the build provided that it is in the expected location, PROJECT_DIR/main. All other components in the build are also added as its dependencies, saving the user from hunting down dependencies and providing a build that works right out of the box.

Detailed docs about CMakeLists in esp idf

component cmake

Bare minimum things needed in a ESP-IDF Project:

myproject
        CMakeLists.txt
        Makefile
        main
            CMakeLists.txt
            main.c
            component.mk