Skip to content

FYSETC WiFi Pro — Board Support Package (BSP)

FYSETC WiFi Pro — Board Support Package (BSP)

Section titled “FYSETC WiFi Pro — Board Support Package (BSP)”

The fysetc_wifi_pro_bsp module is the Board Support Package for the FYSETC WiFi Pro board. Unlike every other supported board in this project, the FYSETC WiFi Pro is a headless WiFi + SD bridge: it has no display, no touch screen, and no physical input controls. Its sole purpose is to give a CNC machine wireless connectivity by sharing the machine’s SD card slot over WiFi (WebUI, WebDAV, mDNS, SSDP).

Because there is no display hardware, this BSP is the smallest in the codebase — board_init() simply logs the board identity and returns ESP_OK. All the complexity lives in the hardware pin layout, the SD multiplexing scheme, and the WiFi-focused sdkconfig tuning.


PropertyValue
MCUESP32 (Xtensa LX6 dual-core, 240 MHz)
Flash4 MB (DIO, 80 MHz)
PSRAMNone
DisplayNone
TouchNone
Hardware inputNone (no buttons, encoder, potentiometer)
ConnectivityWiFi (STA + fallback), UART (console/serial)
StorageSD card via SPI (shared with CNC MCU)
Default hostnameFYSETC-WIFI-PRO
Board identifierFYSETC_WIFI_PRO
Versionv1.0

The FYSETC WiFi Pro sits between a CNC machine and the user’s WiFi network. It physically plugs into the CNC machine’s SD card socket and multiplexes the SPI SD bus between itself and the CNC MCU.

CNC Machine

FYSETC WiFi Pro (ESP32)

WiFi Network

HTTP

WebDAV

discovery

SPI MUX via GPIO26

SPI CS

UART

Browser / WebUI

WebDAV Client

mDNS / SSDP Discovery

WiFi Stack (STA)

HTTP / WebUI Server

WebDAV Service

mDNS + SSDP

SD Shared Service

(SPI MUX)

UART Serial

BSP: board_init()

CNC MCU

(Marlin / grbl / FluidNC ...)

SD Card

Application Services

Core Platform

fysetc_wifi_pro_bsp

logs identity

returns ESP_OK

sd_def.h config

serial_def.h config

board_init()

board_config.h: pins

tasks_def.h: tasks

sd_def.h: SD config

serial_def.h: UART config

esp3d_log

ESP3DX::begin()

ESP3DNetwork

(WiFi STA)

ESP3DHttpService

(WebUI + WebDAV)

ESP3DSD

(SPI shared)

ESP3DSerialClient

(UART0)

ESP3DmDNS + ESP3Dssdp

ESP3DUpdateService


boards/fysetc_wifi_pro/
├── board_config.cmake # CMake board selection & capability flags
├── flash_params.json # esptool flash parameters
├── partitions_4mb.csv # Custom partition table
├── sdkconfig.4mb.wifi # IDF sdkconfig defaults
├── build_scripts/
│ ├── build_one.py # Single-variant build entry point
│ ├── common.py # Shared build/check helpers
│ └── variants.py # Variant definitions (VARIANTS dict)
└── components/
└── bsp/
├── CMakeLists.txt # IDF component registration
├── board_init.h # Public API: board_init, board_get_name/version
├── board_init.c # Implementation (minimal: logs and returns)
├── board_config.h # GPIO assignments, UART, SD pin config
├── sd_def.h # esp3dSdConfig struct (SPI mode)
├── serial_def.h # esp3dSerialConfig extern declaration
└── tasks_def.h # FreeRTOS task sizes, priorities, cores

esp_err_t board_init(void); // Initialize board hardware
const char *board_get_name(void); // Returns "FYSETC WiFi Pro"
const char *board_get_version(void); // Returns "v1.0"

board_init() is the only mandatory entry point called by ESP3DX::begin(). On this board it is intentionally minimal: it logs the board name and version and returns ESP_OK immediately. There is no display, LVGL, touch, or hardware control subsystem to initialize.

Why so minimal? Every other board in this project initializes LVGL, its display driver, and a touch controller inside board_init(). The FYSETC WiFi Pro has none of those peripherals, so the function is a no-op beyond identification logging. All real initialization is handled by the application layer (ESP3DX::begin()).

board_init.h guards get_lvgl_display() and get_lvgl_lock() stubs behind the ESP3D_DISPLAY_FEATURE compile flag. That flag is always OFF for this board (forced in board_config.cmake), so these stubs are never compiled in production.


SymbolValueDescription
UART_TX_PINGPIO_NUM_1Transmit
UART_RX_PINGPIO_NUM_3Receive
UART_PORT_IDXUART_NUM_0Hardware UART port
UART_BAUD_RATE_BPS115200Default baud rate
UART_RX_BUFFER_SIZE512 bytesHardware RX ring buffer
UART_TX_BUFFER_SIZE0 (unbuffered)Writes are synchronous
UART_RX_FLUSH_TIMEOUT1500 msRX idle flush timeout
SymbolValueDescription
SD_MISO_PINGPIO_NUM_2SPI MISO (D0)
SD_MOSI_PINGPIO_NUM_15SPI MOSI (CMD)
SD_CLK_PINGPIO_NUM_14SPI Clock (CLK)
SD_CS_PINGPIO_NUM_26SPI Chip Select / MUX select line
SD_SPI_HOST_IDXSPI2_HOSTESP-IDF SPI host
SD_SPI_FREQ_HZ20 MHzSPI clock frequency
SD_MAX_TRANSFER_SIZE4096 bytesDMA transfer limit
SD_ALLOCATION_SIZE4096 bytesFatFS cluster allocation unit

The FYSETC WiFi Pro uses a software multiplexing scheme to share the SD card between the ESP32 and the CNC MCU. There is no discrete MUX IC — the CS line itself acts as the bus arbiter.

SymbolValueDescription
SD_SHARED_MUX_PINGPIO_NUM_26Same as CS — drives MUX select
SD_SHARED_MUX_ESP_VALUELOW (0)ESP32 owns the SD bus
SD_SHARED_MUX_IDLE_VALUEHIGH (1)CNC MCU owns the SD bus (ESP32 idles)
SD_SHARED_SWITCH_DELAY_MS10 msSettling delay after MUX switch
SD_WATCHDOG_MS300 000 msMax hold time before forced release
SD_CS_SENSE_PINGPIO_NUM_32Senses CNC MCU CS activity — LOW means MCU is busy
SD_CS_SENSE_ACTIVE_VALUELOW (0)Indicates MCU is actively driving the SD CS line
SD_POWER_PINGPIO_NUM_27SD card power control
SD_POWER_ACTIVE_VALUELOW (0)LOW = SD powered on
SD_SHARED_D1_PINGPIO_NUM_4SDIO D1 isolation (INPUT_PULLUP when MCU owns bus)
SD_SHARED_D2_PINGPIO_NUM_12SDIO D2 isolation (INPUT_PULLUP when MCU owns bus)

For the full shared SD arbitration state machine and ownership protocol, see shared_sd_mechanism_V2.0.md.


CNC MCUSD CardGPIO32 (CS Sense)GPIO26 (CS / MUX)ESP32 (WiFi Pro)CNC MCUSD CardGPIO32 (CS Sense)GPIO26 (CS / MUX)ESP32 (WiFi Pro)Idle state: MCU owns bus (GPIO26 HIGH)MCU may reclaim bus at any timeAssert CS LOW (starts SPI transaction)GPIO32 goes LOW, ESP detects MCU is busySPI transaction (read / write)Release CS HIGH (transaction done)GPIO32 goes HIGH, bus is freeSet GPIO26 LOW (ESP claims bus)SPI transaction (WebDAV read / write)Set GPIO26 HIGH (release bus)

This BSP is intentionally stripped compared to all other boards in the project. The table below contrasts it against a typical display board (e.g., pibot_pendant_v1_0_bsp):

BSP CapabilityFYSETC WiFi ProDisplay Boards (typical)
board_init()✓✓
init_lvgl()—✓
lvgl_flush_cb()—✓
notify_lvgl_flush_ready()—✓ (SPI display boards)
disp_on_vsync_event()—✓ (RGB display boards)
increase_lvgl_tick()—✓
init_touch_controller()—✓
touch_read_cb()—✓
button_read_cb()—✓ (pibot only)
encoder_read_cb()—✓ (pibot only)
potentiometer_read_cb()—✓ (pibot only)
control_event_t—✓
control_events_init()—✓
SD card (SPI, shared MUX)✓Optional (some boards)
Factory app—✓ (most boards)
Custom bootloader—✓ (pibot, cam boards)
TFT_UI_SERVICEOFF (forced)ON
TFT_TOUCH_SERVICEOFF (forced)ON
BUZZER_SERVICEOFF (forced)Optional
WIFI_SERVICEONOptional

The UI system, LVGL task, and display driver documentation are not applicable to this board. See screens_architecture.md and display_drivers.md for those systems.


CMake Board Selection (board_config.cmake)

Section titled “CMake Board Selection (board_config.cmake)”

When FYSETC_WIFI_PRO=ON is passed to CMake:

  • Target is locked to esp32.
  • MEMORY_4_MB=ON is required — any other memory size triggers a fatal CMake error.
  • TFT_UI_SERVICE, TFT_TOUCH_SERVICE, and BUZZER_SERVICE are force-set to OFF.
  • SD_CARD_SERVICE and SD_SHARED_SERVICE are force-set to ON.
  • All hardware input flags (HARDWARE_BUTTONS, HARDWARE_ENCODER, HARDWARE_SWITCH, HARDWARE_POTENTIOMETER) are set to OFF.
  • Compile-time defines: -DESP3D_HOSTNAME="FYSETC-WIFI-PRO", -DESP3D_FALLBACK_MODE="1".

IDF Component (components/bsp/CMakeLists.txt)

Section titled “IDF Component (components/bsp/CMakeLists.txt)”

The BSP component has minimal dependencies — no display drivers, no LVGL, no touch libraries:

Requires: esp_timer, esp3d_log, nvs_flash, driver
Sources: board_init.c

Build Variants (build_scripts/variants.py)

Section titled “Build Variants (build_scripts/variants.py)”

There is one production variant and no factory variant for this board:

Variant nameDescription
4mb_wifi_genericFull WiFi bridge: Serial + WiFi + mDNS + SSDP + WebUI + WebDAV + SD + OTA
Build output: build/fysetc_4mb_wifi_generic/

Features enabled in 4mb_wifi_generic:

FYSETC_WIFI_PRO=ON MEMORY_4_MB=ON TARGET_FW_NONE=ON
SERIAL_SERVICE=ON WIFI_SERVICE=ON
MDNS_SERVICE=ON SSDP_SERVICE=ON TIME_SERVICE=ON
WEB_SERVICES=ON WEBUI_SERVER=ON WEBDAV_SERVICES=ON
SD_CARD_SERVICE=ON SD_SHARED_SERVICE=ON
UPDATE_SERVICE=ON

TARGET_FW_NONE means the firmware does not parse CNC-specific responses (no position tracking, no GCode host state machine). The board acts purely as a transparent WiFi SD bridge with a WebUI. See gcode_host_architecture.md for when a CNC firmware target is active.

Terminal window
# Using the board build script (from repo root):
python boards/fysetc_wifi_pro/build_scripts/build_one.py 4mb_wifi_generic
# With options:
python boards/fysetc_wifi_pro/build_scripts/build_one.py 4mb_wifi_generic --clean
python boards/fysetc_wifi_pro/build_scripts/build_one.py 4mb_wifi_generic --check
# Or directly via idf.py from repo root:
idf.py -DFYSETC_WIFI_PRO=ON -DMEMORY_4_MB=ON \
-DTARGET_FW_NONE=ON -DWIFI_SERVICE=ON \
-DWEBUI_SERVER=ON -DWEBDAV_SERVICES=ON \
-DSD_CARD_SERVICE=ON -DSD_SHARED_SERVICE=ON \
build
idf.py flash monitor

The 4 MB flash uses a custom partition table. The bootloader is extended to 48 KB (partition table starts at offset 0xC000) to accommodate the IDF 5.x bootloader size:

NameTypeSubTypeOffsetSizePurpose
nvsdatanvs0x00D00012 KBESP3D settings (NVS)
otadatadataota0x0100008 KBOTA slot selection
app0appota_00x0200003 MBMain application
flashfsdataspiffs0x320000576 KBWebUI + config files (SPIFFS)
0x00000 ┌──────────────────────────────┐
│ Bootloader (48 KB) │
0x0C000 ├──────────────────────────────┤
│ Partition Table │
0x0D000 ├──────────────────────────────┤
│ nvs (12 KB) │
0x10000 ├──────────────────────────────┤
│ otadata (8 KB) │
0x20000 ├──────────────────────────────┤
│ │
│ app0 / ota_0 (3 MB) │
│ │
0x320000 ├──────────────────────────────┤
│ flashfs / SPIFFS (576 KB) │
0x400000 └──────────────────────────────┘

Important: CONFIG_PARTITION_TABLE_OFFSET=0xC000 must be set in sdkconfig. It is pre-configured in sdkconfig.4mb.wifi and applied automatically on a fresh build.


No LVGL task. This board runs no UI task. Both cores are fully available for networking and data processing.

TaskStackCorePriorityConfig symbol group
networkTask4 096 B00NETWORK_*
esp3d_serial_rx_task4 096 B010UART_*
esp3d_socket_rx_task4 096 B05ESP3D_SOCKET_*
esp3d_socket_client_rx8 192 B05ESP3D_SOCKET_CLIENT_*
esp3d_rendering_rx_task4 096 B15ESP3D_RENDERING_*
esp3d_gcode_host_task4 096 B114ESP3D_GCODE_HOST_*
streamTask8 192 B10STREAM_*
httpd (IDF internal)8 192 Bany—ESP3D_HTTP_STACK_SIZE
wifi_scan / server_scan4 096 Banyidle+1ephemeral, unpinned

Unpinned (ephemeral)

wifi_scan

4 KB, idle+1

server_scan

4 KB, idle+1

Core 1: Data Processing

rendering_rx_task

pri=5, 4 KB

gcode_host_task

pri=14, 4 KB

streamTask

pri=0, 8 KB

Core 0: Networking

networkTask

pri=0, 4 KB

serial_rx_task

pri=10, 4 KB

socket_rx_task

pri=5, 4 KB

socket_client_rx

pri=5, 8 KB

Stream chunk size scales with PSRAM. With no PSRAM on this board, STREAM_CHUNK_SIZE is 1024 bytes (see tasks_def.h).


SettingValueRationale
CONFIG_ESPTOOLPY_FLASHSIZE4MBBoard constraint
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240yMaximum CPU frequency for throughput
CONFIG_PARTITION_TABLE_OFFSET0xC000Accommodates 48 KB bootloader
CONFIG_SPIRAM (not set)—No PSRAM on this board
CONFIG_FATFS_LFN_STACKyLong filenames without heap allocation
CONFIG_FATFS_SECTOR_4096yModern SD card sector size
CONFIG_HTTPD_MAX_REQ_HDR_LEN1024WebUI needs large request headers
CONFIG_HTTPD_WS_SUPPORTyWebSocket support in httpd
CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM5Static WiFi buffers — reduces heap fragmentation
CONFIG_ESP_WIFI_STATIC_TX_BUFFERyStatic TX buffers
CONFIG_SPI_MASTER_ISR_IN_IRAMySD SPI ISR survives WiFi cache pressure
CONFIG_UART_ISR_IN_IRAMyUART ISR survives flash cache misses
CONFIG_COMPILER_CXX_EXCEPTIONSyRequired for std::bad_alloc catch
CONFIG_ESP_GDBSTUB_ENABLEDyGDB remote debugging support

For heap fragmentation implications of static WiFi buffers see esp32_memory_constraints.md.


SD Shared Service Configuration (sd_def.h)

Section titled “SD Shared Service Configuration (sd_def.h)”

The sd_def.h header defines the esp3dSdConfig struct consumed by ESP3DSD::begin():

esp3d_sd_config_t esp3dSdConfig = {
.interface_type = ESP3D_SD_INTERFACE_SPI,
.detect_pin = GPIO_NUM_NC, // no hardware card-detect pin
.detect_value = 0,
.freq = 20000000, // 20 MHz SPI clock
.spi = {
.mosi_pin = GPIO_NUM_15,
.miso_pin = GPIO_NUM_2,
.clk_pin = GPIO_NUM_14,
.cs_pin = GPIO_NUM_26,
.host = SPI2_HOST,
.speed_divider = 1,
.max_transfer_sz = 4096,
.allocation_size = 4096,
}
};

The shared SD arbitration logic (CS sense on GPIO32, power control on GPIO27, D1/D2 isolation on GPIO4/GPIO12) is handled by the SD Shared Service layer above the BSP. The BSP does not call any arbitration functions directly. See shared_sd_mechanism_V2.0.md for the full ownership protocol.


{
"chip": "esp32",
"flash_mode": "dio",
"flash_freq": "80m",
"before": "default_reset",
"after": "hard_reset"
}

Used by build_one.py when invoking esptool.py. DIO mode is required for this classic ESP32 (not ESP32-S3, which uses QIO).


app_main()

main/main.cpp

ESP3DX::begin()

board_init()

boards/fysetc_wifi_pro/components/bsp/board_init.c

esp3d_log: FYSETC WiFi Pro v1.0

Headless WiFi+SD board

return ESP_OK

ESP3DSettings::begin()

NVS init

ESP3DValues::begin()

Observable system init

ESP3DNetwork::begin()

WiFi STA start

Network services start

mDNS / SSDP / HTTP+WebUI / WebDAV / SD / OTA

ESP3DSerialClient::begin()

UART0 for CNC serial link

The BSP’s responsibility ends at step E. Everything after is driven by the application core (ESP3DX). This is by design: a headless board has no display hardware to set up, and all other services (SD, UART, WiFi) initialize themselves from the configuration structs defined in the BSP header files.


DocumentTopic
shared_sd_mechanism_V2.0.mdSD bus arbitration protocol between ESP32 and CNC MCU
feature_resource_matrix.mdFeature compatibility, WiFi/CNC transport usage model
features.mdFull hardware/connectivity/services x SKU matrix
esp32_memory_constraints.mdHeap fragmentation, WiFi RAM budget, static buffer strategy
board_build_guidelines.mdHow to add or modify board BSPs
connection_management.mdTransport lifecycle and connection status system
gcode_host_architecture.mdGCode host (not active in TARGET_FW_NONE mode)
display_drivers.mdDisplay driver architecture (not applicable to this board)
screens_architecture.mdUI screen system (not applicable to this board)