From 3cf70d2f7150cfb15462ada4c923c5722beb1f64 Mon Sep 17 00:00:00 2001 From: tyeth Date: Thu, 24 Jul 2025 18:52:20 +0100 Subject: [PATCH 1/6] Add distinct entry for DFRobot C3 --- .github/workflows/build-clang-doxy.yml | 4 ++-- boards.local.txt | 6 ++++++ platformio.ini | 2 +- src/Wippersnapper_Boards.h | 7 ++++++- 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 boards.local.txt diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index 9095bfe82..bf6adc604 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -395,7 +395,7 @@ jobs: - uses: actions/checkout@v4 with: repository: adafruit/ci-arduino - ref: ci-wippersnapper + ref: ci-wippersnapper-boards-local-txt path: ci - name: Checkout Board Definitions uses: actions/checkout@v4 @@ -441,7 +441,7 @@ jobs: run: | pip install esptool - name: build ESP32 platforms - run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 + run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --boards-local-txt - name: Check artifacts run: | ls examples/Wippersnapper_demo/build/* diff --git a/boards.local.txt b/boards.local.txt new file mode 100644 index 000000000..ceecb5580 --- /dev/null +++ b/boards.local.txt @@ -0,0 +1,6 @@ +# This is to allow providing extra defines like WS_MY_BOARD_NAME for any boards using generic module board definitions. +# e.g. See if the board.txt already has extra defines anywhere, or only the basic empty board.defines= +# so for example this existing one dfrobot_romeo_esp32s3.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM +# then add a replacement entry with the existing plus new -DWS_MY_BOARD_NAME define. + +dfrobot_beetle_esp32c3.build.defines=-DWS_DFROBOT_BEETLE_ESP32C3 \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 8ac09ee84..56747d796 100644 --- a/platformio.ini +++ b/platformio.ini @@ -539,7 +539,7 @@ board = 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 +build_flags = -DARDUINO_ESP32C3_DEV -DWS_DFROBOT_BEETLE_ESP32C3 board_build.filesystem = littlefs board_build.partitions = min_spiffs.csv diff --git a/src/Wippersnapper_Boards.h b/src/Wippersnapper_Boards.h index 642513e2c..8b0324f92 100644 --- a/src/Wippersnapper_Boards.h +++ b/src/Wippersnapper_Boards.h @@ -186,7 +186,7 @@ #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_ESP32C3_DEV) +#elif defined(WS_DFROBOT_BEETLE_ESP32C3) // Note: this board reuses a generic preprocessor define // espressif/arduino-esp32@fcd4799c6de6eb5a5a8eba94818adf770238ecc0 // rather than creating one unique to the device. @@ -194,6 +194,11 @@ #define USE_LITTLEFS #define USE_STATUS_LED #define STATUS_LED_PIN LED_BUILTIN +#elif defined(ARDUINO_ESP32C3_DEV) +#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 From 93807eacd6b1fbfdafdd9454cb9209f2ee99e8f1 Mon Sep 17 00:00:00 2001 From: tyeth Date: Thu, 24 Jul 2025 18:53:04 +0100 Subject: [PATCH 2/6] WIP: test broken board name for dev c3 --- src/Wippersnapper_Boards.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Wippersnapper_Boards.h b/src/Wippersnapper_Boards.h index 8b0324f92..6f554f4c1 100644 --- a/src/Wippersnapper_Boards.h +++ b/src/Wippersnapper_Boards.h @@ -195,7 +195,7 @@ #define USE_STATUS_LED #define STATUS_LED_PIN LED_BUILTIN #elif defined(ARDUINO_ESP32C3_DEV) -#define BOARD_ID "dfrobot-beetle-esp32c3" +#define BOARD_ID "dfrobotbeetle-esp32c3" #define USE_LITTLEFS #define USE_STATUS_LED #define STATUS_LED_PIN LED_BUILTIN From 5e94bfda8f6db7b0f7d2bdc1dbf7d7f9e6d9181b Mon Sep 17 00:00:00 2001 From: tyeth Date: Thu, 24 Jul 2025 20:37:38 +0100 Subject: [PATCH 3/6] Improve docs in boards.local.txt --- boards.local.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/boards.local.txt b/boards.local.txt index ceecb5580..4a53ac72e 100644 --- a/boards.local.txt +++ b/boards.local.txt @@ -1,6 +1,13 @@ # This is to allow providing extra defines like WS_MY_BOARD_NAME for any boards using generic module board definitions. -# e.g. See if the board.txt already has extra defines anywhere, or only the basic empty board.defines= +# Instead of the MY_BOARD_NAME suffix, it should match the unique Board ID in Wippersnapper_Boards.h, but +# uppercase with underscores for dashes. e.g. "dfrobot-beetle-esp32c3" becomes WS_DFROBOT_BEETLE_ESP32C3 with -D for define. +# +# See if the board.txt already has extra board.defines= in any menu entries, or only the basic empty board.defines= # so for example this existing one dfrobot_romeo_esp32s3.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -# then add a replacement entry with the existing plus new -DWS_MY_BOARD_NAME define. +# then you would add a replacement entry with the existing plus additionally the new -DWS_UNIQUE_BOARD_NAME define: +# dfrobot_romeo_esp32s3.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -DWS_DFROBOT_UNIQUE_BOARD_ID +# +# Do the same for the board entry in the platformio.ini file: build_flags = -DWS_YOUR_UNIQUE_BOARD_ID +# DF Robot ESP32-C3 shares define with Espressif ESP32_C3 Devkit/Module, so needs unique define: dfrobot_beetle_esp32c3.build.defines=-DWS_DFROBOT_BEETLE_ESP32C3 \ No newline at end of file From 3cba79f86dcec419889511fe6249d3bc590a31b2 Mon Sep 17 00:00:00 2001 From: tyeth Date: Thu, 24 Jul 2025 21:01:04 +0100 Subject: [PATCH 4/6] WIP: Break board ID for df robot c3, fix esp32c3_dev --- src/Wippersnapper_Boards.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Wippersnapper_Boards.h b/src/Wippersnapper_Boards.h index 6f554f4c1..f6edc2f9f 100644 --- a/src/Wippersnapper_Boards.h +++ b/src/Wippersnapper_Boards.h @@ -190,12 +190,12 @@ // 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 BOARD_ID "dfrobotbeetle-esp32c3" #define USE_LITTLEFS #define USE_STATUS_LED #define STATUS_LED_PIN LED_BUILTIN #elif defined(ARDUINO_ESP32C3_DEV) -#define BOARD_ID "dfrobotbeetle-esp32c3" +#define BOARD_ID "dfrobot-beetle-esp32c3" #define USE_LITTLEFS #define USE_STATUS_LED #define STATUS_LED_PIN LED_BUILTIN From defabdc26f78fdfa31128ee07f4a434af16f2213 Mon Sep 17 00:00:00 2001 From: tyeth Date: Thu, 24 Jul 2025 21:13:46 +0100 Subject: [PATCH 5/6] Fix robot assuming boards.local.txt works --- src/Wippersnapper_Boards.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Wippersnapper_Boards.h b/src/Wippersnapper_Boards.h index f6edc2f9f..8b0324f92 100644 --- a/src/Wippersnapper_Boards.h +++ b/src/Wippersnapper_Boards.h @@ -190,7 +190,7 @@ // Note: this board reuses a generic preprocessor define // espressif/arduino-esp32@fcd4799c6de6eb5a5a8eba94818adf770238ecc0 // rather than creating one unique to the device. -#define BOARD_ID "dfrobotbeetle-esp32c3" +#define BOARD_ID "dfrobot-beetle-esp32c3" #define USE_LITTLEFS #define USE_STATUS_LED #define STATUS_LED_PIN LED_BUILTIN From 8afd334f1012eb1f36bf9ad9770ff6f85c4b495d Mon Sep 17 00:00:00 2001 From: tyeth Date: Thu, 24 Jul 2025 21:28:57 +0100 Subject: [PATCH 6/6] Leave note for future --- boards.local.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boards.local.txt b/boards.local.txt index 4a53ac72e..5d13334ab 100644 --- a/boards.local.txt +++ b/boards.local.txt @@ -8,6 +8,10 @@ # dfrobot_romeo_esp32s3.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -DWS_DFROBOT_UNIQUE_BOARD_ID # # Do the same for the board entry in the platformio.ini file: build_flags = -DWS_YOUR_UNIQUE_BOARD_ID +# +# Note: If needed we can do a version of this file for each board build target in case boards don't have a +# unique definition in boards.txt to add an override. Then in CI pass filename with --boards-local-txt file + # DF Robot ESP32-C3 shares define with Espressif ESP32_C3 Devkit/Module, so needs unique define: dfrobot_beetle_esp32c3.build.defines=-DWS_DFROBOT_BEETLE_ESP32C3 \ No newline at end of file