Skip to content

esp32s3_8048s070c Build Scripts

Build automation for the ESP32S3-8048S070C board — an ESP32-S3 module carrying an 800 × 480 RGB-parallel display with capacitive touch. The three scripts in boards/esp32s3_8048s070c/build_scripts/ form a self-contained mini build system that orchestrates ESP-IDF compilation, UI-resource partition generation, factory-artifact staging, and installer packaging for every firmware variant shipped for this board.


boards/esp32s3_8048s070c/
├── build_scripts/
│ ├── build_one.py ← CLI entry point: build or check a single named variant
│ ├── common.py ← Build orchestration helpers (variant-agnostic logic)
│ └── variants.py ← Variant registry: CMake flag sets + directory layout
├── board_config.cmake ← Board-level CMake config (RESOLUTION_SCREEN, …)
├── partitions_16mb.csv ← Flash partition table (used by generate_resources.py)
├── flash_params.json ← Flash parameters for flash_mgr.py
├── components/bsp/ ← Board Support Package (see esp32s3_8048s070c_bsp.md)
└── Factory/ ← Factory application project (see esp32s3_8048s070c_factory_app.md)

Outputs (installer//)

ESP-IDF

Shared Tooling (tools/build_scripts/)

esp32s3_8048s070c_build_scripts

imports

calls

delegates to

reads

invokes

invokes

copies

invokes

invokes

build_one.py

CLI entry point

common.py

build_variant / check_variant

variants.py

VARIANTS + FACTORY_VARIANTS

generate_resources.py

UI partition binary + headers

package_user_resources_kit.py

Standalone SD-card update kit

flash_mgr.py

Flash map JSON

build_mgr.py

Multi-board batch runner

idf.py build / reconfigure

*.bin firmware artifacts

bootloader_16MB.bin

partitions_16MB.bin

(from Factory build)

ui_resources_16MB_*.bin

ui_resources_kit/

flash_map.json

installer_history.log


Single-variant entry point used both by developers directly and by build_mgr.py when targeting this specific board.

python build_one.py <variant_name> [--clean] [--check]
FlagBehaviour
(none)Build the named variant end-to-end
--cleanWipe build dir + installer dir; do not rebuild
--checkRun CMake reconfigure only — no compilation

The script merges FACTORY_VARIANTS and VARIANTS from variants.py into a single lookup table so factory and firmware variants share the same CLI interface.

Exit codes: 0 = success, 1 = error — suitable for CI pipelines and build_mgr.py error aggregation.


Defines every build configuration for the board. Two dictionaries are exported:

DictionaryPurpose
VARIANTSReleasable firmware images
FACTORY_VARIANTSRecovery/factory-reset images (different cwd)

make_variant_args(*on_flags) — Flag Discipline

Section titled “make_variant_args(*on_flags) — Flag Discipline”

Every CMake option the build system knows about is listed in ROOT_CMAKE_OPTIONS and forced to OFF first. Only the flags explicitly passed to make_variant_args are turned ON. This prevents stale values from a previous CMakeCache leaking into a different variant’s build directory.

DEFAULT_OFF_CMAKE_ARGS = ["-D", "OPTION_A=OFF", "-D", "OPTION_B=OFF", ...]
def make_variant_args(*on_flags):
args = DEFAULT_OFF_CMAKE_ARGS.copy()
for flag in on_flags:
args.extend(["-D", flag]) # e.g. "WIFI_SERVICE=ON"
return args
Variant keyMemoryTransportFirmwareExtra services
16mb_wifi_fluidnc16 MBWiFi + SerialFluidNCmDNS, Socket Client, Update, Lua
16mb_serial_fluidnc16 MBSerial onlyFluidNCUpdate
16mb_serial_grbl16 MBSerial onlyGRBLUpdate
16mb_wifi_grblhal16 MBWiFi + SerialGrblHALmDNS, Socket Client, Update, Lua
factory_16mb (factory)16 MB—Factory app—

WiFi + Socket Client constraint: SOCKET_CLIENT_SERVICE=ON is the correct WiFi CNC transport for this board.
The build system (cmake/sanity_check.cmake) forbids WEBUI_SERVER, SSDP_SERVICE, WS_SERVER_SERVICE, and WS_CLIENT_SERVICE when SOCKET_CLIENT_SERVICE is ON.
See connection_management.md and the feature resource matrix for details.

build/
└── esp32s3_8048s070c_<variant>/ ← build_dir (idf.py -B target)
installer/
└── ESP32S3_8048S070C_16MB_<radio>_<fw>/ ← firmware installer dir
└── (under Factory/ for factory variants)
ESP3D-FACTORY_16MB/

The helper build_config_name(cmake_args) derives the installer directory name deterministically from the CMake flags so it is always consistent between builds.


All build logic that is not variant-specific lives here. The two public functions called by build_one.py are:

build_variant(config) — Full Build Pipeline

Section titled “build_variant(config) — Full Build Pipeline”

Yes

No

No

Yes

No

Yes

No

Yes

No

Yes

build_variant called

--clean flag?

clean_build_dir

build_dir + installer_dir

return 0

prepare_build_dir

create + tag for esp32s3

generate_resources

ui_resources binary + headers

resources OK?

FAILED: ui_resources

idf.py build

-B build_dir -D flags

build OK?

FAILED: cmake/ninja

idf.py size report

cwd == REPO_ROOT?

i.e. firmware variant

OK: factory build done

copy_factory_artifacts

bootloader + partitions from Factory/installer/

artifacts complete?

FAILED: factory artifacts

_copy_ui_resources_bin

ui_resources_*.bin to installer/

_package_user_resources_kit

manifest to installer/ui_resources_kit/

_log_firmware_artifacts

installer_history.log

generate_flash_map

flash_map.json

OK: firmware build done

check_variant(config) — CMake Validate Only

Section titled “check_variant(config) — CMake Validate Only”

Runs idf.py reconfigure (the CMake configure step, no compilation). Used by build_mgr.py --check_* commands and build_one.py --check to catch CMake errors in CI without a full compile.


FunctionFilePurpose
make_variant_args(*on_flags)variants.pyBuild CMake flag list with safe all-OFF baseline
build_config_name(cmake_args)common.pyDerive deterministic installer directory name from flags
resource_variant_string(cmake_args)common.pyMap CMake flags → generate_resources.py --variant string (e.g. 16mb_wifi_fluidnc)
installer_dir_for(config)common.pyCompute installer output path for any variant
generate_resources(cmake_args, build_dir)common.pyInvoke generate_resources.py for the UI partition binary
copy_factory_artifacts(cmake_args)common.pyStage bootloader/partitions from Factory/installer/ into the firmware installer dir; triggers an auto-rebuild of the factory variant if artifacts are absent or incomplete
prepare_build_dir(build_dir)common.pyCreate build dir and write .idf_target marker; wipes the dir if the marker shows a different target (prevents cross-target CMakeCache corruption)
run_cmake_build(cmake_args, cwd, build_dir)common.pyExecute idf.py build; honours --jobs=N via CMAKE_BUILD_PARALLEL_LEVEL
run_cmake_check(cmake_args, cwd, build_dir)common.pyExecute idf.py reconfigure only (no build)
_package_user_resources_kit(...)common.pyAssemble SD-card self-contained UI resource kit under installer/<variant>/ui_resources_kit/
generate_flash_map(config)common.pyCall flash_mgr.py --generate to write flash_map.json
_log_firmware_artifacts(...)common.pyAppend timestamped record to installer_history.log
_factory_artifacts_complete(source_dir)common.pyCheck that Factory/installer/ contains at least one bootloader_*.bin (empty dir = incomplete)

installer//

common.py pipeline

Inputs

partitions_16mb.csv

resources/res_800_480/

main/ + components/

Factory/installer/

ESP3D-FACTORY_16MB/

generate_resources.py

idf.py build

copy artifacts

package kit

flash_mgr.py

bootloader_16MB.bin

partitions_16MB.bin

firmware.bin

ui_resources_16MB_*.bin

ui_resources_kit/

flash_map.json

installer_history.log

esp3d_ui_offsets.h

esp3d_theme_palettes.h


  • The installer directory name comes from CMake (cmake/build_config_name.cmake, which appends the log level _LOG_<LEVEL>): installer_config_name(cmake_args, build_dir) reads <build_dir>/build_config_name.txt and falls back to build_config_name() before any configure; copy_factory_artifacts(cmake_args, build_dir) uses it too.
  • build_config_name() (no log suffix) is passed to generate_resources.py as --build-name, so a resources binary fits the variant with or without logs (build trailer, see tools_build_scripts_ui_resources.md).
  • New 16mb_serial_marlin variant (Marlin groundwork, TARGET_FW_MARLIN=ON).
  • components/bsp/lv_conf.h is regenerated for LVGL 9.6 (see Board_Support_Packages.md).

ROOT_CMAKE_OPTIONS resets all known flags before each variant applies its own selections. Flags are grouped by concern:

CMake Flags

Board Selection

ESP32S3_8048S070C

ESP32S3_8048S043C

ESP32S3_8048S050C

"... all boards listed"

Memory

MEMORY_4_MB

MEMORY_8_MB

MEMORY_16_MB

PSRAM

PSRAM_NONE

PSRAM_2_MB

PSRAM_4_MB

PSRAM_8_MB

Firmware Target

TARGET_FW_FLUIDNC

TARGET_FW_GRBLHAL

TARGET_FW_GRBL

TARGET_FW_SMOOTHIEWARE

TARGET_FW_NONE

Transports

SERIAL_SERVICE

WIFI_SERVICE

BT_SERVICE

BT_SERIAL_SERVICE

BT_BLE_SERVICE

USB_SERIAL_SERVICE

UI / Peripherals

TFT_UI_SERVICE

TFT_TOUCH_SERVICE

SD_CARD_SERVICE

BUZZER_SERVICE

Network Services

MDNS_SERVICE

SSDP_SERVICE

WEBUI_SERVER

WS_SERVER_SERVICE

WS_CLIENT_SERVICE

SOCKET_CLIENT_SERVICE

SOCKET_SERVER_SERVICE

Optional Features

LUA_INTERPRETER_SERVICE

ESP3D_AUTHENTICATION

TIME_SERVICE

UPDATE_SERVICE

NOTIFICATIONS_SERVICE


The factory variant (factory_16mb) uses a separate CMakeLists.txt rooted at boards/esp32s3_8048s070c/Factory/ rather than the repo root. Its build produces the recovery application (see esp32s3_8048s070c_factory_app.md) and stages its binaries under Factory/installer/ESP3D-FACTORY_16MB/.

Firmware variants depend on these factory artifacts:

installer/<variant>/Factory buildcommon.pybuild_one.pyDeveloperinstaller/<variant>/Factory buildcommon.pybuild_one.pyDeveloperalt[Artifacts missing orincomplete]python build_one.py 16mb_wifi_fluidncbuild_variant(config)generate_resources()idf.py build (firmware)copy_factory_artifacts()check Factory/installer/ESP3D-FACTORY_16MB/build_variant(factory_16mb)Factory/installer/ populatedcopy bootloader_16MB.bincopy partitions_16MB.bincopy ota_data_initial.bincopy ui_resources_16MB_*.binwrite installer_history.loggenerate_flash_map()OK

Completeness check: _factory_artifacts_complete verifies that the factory installer directory contains at least one bootloader_*.bin file. A directory that exists but is empty (created by CMake’s file(MAKE_DIRECTORY) at configure time but never successfully built) is treated the same as a missing directory and triggers an automatic factory rebuild.

--clean depth: When --clean is applied to the factory variant, build_variant also wipes any legacy CMakeCache.txt found in the parent of build_dir (e.g. Factory/build/), covering old builds that ran idf.py without the -B <subdir> flag and left artifacts in the wrong place.


prepare_build_dir writes a .idf_target marker file inside each build directory to record that it was configured for esp32s3. If a subsequent build detects a mismatch — e.g. because the directory was previously used for a different chip — it clears the directory entirely before proceeding, preventing CMakeCache cross-contamination.

build/esp32s3_8048s070c_16mb_wifi_fluidnc/
└── .idf_target ← contents: "esp32s3"

PropertyValue
MCUESP32-S3
Display800 × 480, RGB parallel
TouchCapacitive (c suffix in board name)
Flash16 MB (all variants)
IDF targetesp32s3 (enforced via .idf_target marker)
Partition tableboards/esp32s3_8048s070c/partitions_16mb.csv
UI resolution stringres_800_480 (must match RESOLUTION_SCREEN in board_config.cmake)
sdkconfig overlayssdkconfig.16mb.wifi, sdkconfig.16mb.serial
BSP componentboards/esp32s3_8048s070c/components/bsp/

The RESOLUTION constant (res_800_480) is used by generate_resources.py to select the correct image and font assets from the shared resources/ tree.


build_mgr.py discovers this board’s variants by scanning all boards/*/build_scripts/variants.py files across the repository. It delegates individual variant execution to build_one.py via subprocess, passing through --clean, --check, --dev, and --jobs=N flags.

Terminal window
# Build all variants for this board
python tools/build_scripts/build_mgr.py --build_board esp32s3_8048s070c
# Build a single named variant
python tools/build_scripts/build_mgr.py --build_variant 16mb_wifi_fluidnc
# Validate CMake configuration without compiling
python tools/build_scripts/build_mgr.py --check_board esp32s3_8048s070c
# Clean all build and installer artifacts for this board
python tools/build_scripts/build_mgr.py --clean_board esp32s3_8048s070c

Alternatively, call build_one.py directly for a faster single-variant workflow:

Terminal window
cd boards/esp32s3_8048s070c/build_scripts
python build_one.py 16mb_wifi_fluidnc
python build_one.py 16mb_wifi_fluidnc --clean
python build_one.py factory_16mb

Each firmware variant requires a matching ui_resources flash partition binary. common.py generates it automatically before compiling the firmware by calling generate_resources.py with variant-specific parameters derived from the CMake flags:

resource_variant_string(cmake_args) → "16mb_wifi_fluidnc"
↓
generate_resources.py
--variant 16mb_wifi_fluidnc
--resolution res_800_480
--partition-csv boards/esp32s3_8048s070c/partitions_16mb.csv
--out build/esp32s3_8048s070c_16mb_wifi_fluidnc/

Outputs injected into the build:

FileDestinationPurpose
ui_resources_16MB_wifi_fluidnc.bininstaller/<variant>/Partition binary flashed alongside firmware
esp3d_ui_offsets.hmain/display/Image/font IDs compiled into firmware
esp3d_theme_palettes.hmain/display/Theme colour fallbacks compiled into firmware
esp3d_lang_packs.hmain/display/Language slot IDs compiled into firmware
ui_resources_manifest_*.jsonbuild/<variant>/Input for package_user_resources_kit.py

For the UI partition binary format see development.md.
For customising icons and fonts via the SD-card kit see ui_resources_guide.md.


This module follows an identical three-file pattern to the other ESP32-S3 boards. Differences between boards live in the BSP, not the build scripts:

Board build-scripts moduleResolutionDisplay interface
esp32s3_8048s043c_build_scripts800 × 480RGB parallel (ST7262)
esp32s3_8048s050c_build_scripts800 × 480RGB parallel (ST7262)
esp32s3_8048s070c_build_scripts (this document)800 × 480RGB parallel
esp32s3_8048_touch_lcd_7_build_scripts800 × 480RGB parallel
esp32s3_4827s043c_build_scripts480 × 272RGB parallel

DocumentTopic
esp32s3_8048s070c_bsp.mdBSP: display init, touch, LVGL integration for this board
esp32s3_8048s070c_factory_app.mdFactory recovery application built by factory_16mb
tools_build_scripts.mdbuild_mgr.py, generate_resources.py, package_user_resources_kit.py
development.mdui_resources partition format, binary layout, SD-card update mechanics
ui_resources_guide.mdHow to add/replace icons and fonts; SD-card kit workflow
board_build_guidelines.mdCross-board build conventions and onboarding a new board
display_drivers.mdRGB parallel driver architecture, rotation/orientation math
feature_resource_matrix.mdFeature compatibility; WiFi + Socket Client transport policy
esp32_memory_constraints.mdHeap fragmentation guidance for serial + WiFi configurations