Quickstart¶
Add the scripts to an ESP-IDF project, describe one app and build and flash it.
You need git, Python 3 with PyYAML, and either an installed ESP-IDF or the network access to let the scripts
install one (see Setting up a machine). yq is optional; without it the scripts parse
app_config.yml with grep and sed and a few features fall back to defaults
(config_loader.sh).
-
Add the scripts next to the project, as a submodule:
cd examples/esp32 # the folder with the project's CMakeLists.txt git submodule add https://github.com/hardfoc/hf-espidf-project-tools.git scriptsThe scripts take the folder above them as the project. To keep them elsewhere, pass
--project-path; see Project layout. -
Describe the apps in
app_config.ymlbesideCMakeLists.txt:--- version: "1.0" metadata: default_app: "gpio_test" default_build_type: "Debug" target: "esp32c6" idf_versions: ["release/v5.5"] build_types: [["Debug", "Release"]] apps: gpio_test: description: "GPIO self-test" source_file: "GpioTest.cpp" ci_enabled: true featured: true build_config: build_directory_pattern: "build-app-{app_type}-type-{build_type}-target-{target}-idf-{idf_version}" project_name_pattern: "esp32_{app_type}_app" -
Compile the app's source file.
build_app.shpassesAPP_TYPE,BUILD_TYPEandAPP_SOURCE_FILEto CMake. Themaincomponent registers the one file:The full contract, including the requirements phase where these variables are not yet set, is in Project layout.
-
Build:
The firmware lands in
builds/build-app-gpio_test-type-Debug-target-esp32c6-idf-release_v5_5/, withsize.txtandsize.infobeside it. -
Flash and monitor (the port is found automatically;
Ctrl+]leaves the monitor):
See what is configured
./scripts/build_app.sh list prints the apps, build types and ESP-IDF versions;
./scripts/build_app.sh combinations prints every allowed app, build type and version combination.
Next: app_config.yml, every key and who reads it.