- ESP32 (standard) - Full PlatformIO support
- Use environment:
esp32dev
PlatformIO currently lacks precompiled packages for ESP32-C6 on macOS ARM64 (Apple Silicon).
Workarounds for ESP32-C6:
- Use Docker with x64 emulation (recommended for local development)
- Use CI/CD on Linux x64 (recommended for production)
- Use a Linux or Windows x64 machine
- Use ESP-IDF framework (requires code changes)
platformio run -e esp32devplatformio run -e esp32dev -t uploadplatformio device monitor -b 115200If you want to build for ESP32-C6 on macOS ARM64, use Docker:
Download from: https://www.docker.com/products/docker-desktop
docker run --rm --platform linux/amd64 \
-v $(pwd):/project -w /project \
infinitecoding/platformio-core \
pio run -e esp32c6After building in Docker, copy the firmware and upload:
# Copy firmware from Docker build
cp .pio/build/esp32c6/firmware.bin ./firmware_c6.bin
# Upload using esptool (install: pip install esptool)
esptool.py --chip esp32c6 --port /dev/cu.usbserial-* write_flash 0x0 firmware_c6.binThe project is designed to continue running even when:
- Display is not connected
- Display fails to initialize
- Display hardware is faulty
When display is not detected:
- System logs to Serial:
"Display not detected — continuing without display." - All display operations become safe no-ops
- Core functionality (baud detection, SD logging, testing) continues normally
Edit include/config.h to match your hardware:
// Serial Sniffer Pins
#define RX_PIN 4
#define TX_PIN 5
// Display Pins (TFT)
#define TFT_CS 10
#define TFT_DC 8
#define TFT_RST -1
#define TFT_MOSI 11
#define TFT_SCK 12
#define TFT_MISO 13
// SD Card
#define SD_CS 9platformio run -e esp32devExpected: [SUCCESS] with compilation warnings (pin redefinition) - these are safe to ignore.
platformio run -e esp32dev -t upload && platformio device monitor -b 115200=== USB-TTL SNIFFER STARTING ===
Display not detected — continuing without display.
System boot
Components initialized
Ready
- With display connected: Boot screen, status updates, state transitions shown on TFT
- Without display: All operations continue via Serial logging only (no bootloop)
Cause: No precompiled toolchain packages for RISC-V ESP32-C6 on ARM64.
Solutions:
- Use Docker method (see above)
- Use
esp32devenvironment for development/testing - Set up CI/CD on GitHub Actions (Linux x64) for C6 builds
Warnings like "TFT_MISO" redefined are expected and safe. They occur because:
config.hdefines pin mappingsTFT_eSPIlibrary has default definitions- Your definitions take precedence (correct behavior)
- Check baud rate:
platformio device monitor -b 115200 - Ensure USB-CDC is enabled (already set in
platformio.ini)
For automated ESP32-C6 builds, add .github/workflows/build.yml:
name: PlatformIO CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install PlatformIO
run: pip install platformio
- name: Build ESP32-C6
run: platformio run -e esp32c6
- name: Build ESP32
run: platformio run -e esp32dev- Test without display: Unplug display, flash, verify no bootloop via Serial
- Test with display: Connect display, verify boot screen and status updates
- Configure pins: Update
config.hfor your specific ESP32-C6 module pinout - Add TFT_eSPI config: Create
TFT_eSPI/User_Setup.hin library folder if needed
- PlatformIO Docs: https://docs.platformio.org/
- ESP32-C6 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_en.pdf
- TFT_eSPI Config: https://github.com/Bodmer/TFT_eSPI