The simplest way to build is using the provided build script:
# Build for all supported targets
./build.sh all
# Or specify a different target
./build.sh esp8266
# Or to clean all built files
./build.sh clean- Create and enter build directory:
cd example
mkdir -p build && cd build- Configure CMake with your ESP target:
cmake -DESP_TARGET=esp32 .. # Replace esp32 with your target (esp32s2, etc.)- Build the project:
cmake --build .After a successful build, you'll find:
build/stub_<target>.elf- The compiled binarybuild/stub_<target>.map- Memory map filebuild/stub_<target>.asm- Disassembly output
- Make sure you have exported the esp-idf environment with the correct toolchain for your target ESP chip. https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html
- The ESP8266 toolchain is older than the others.
./build.sh esp8266will handle installing it. - The example assumes the parent directory contains the ESP stub library