Skip to content

ESP32-3248S035C Board Support Package

The ESP32-3248S035C module is the Board Support Package (BSP) for the ESP32-3248S035C development board — a 3.5-inch IPS touchscreen panel built around the original ESP32 SoC. The “C” suffix denotes a Capacitive touch panel (GT911, I2C), distinguishing it from the otherwise similar esp32_3248s035r variant which uses a Resistive touch controller (XPT2046, SPI).

This BSP provides:

  • A standalone Factory/recovery application flashed to the factory partition, used for OTA firmware and UI-resource updates from an SD card.
  • A BSP component used by the main pendant firmware, wiring the ST7796 display and GT911 touch controller into LVGL.
  • Build scripts that define and compile the supported firmware variants for this board.

The module lives entirely under boards/esp32_3248s035c/ and is one board in the wider Board Support Packages family.


FeatureDetail
MCUESP32 (Xtensa dual-core LX6, 240 MHz)
Flash4 MB
PSRAMNone
DisplayST7796 3.5” IPS TFT, 320 × 480 px, SPI
TouchGT911 capacitive multi-touch, I2C
Physical buttonsNot populated (GPIO_NUM_NC)
Rotary encoderNot populated (GPIO_NUM_NC)
BuzzerNot populated (GPIO_NUM_NC)
SD cardSPI interface
Recovery entrySoftware trigger only ([ESP444]FACTORY from main firmware)
Custom bootloaderNone (no physical boot button to hold at reset)

Touch-only navigation. Unlike the pibot_pendant_v1_0 or the resistive sibling esp32_3248s035r, this board has no encoder, buttons, or buzzer wired. All navigation in the factory app is via virtual on-screen buttons. Driver code for buttons, encoder, and buzzer is compiled in but safely no-ops at runtime through GPIO_IS_VALID_GPIO() guards.


The module is organized into three distinct layers, each documented in its own sub-module file:

Build System

Factory Partition Context

Main Firmware Context

BSP Component

components/bsp/

LVGL (Core 1)

ST7796 SPI Driver

hardware/common/drivers

GT911 I2C Driver

hardware/common/drivers

Factory App

Factory/main/

ST7796 Standalone Driver

(no LVGL / esp3d_log)

GFX 2D Library

GT911 Touch Polling

(shared driver)

SD Card SPI

build_scripts/

variants.py

common.py

build_one.py

main/main.cpp → ESP3DX::begin()

flash partition: factory

Developer / CI

0x0000 Bootloader (standard ESP-IDF — no custom hooks on this board)
0xC000 Partition table
0xD000 NVS
0xF000 otadata ← saved to 0xB000 by main firmware before entering recovery
0x10000 app0 ← main pendant firmware
factory ← this module's Factory app
ui_resources ← LVGL images, fonts, theme palette

The main firmware (in esp444.cpp) writes a magic-tagged backup of otadata to offset 0xB000 before switching to the factory partition. The factory app’s restore_otadata_from_backup() restores it on startup so the board correctly returns to app0 after a power cycle during recovery.


The recovery application running from the factory flash partition. It presents a touch-navigable menu to:

  • Boot a selected OTA partition (app0 / app1).
  • Flash a new firmware image from SD card (esp3dfw.bin → OTA via esp_ota_write).
  • Flash new UI resources from SD card (ui_resources.bin → raw partition write).

Key components: main.c (menu loop, OTA actions), gfx.c (2D graphics / snapshot), st7796.c (standalone SPI display driver), touch.c (GT911 polling wrapper), sdcard.c (SPI SD mount), buttons.c, buzzer.c, encoder.c (no-op on this board), factory_log.h.


The hardware initialization layer consumed by the main pendant firmware. It:

  • Initializes the ST7796 SPI display and applies a board-specific mirror-Y orientation correction.
  • Initializes the GT911 capacitive touch controller via shared I2C driver, with activity-manager wakeup-suppression logic.
  • Configures LVGL: display, DMA-capable draw buffers, flush callback, tick timer, and touch input device.
  • Registers custom LVGL control events for switch and potentiometer inputs.

Key components: board_init.c, control_event.h, control_types.c.


Python build system for the firmware variant matrix. It handles:

  • Variant definitions (4 MB flash × transport × CNC firmware target).
  • CMake invocation through ESP-IDF idf.py with forced IDF_TARGET=esp32.
  • UI resource binary (ui_resources_*.bin) generation via generate_resources.py.
  • Factory artifact copying (bootloader, partition table) from the factory build into the installer directory.
  • Flash map JSON generation.

Key components: build_one.py, common.py, variants.py.


LVGLtouch_gt911bus_i2cst7796_spiactivity_managerboard_init()main.cppESP3DX::begin()LVGLtouch_gt911bus_i2cst7796_spiactivity_managerboard_init()main.cppESP3DX::begin()LVGL running on Core 1board_init()activity_manager_init()st7796_spi_configure()esp_lcd_panel_mirror(Y)bus_i2c_init()touch_gt911_configure()lv_init()lv_display_create(320, 480)lv_display_set_flush_cb(lvgl_flush_cb)esp_timer (1 ms tick → lv_tick_inc)lv_indev_create() ← touch_read_cb (10 ms)control_events_init()lvgl_flush_cb() → esp_lcd_panel_draw_bitmap()touch_read_cb() → touch_gt911_read()notify_lvgl_flush_ready() (SPI DMA done)

encoder CW/CCW

button press

touch tap

virtual btn

Boot app

SD → app0/1

SD → resources

app_main

restore_otadata_from_backup

st7796_init + backlight

buttons / encoder / touch / buzzer init

probe_sd_files

draw_menu

Main Loop

menu_move ±1

dispatch_button

touch_hint_hit_test

execute_selected_action

boot_partition → esp_restart

action_sd_update: esp_ota_*

action_sd_update_res: esp_partition_write

esp_restart


The build system defines four production firmware variants and one factory variant:

VariantMemoryTransportCNC Target
4mb_wifi_fluidnc4 MBWiFi + SerialFluidNC
4mb_serial_fluidnc4 MBSerial UARTFluidNC
4mb_serial_grbl4 MBSerial UARTGRBL
4mb_wifi_grblhal4 MBWiFi + SerialgrblHAL
factory_4mb (factory)4 MB—Recovery

All production variants enable TFT_UI_SERVICE, TFT_TOUCH_SERVICE, UPDATE_SERVICE, and SERIAL_SERVICE. WiFi variants additionally enable WIFI_SERVICE, MDNS_SERVICE, and SOCKET_CLIENT_SERVICE.

Transport policy: Per cmake/sanity_check.cmake, WEBUI_SERVER, SSDP_SERVICE, and WS_SERVER_SERVICE are disabled when SOCKET_CLIENT_SERVICE is ON. See feature_resource_matrix.md for the full compatibility matrix.


Comparison with Sibling Board (esp32_3248s035r)

Section titled “Comparison with Sibling Board (esp32_3248s035r)”
Aspectesp32_3248s035cesp32_3248s035r
Touch controllerGT911 (capacitive, I2C)XPT2046 (resistive, SPI)
Touch calibrationAuto-detected by GT911Manual 4-point software calibration
BSP touch inittouch_gt911_configure()touch_xpt2046_configure() + touch_calibrate()
Factory touch driverThin wrapper over shared touch_gt911Standalone read_reg12() + calibrate()
Custom bootloaderNoneNone
Physical controlsNone (GPIO_NUM_NC)None (GPIO_NUM_NC)
Display driverST7796 SPI (same)ST7796 SPI (same)
Orientation fixmirror-Y via esp_lcd_panel_mirror()Same panel quirk, same fix

Three virtual buttons are rendered at the bottom of the 320×480 screen. touch_hint_hit_test() divides the screen width into thirds: left = Up, center = Down, right = OK. Visual press feedback (draw_button_hint_pressed()) and a buzzer beep (no-op on this board) are triggered before dispatch_button() to give tactile-like confirmation. The encoder and hardware button loops are still polled but return immediately with no-ops.

Factory/main/st7796.c reimplements the display driver over the raw SPI master driver without depending on esp_lcd, esp3d_log, or LVGL. This keeps the factory partition self-contained and minimal.

The ST7796 panel requires a mirror-Y correction not expressible via the shared driver’s DISPLAY_ORIENTATION enum. board_init() calls esp_lcd_panel_mirror(handle, false, true) after st7796_spi_configure() as a board-specific one-off, leaving the shared driver unchanged for all other boards.

The backup offset 0xB000 and magic word 0xAA55AA55 at 0xB040 must match the values in the main firmware’s esp444.cpp exactly. Both files contain warnings about this coupling.


TopicFile
Hardware schematicspibot-cnc-pendant-hardware-documentation.md
Display driver architecturedisplay_drivers.md
ST7796 SPI driverbsp_display_drivers_spi.md
GT911 touch driverbsp_touch_controllers.md
UI resources partitiondevelopment.md
Theme palette tokenstheme_palette.md
Build guidelinesboard_build_guidelines.md
Memory constraintsesp32_memory_constraints.md
Feature / transport matrixfeature_resource_matrix.md
Sibling (resistive touch)esp32_3248s035r.md
Logging guideesp3d_log_guide.md