From 2091034df015d59fce9dd9c49df43c03471966f1 Mon Sep 17 00:00:00 2001 From: KB Sriram Date: Sun, 13 Jul 2025 16:18:47 -0700 Subject: [PATCH 1/3] Support for DFRobot Beetle ESP32C3. See https://github.com/adafruit/Wippersnapper_Boards/issues/195 --- platformio.ini | 10 +++++++++- src/Wippersnapper_Boards.h | 5 +++++ src/provisioning/littlefs/WipperSnapper_LittleFS.cpp | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index a81b8c299..8f6506753 100644 --- a/platformio.ini +++ b/platformio.ini @@ -6,7 +6,7 @@ ; PlatformIO Defaults [platformio] description = "Adafruit.IO WipperSnapper Firmware" -default_envs = adafruit_feather_esp32s3_tft, adafruit_magtag29_esp32s2, adafruit_feather_esp32s3, featheresp32s2, adafruit_feather_esp32s2_reversetft, adafruit_metro_esp32s2, adafruit_qtpy_esp32s2, adafruit_feather_esp32s3_reversetft, adafruit_feather_esp32s3_nopsram, adafruit_feather_esp32s2_tft, adafruit_qtpy_esp32, adafruit_qtpy_esp32c3, featheresp32, adafruit_qtpy_esp32s3_nopsram, featheresp32v2, huzzah, adafruit_pyportal_m4, adafruit_pyportal_m4_titano +default_envs = adafruit_feather_esp32s3_tft, adafruit_magtag29_esp32s2, adafruit_feather_esp32s3, featheresp32s2, adafruit_feather_esp32s2_reversetft, adafruit_metro_esp32s2, adafruit_qtpy_esp32s2, adafruit_feather_esp32s3_reversetft, adafruit_feather_esp32s3_nopsram, adafruit_feather_esp32s2_tft, adafruit_qtpy_esp32, adafruit_qtpy_esp32c3, featheresp32, adafruit_qtpy_esp32s3_nopsram, featheresp32v2, huzzah, adafruit_pyportal_m4, adafruit_pyportal_m4_titano, dfrobot_beetle_esp32c3 ; Common Build Environment @@ -532,6 +532,14 @@ build_flags = -DUSE_TINYUSB ; extra_scripts = pre:rename_usb_config.py upload_port = /dev/cu.usbmodem1201 +; DFRobot Beetle ESP32-C3 +[env:dfrobot_beetle_esp32c3] +extends = common:esp32 +board = dfrobot_beetle_esp32c3 +build_flags = -DARDUINO_DFROBOT_BEETLE_ESP32C3 +board_build.filesystem = littlefs +board_build.partitions = min_spiffs.csv + [env:raspberypi_picow] extends = common:rp2040 diff --git a/src/Wippersnapper_Boards.h b/src/Wippersnapper_Boards.h index 13bbd00a7..e419ce029 100644 --- a/src/Wippersnapper_Boards.h +++ b/src/Wippersnapper_Boards.h @@ -186,6 +186,11 @@ #define STATUS_NEOPIXEL_PIN PIN_NEOPIXEL #define STATUS_NEOPIXEL_NUM 1 #define USE_PSRAM ///< Board has PSRAM, use it for dynamic memory allocation +#elif defined(ARDUINO_DFROBOT_BEETLE_ESP32C3) +#define BOARD_ID "dfrobot-beetle-esp32c3" +#define USE_LITTLEFS +#define USE_STATUS_LED +#define STATUS_LED_PIN LED_BUILTIN #elif defined(ARDUINO_SPARKLEMOTIONMINI_ESP32) #define BOARD_ID "sparklemotionmini-esp32" #define USE_LITTLEFS diff --git a/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp b/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp index 8d40de11d..f70fa2493 100644 --- a/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp +++ b/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp @@ -17,6 +17,7 @@ defined(ARDUINO_ADAFRUIT_ITSYBITSY_ESP32) || \ defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2) || \ defined(ARDUINO_ADAFRUIT_QTPY_ESP32_PICO) || \ + defined(ARDUINO_DFROBOT_BEETLE_ESP32C3) || \ defined(ARDUINO_SPARKLEMOTIONMINI_ESP32) || \ defined(ARDUINO_SPARKLEMOTIONSTICK_ESP32) || \ defined(ARDUINO_ADAFRUIT_QTPY_ESP32C3) || \ @@ -170,4 +171,4 @@ void WipperSnapper_LittleFS::fsHalt(String msg) { } } -#endif \ No newline at end of file +#endif From 0489a411303d9e6cb4e7c88e338a9ddc0e326502 Mon Sep 17 00:00:00 2001 From: KB Sriram Date: Mon, 14 Jul 2025 14:23:16 -0700 Subject: [PATCH 2/3] Update CI flows to build DFRobot Beetle esp32c3. --- .github/workflows/build-clang-doxy.yml | 3 +++ examples/Wippersnapper_demo/.dfrobot_beetle_esp32c3.generate | 0 examples/wippersnapper_debug/.dfrobot_beetle_esp32c3.test.skip | 0 3 files changed, 3 insertions(+) create mode 100644 examples/Wippersnapper_demo/.dfrobot_beetle_esp32c3.generate create mode 100644 examples/wippersnapper_debug/.dfrobot_beetle_esp32c3.test.skip diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index e5be7e9cd..041afecea 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -318,11 +318,14 @@ jobs: "sparklemotionstick_esp32", "feather_esp32_v2", "itsybitsy_esp32", + "dfrobot_beetle_esp32c3", "wippersnapper_qtpy_esp32c3", "wippersnapper_feather_esp32c6" ] include: - offset: "0x1000" + - offset: "0x0" + arduino-platform: "dfrobot_beetle_esp32c3" - offset: "0x0" arduino-platform: "wippersnapper_qtpy_esp32c3" - offset: "0x0" diff --git a/examples/Wippersnapper_demo/.dfrobot_beetle_esp32c3.generate b/examples/Wippersnapper_demo/.dfrobot_beetle_esp32c3.generate new file mode 100644 index 000000000..e69de29bb diff --git a/examples/wippersnapper_debug/.dfrobot_beetle_esp32c3.test.skip b/examples/wippersnapper_debug/.dfrobot_beetle_esp32c3.test.skip new file mode 100644 index 000000000..e69de29bb From 002cdfd6dacae30e7ce4fc588c5ba913c854b2df Mon Sep 17 00:00:00 2001 From: KB Sriram Date: Tue, 15 Jul 2025 06:46:37 -0700 Subject: [PATCH 3/3] Update preprocessor defines for arduino builds. --- platformio.ini | 5 ++++- src/Wippersnapper_Boards.h | 5 ++++- src/provisioning/littlefs/WipperSnapper_LittleFS.cpp | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index 8f6506753..8ac09ee84 100644 --- a/platformio.ini +++ b/platformio.ini @@ -536,7 +536,10 @@ upload_port = /dev/cu.usbmodem1201 [env:dfrobot_beetle_esp32c3] extends = common:esp32 board = dfrobot_beetle_esp32c3 -build_flags = -DARDUINO_DFROBOT_BEETLE_ESP32C3 +; Note: this board reuses a generic preprocessor define +; espressif/arduino-esp32@fcd4799c6de6eb5a5a8eba94818adf770238ecc0 +; rather than creating one unique to the device. +build_flags = -DARDUINO_ESP32C3_DEV board_build.filesystem = littlefs board_build.partitions = min_spiffs.csv diff --git a/src/Wippersnapper_Boards.h b/src/Wippersnapper_Boards.h index e419ce029..5c274b36a 100644 --- a/src/Wippersnapper_Boards.h +++ b/src/Wippersnapper_Boards.h @@ -186,7 +186,10 @@ #define STATUS_NEOPIXEL_PIN PIN_NEOPIXEL #define STATUS_NEOPIXEL_NUM 1 #define USE_PSRAM ///< Board has PSRAM, use it for dynamic memory allocation -#elif defined(ARDUINO_DFROBOT_BEETLE_ESP32C3) +#elif defined(ARDUINO_ESP32C3_DEV) +// Note: this board reuses a generic preprocessor define +// espressif/arduino-esp32@fcd4799c6de6eb5a5a8eba94818adf770238ecc0 +// rather than creating one unique to the device. #define BOARD_ID "dfrobot-beetle-esp32c3" #define USE_LITTLEFS #define USE_STATUS_LED diff --git a/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp b/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp index f70fa2493..0c6574861 100644 --- a/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp +++ b/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp @@ -17,7 +17,7 @@ defined(ARDUINO_ADAFRUIT_ITSYBITSY_ESP32) || \ defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2) || \ defined(ARDUINO_ADAFRUIT_QTPY_ESP32_PICO) || \ - defined(ARDUINO_DFROBOT_BEETLE_ESP32C3) || \ + defined(ARDUINO_ESP32C3_DEV) || \ defined(ARDUINO_SPARKLEMOTIONMINI_ESP32) || \ defined(ARDUINO_SPARKLEMOTIONSTICK_ESP32) || \ defined(ARDUINO_ADAFRUIT_QTPY_ESP32C3) || \