This guide builds the default embedded-bundle path: an ESP-IDF application
owns the display, ESP-GSP compiles one JSON scene during the build, and the
application updates the UI through the generated C API.
If you want to evaluate ESP-GSP before integrating it, start with the maintained
example:
Then follow the example’s README.md for a simulator preview or a matching
board profile. The rest of this guide explains how to integrate ESP-GSP into an
existing application.
Bundle creation and resource checks run on the task that starts ESP-GSP. Begin
with the hello_world setting CONFIG_ESP_MAIN_TASK_STACK_SIZE=20480, or give
your custom startup task the equivalent headroom. This is a starting point, not
a minimum: measure uxTaskGetStackHighWaterMark() with the fonts, decoders and
logging used by the product before reducing it. Render-task stack settings do
not increase the caller’s stack.
Keep Bundle CRC checks enabled. Do not disable the task watchdog to mask a
startup stall. Use disable_bundle_crc only when another trusted mechanism has
already verified the static assets.
For a local ESP-GSP component directory, use Component Manager override_path
or add it to EXTRA_COMPONENT_DIRS. Keep only one selected component copy in a
build so the compiler, public headers, and runtime come from the same version;
applications do not need their implementation sources.
Install the toolchain manager. CMake reads the component’s .gspc_version and
invokes esp-gsp-tools; the first invocation downloads and verifies that GSPC
release into the local cache automatically:
Terminal window
python-mpipinstall-Uesp-gsp-tools
The default .gspc_version in the component package is the latest GSPC version
compatible with the current GSP release at publish time. To override the GSPC
version for an IDF project, create .gspc_version in the project root; the
project marker takes precedence over the component marker:
Terminal window
echo'0.7.0'>.gspc_version
idf.pybuild
[!TIP]
If the manager cannot be installed or automatic downloads are unsuitable, see
the Compatibility contract, unpack the
archive into a stable tool directory, and override via an environment variable
or CMake argument:
gsp_add_bundle() validates the selected compiler during CMake configuration.
Do not copy a compiler from an unrelated source checkout merely because
gspc --version runs.
The simulator is optional; firmware builds do not require it. Select the
sim version using the version field from
idf_component.yml (the ESP-GSP component version), not the GSPC version in
.gspc_version:
Use name only for elements the application must address. Use callback for
actions that must cross from the UI into product logic. Asset paths are
relative to the scene file.
Read the Scene JSON guide for hierarchy, field selection,
runtime naming, and reference-image translation. The exhaustive field and
widget reference is available in Scene authoring.
With SYMBOL product, include product_gsp.h and initialize with
gsp_product_config(). The startup example below uses the default bundle symbol.
Set a different SYMBOL for each bundle. See
Configuration for all build-time options.
The BSP remains responsible for the panel, framebuffer, byte order, physical
rotation, and optional touch controller. Application startup then uses the
generated bundle configuration:
#include"esp_gsp_esp_lcd.h"
#include"bundle_gsp.h"
staticvoidon_ui_event(esp_gsp_handle_tui,
constesp_gsp_event_t*event,
void*user_ctx)
{
(void)ui;
(void)user_ctx;
if (gsp_main_event_is_power_changed(event)) {
/* Notify an application task; do not block this callback. */
board_display_init() and board_touch_init() are placeholders for the
product BSP. The repository’s shared
examples/common/hw_init component shows
complete panel targets used by the examples.
If the scene, an asset, a selected Kconfig capacity, or a bundle option is
invalid, generation fails as part of this build. After a successful build,
use editor completion or inspect bundle_gsp.h. Generated names follow:
gsp_<scene>_<named-element>_<operation>()
The available operations depend on the element type and dynamic properties.
Update JSON and rebuild to refresh the available helpers; use the declarations
and editor completion from the generated header.
ESP-GSP works with balanced defaults. If the scene compiler reports a capacity
shortage, or product measurements justify a feature, memory, task, or input
change, open:
Terminal window
idf.pymenuconfig
Then navigate to Component config -> ESP-GSP. Use menuconfig for the
active build and keep intentional clean-build values in sdkconfig.defaults.
The active sdkconfig is the value that actually controls an existing build.
See the ESP-IDF Kconfig guide for target-specific defaults,
runtime precedence, memory trade-offs, and a clean-profile validation command.
examples/usage/hello_world is the smallest complete repository integration. For
the included ESP32-P4 profile:
Terminal window
cdexamples/usage/hello_world
idf.py-DSDKCONFIG_DEFAULTS=sdkconfig.defaults\
set-targetesp32p4build
idf.pyflashmonitor
ESP-IDF automatically applies sdkconfig.defaults.esp32p4 after the base
defaults. Other checked-in sdkconfig.defaults.<target> fragments exercise
different display paths. Their pins and timings are examples; they must match
the actual board before flashing.