From 6304d73d88e9841e6177e2b21dccd99c75f4cdbd Mon Sep 17 00:00:00 2001 From: brentru Date: Tue, 12 Aug 2025 16:37:25 -0400 Subject: [PATCH 1/8] Fix platformio.ini build script for pico sdks, weird and hardcoded --- platformio.ini | 41 +++++++++++-------- src/Wippersnapper_Boards.h | 7 ++++ src/provisioning/tinyusb/Wippersnapper_FS.cpp | 4 +- 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/platformio.ini b/platformio.ini index 3930fea8e..c68ffdad6 100644 --- a/platformio.ini +++ b/platformio.ini @@ -126,19 +126,14 @@ lib_compat_mode = strict lib_archive = no ; debug timer issues see https://community.platformio.org/t/choose-usb-stack-as-tiny-usb/22451/5 lib_ignore = OneWire, USBHost -[common:rp2040] +; Common build environment for Arduino-Pico platforms +[common:arduinopico] platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop -; platform_packages = -; framework-arduinopico @ symlink:///Users/tyeth/Projects/arduino-pico -; framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#master -board = rpipicow +platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git framework = arduino board_build.core = earlephilhower -board_build.filesystem_size = 0.5m -build_flags = -DUSE_TINYUSB -; Once https://github.com/platformio/platformio-core > 6.1.11 these can be removed lib_ignore = WiFiNINA, WiFi101, Adafruit Zero DMA Library, OneWire -lib_compat_mode = soft ; can be strict once pio detects SleepyDog on RP2040 +lib_compat_mode = soft ; can be stricter once pio detects SleepyDog on RP2040 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Individual Board Definitions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -546,16 +541,18 @@ board_build.partitions = min_spiffs.csv [env:raspberypi_picow] -extends = common:rp2040 +extends = common:arduinopico +board = rpipicow [env:raspberypi_picow_debug_port_only] -extends = common:rp2040 +extends = common:arduinopico +board = rpipicow build_flags = -DUSE_TINYUSB -DDEBUG_RP2040_PORT=Serial [env:raspberypi_picow_debug] -extends = common:rp2040 +extends = common:arduinopico ; platform = https://github.com/maxgerhardt/platform-raspberrypi.git ; platform_packages = ; framework-arduinopico @ symlink:///Users/tyeth/Projects/arduino-pico @@ -597,7 +594,8 @@ build_flags = [env:raspberypi_pico2w] -extends = common:rp2040 +extends = common:arduinopico +boards = rpipico2w platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git @@ -610,11 +608,7 @@ build_flags = ; -DPICO_CYW43_SUPPORTED=1 [env:raspberypi_pico2w_debug] -extends = common:rp2040 -platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop -platform_packages = - framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git -; ; framework-arduinopico @ symlink:///Users/tyeth/Projects/arduino-pico +extends = common:arduinopico board = rpipico2w build_type = debug framework = arduino @@ -654,3 +648,14 @@ build_flags = ; ; No USB stack ; build_flags = -DPIO_FRAMEWORK_ARDUINO_NO_USB ; -DPIO_FRAMEWORK_ARDUINO_ENABLE_IPV6 + +[env:adafruit_fruitjam] +platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop +platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git +board = adafruit_fruitjam +framework = arduino +board_build.core = earlephilhower +board_build.filesystem_size = 0.5m +lib_ignore = WiFiNINA, WiFi101, Adafruit Zero DMA Library, OneWire +lib_compat_mode = soft +build_flags = -DUSE_TINYUSB \ No newline at end of file diff --git a/src/Wippersnapper_Boards.h b/src/Wippersnapper_Boards.h index 642513e2c..4f61b71a5 100644 --- a/src/Wippersnapper_Boards.h +++ b/src/Wippersnapper_Boards.h @@ -223,6 +223,13 @@ #define USE_TINYUSB #define USE_STATUS_LED #define STATUS_LED_PIN LED_BUILTIN +#elif defined(ADAFRUIT_FRUITJAM_RP2350) +#define BOARD_ID "fruitjam" +#define USE_TINYUSB +#define USE_STATUS_NEOPIXEL +#define STATUS_NEOPIXEL_PIN PIN_NEOPIXEL +#define STATUS_NEOPIXEL_NUM 5 +#define USE_PSRAM #else #warning "Board type not identified within Wippersnapper_Boards.h!" #endif diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index 3981c72a6..658d8df46 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -28,7 +28,9 @@ defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3_REVTFT) || \ defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2_REVTFT) || \ defined(ARDUINO_ADAFRUIT_QTPY_ESP32S3_N4R2) || \ - defined(ARDUINO_XIAO_ESP32S3) + defined(ARDUINO_XIAO_ESP32S3) || \ + defined(ADAFRUIT_FRUITJAM_RP2350) + #include "Wippersnapper_FS.h" #include "print_dependencies.h" // On-board external flash (QSPI or SPI) macros should already From 0b6964b131304edc1293723c4376ac3706c996bc Mon Sep 17 00:00:00 2001 From: brentru Date: Tue, 12 Aug 2025 16:46:03 -0400 Subject: [PATCH 2/8] Fix for rp2350/rp2040 to use pstolzar --- platformio.ini | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index c68ffdad6..0d120339d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -90,6 +90,8 @@ lib_deps = https://github.com/tyeth/omron-devhub_d6t-arduino.git https://github.com/pstolarz/OneWireNg.git https://github.com/milesburton/Arduino-Temperature-Control-Library.git + ; UNCOMMENT FOR RP2040/RP2350 BOARDS + ; https://github.com/pstolarz/Arduino-Temperature-Control-Library.git https://github.com/Sensirion/arduino-sht.git https://github.com/Sensirion/arduino-i2c-scd4x.git https://github.com/Sensirion/arduino-i2c-sen5x.git @@ -543,6 +545,8 @@ board_build.partitions = min_spiffs.csv [env:raspberypi_picow] extends = common:arduinopico board = rpipicow +build_flags = + -DUSE_TINYUSB [env:raspberypi_picow_debug_port_only] extends = common:arduinopico @@ -595,7 +599,6 @@ build_flags = [env:raspberypi_pico2w] extends = common:arduinopico -boards = rpipico2w platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git @@ -656,6 +659,6 @@ board = adafruit_fruitjam framework = arduino board_build.core = earlephilhower board_build.filesystem_size = 0.5m -lib_ignore = WiFiNINA, WiFi101, Adafruit Zero DMA Library, OneWire +lib_ignore = WiFiNINA, WiFi101, Adafruit Zero DMA Library lib_compat_mode = soft build_flags = -DUSE_TINYUSB \ No newline at end of file From 74e2f53aa7a28f689f37e8d87c14c42b4a2e7d92 Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 13 Aug 2025 12:49:29 -0400 Subject: [PATCH 3/8] Working on FruitJam --- src/Wippersnapper.h | 20 +++++++++++++------ src/Wippersnapper_Boards.h | 1 - src/Wippersnapper_Networking.h | 3 ++- .../Wippersnapper_AIRLIFT.h | 14 +++++++++---- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/Wippersnapper.h b/src/Wippersnapper.h index dc3152d01..d220d2f2e 100644 --- a/src/Wippersnapper.h +++ b/src/Wippersnapper.h @@ -47,16 +47,24 @@ // Define actual debug output functions when necessary. #ifdef WS_DEBUG #define WS_DEBUG_PRINT(...) \ - { WS_PRINTER.print(__VA_ARGS__); } ///< Prints debug output. + { \ + WS_PRINTER.print(__VA_ARGS__); \ + } ///< Prints debug output. #define WS_DEBUG_PRINTLN(...) \ - { WS_PRINTER.println(__VA_ARGS__); } ///< Prints line from debug output. + { \ + WS_PRINTER.println(__VA_ARGS__); \ + } ///< Prints line from debug output. #define WS_DEBUG_PRINTHEX(...) \ - { WS_PRINTER.print(__VA_ARGS__, HEX); } ///< Prints debug output. + { \ + WS_PRINTER.print(__VA_ARGS__, HEX); \ + } ///< Prints debug output. #else #define WS_DEBUG_PRINT(...) \ - {} ///< Prints debug output + { \ + } ///< Prints debug output #define WS_DEBUG_PRINTLN(...) \ - {} ///< Prints line from debug output. + { \ + } ///< Prints line from debug output. #endif #define WS_DELAY_WITH_WDT(timeout) \ @@ -142,7 +150,7 @@ #endif #define WS_VERSION \ - "1.0.0-beta.110" ///< WipperSnapper app. version (semver-formatted) + "1.0.0-beta.111" ///< WipperSnapper app. version (semver-formatted) // Reserved Adafruit IO MQTT topics #define TOPIC_IO_THROTTLE "/throttle" ///< Adafruit IO Throttle MQTT Topic diff --git a/src/Wippersnapper_Boards.h b/src/Wippersnapper_Boards.h index 4f61b71a5..c17598b75 100644 --- a/src/Wippersnapper_Boards.h +++ b/src/Wippersnapper_Boards.h @@ -229,7 +229,6 @@ #define USE_STATUS_NEOPIXEL #define STATUS_NEOPIXEL_PIN PIN_NEOPIXEL #define STATUS_NEOPIXEL_NUM 5 -#define USE_PSRAM #else #warning "Board type not identified within Wippersnapper_Boards.h!" #endif diff --git a/src/Wippersnapper_Networking.h b/src/Wippersnapper_Networking.h index cc8a65bfd..41ec1a607 100644 --- a/src/Wippersnapper_Networking.h +++ b/src/Wippersnapper_Networking.h @@ -23,7 +23,8 @@ #if defined(ADAFRUIT_METRO_M4_EXPRESS) || \ defined(ADAFRUIT_METRO_M4_AIRLIFT_LITE) || defined(ADAFRUIT_PYPORTAL) || \ - defined(ADAFRUIT_PYPORTAL_M4_TITANO) || defined(USE_AIRLIFT) + defined(ADAFRUIT_PYPORTAL_M4_TITANO) || defined(USE_AIRLIFT) || \ + defined(ADAFRUIT_FRUITJAM_RP2350) #include "network_interfaces/Wippersnapper_AIRLIFT.h" /** Nina-FW (adafruit fork) networking class */ typedef Wippersnapper_AIRLIFT Wippersnapper_WiFi; diff --git a/src/network_interfaces/Wippersnapper_AIRLIFT.h b/src/network_interfaces/Wippersnapper_AIRLIFT.h index a278d1fe1..e4bd548d5 100644 --- a/src/network_interfaces/Wippersnapper_AIRLIFT.h +++ b/src/network_interfaces/Wippersnapper_AIRLIFT.h @@ -32,7 +32,9 @@ #define AIRLIFT_CONNECT_TIMEOUT_MS 20000 /*!< Connection timeout (in ms) */ #define AIRLIFT_CONNECT_RETRY_DELAY_MS 200 /*!< delay time between retries. */ +#ifndef SPIWIFI #define SPIWIFI SPI /*!< Instance of SPI interface used by an AirLift. */ +#endif extern Wippersnapper WS; /****************************************************************************/ @@ -49,9 +51,13 @@ class Wippersnapper_AIRLIFT : public Wippersnapper { */ /**************************************************************************/ Wippersnapper_AIRLIFT() : Wippersnapper() { - _ssPin = SPIWIFI_SS; // 10; - _ackPin = SPIWIFI_ACK; // 7; - _rstPin = SPIWIFI_RESET; // 5; // should be 7 on PyPortals + _ssPin = SPIWIFI_SS; + _ackPin = SPIWIFI_ACK; +#ifdef ESP32_RESETN + _rstPin = ESP32_RESETN; // FruitJam +#else + _rstPin = SPIWIFI_RESET; +#endif // ESP32_RESETN #ifdef ESP32_GPIO0 _gpio0Pin = ESP32_GPIO0; #else @@ -236,7 +242,7 @@ class Wippersnapper_AIRLIFT : public Wippersnapper { */ /********************************************************/ void getMacAddr() { - uint8_t mac[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + byte mac[6] = {0}; WiFi.macAddress(mac); memcpy(WS._macAddr, mac, sizeof(mac)); } From 5088cb6c8b3a3a42979cacd3e124767be1266361 Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 13 Aug 2025 13:42:31 -0400 Subject: [PATCH 4/8] Add AirLift --- platformio.ini | 11 ++++++----- src/network_interfaces/Wippersnapper_AIRLIFT.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/platformio.ini b/platformio.ini index 0d120339d..aee3f0c18 100644 --- a/platformio.ini +++ b/platformio.ini @@ -89,9 +89,10 @@ lib_deps = adafruit/Adafruit SSD1306 https://github.com/tyeth/omron-devhub_d6t-arduino.git https://github.com/pstolarz/OneWireNg.git - https://github.com/milesburton/Arduino-Temperature-Control-Library.git - ; UNCOMMENT FOR RP2040/RP2350 BOARDS - ; https://github.com/pstolarz/Arduino-Temperature-Control-Library.git + ; COMMENT OUT FOR RP2040/RP2350 BOARDS + ; https://github.com/milesburton/Arduino-Temperature-Control-Library.git + ; AND UNCOMMENT FOR RP2040/RP2350 BOARDS + https://github.com/pstolarz/Arduino-Temperature-Control-Library.git https://github.com/Sensirion/arduino-sht.git https://github.com/Sensirion/arduino-i2c-scd4x.git https://github.com/Sensirion/arduino-i2c-sen5x.git @@ -659,6 +660,6 @@ board = adafruit_fruitjam framework = arduino board_build.core = earlephilhower board_build.filesystem_size = 0.5m -lib_ignore = WiFiNINA, WiFi101, Adafruit Zero DMA Library +lib_ignore = WiFi, WiFi101, Adafruit Zero DMA Library lib_compat_mode = soft -build_flags = -DUSE_TINYUSB \ No newline at end of file +build_flags = -DUSE_TINYUSB -DADAFRUIT_FRUITJAM_RP2350 \ No newline at end of file diff --git a/src/network_interfaces/Wippersnapper_AIRLIFT.h b/src/network_interfaces/Wippersnapper_AIRLIFT.h index e4bd548d5..c62eaf7ad 100644 --- a/src/network_interfaces/Wippersnapper_AIRLIFT.h +++ b/src/network_interfaces/Wippersnapper_AIRLIFT.h @@ -11,7 +11,7 @@ * please support Adafruit and open-source hardware by purchasing * products from Adafruit! * - * Copyright (c) Brent Rubell 2020-2021 for Adafruit Industries. + * Copyright (c) Brent Rubell 2020-2025 for Adafruit Industries. * * MIT license, all text here must be included in any redistribution. * From 1cee8e8ca5f1f2842340825f47e43d77ba0d03a3 Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 13 Aug 2025 13:45:43 -0400 Subject: [PATCH 5/8] Add CI --- .github/workflows/build-clang-doxy.yml | 2 +- examples/Wippersnapper_demo/.fruit_jam_tinyusb.generate | 3 +++ examples/wippersnapper_debug/.fruit_jam_tinyusb.test.skip | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 examples/Wippersnapper_demo/.fruit_jam_tinyusb.generate create mode 100644 examples/wippersnapper_debug/.fruit_jam_tinyusb.test.skip diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index 4d6a46e5d..09b116d32 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -592,7 +592,7 @@ jobs: strategy: fail-fast: false matrix: - arduino-platform: ["picow_rp2040_tinyusb", "picow_rp2350_tinyusb"] + arduino-platform: ["picow_rp2040_tinyusb", "picow_rp2350_tinyusb", "fruit_jam_tinyusb"] steps: - name: "skip if unwanted" continue-on-error: true diff --git a/examples/Wippersnapper_demo/.fruit_jam_tinyusb.generate b/examples/Wippersnapper_demo/.fruit_jam_tinyusb.generate new file mode 100644 index 000000000..b28b04f64 --- /dev/null +++ b/examples/Wippersnapper_demo/.fruit_jam_tinyusb.generate @@ -0,0 +1,3 @@ + + + diff --git a/examples/wippersnapper_debug/.fruit_jam_tinyusb.test.skip b/examples/wippersnapper_debug/.fruit_jam_tinyusb.test.skip new file mode 100644 index 000000000..b28b04f64 --- /dev/null +++ b/examples/wippersnapper_debug/.fruit_jam_tinyusb.test.skip @@ -0,0 +1,3 @@ + + + From 80a6cdc6e0e7c9d22b3d96cf5676c717ffb16267 Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 13 Aug 2025 14:13:33 -0400 Subject: [PATCH 6/8] Add Arduino_ prefix in boards.h --- 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 c17598b75..9a09a9ff5 100644 --- a/src/Wippersnapper_Boards.h +++ b/src/Wippersnapper_Boards.h @@ -223,7 +223,7 @@ #define USE_TINYUSB #define USE_STATUS_LED #define STATUS_LED_PIN LED_BUILTIN -#elif defined(ADAFRUIT_FRUITJAM_RP2350) +#elif defined(ARDUINO_ADAFRUIT_FRUITJAM_RP2350) #define BOARD_ID "fruitjam" #define USE_TINYUSB #define USE_STATUS_NEOPIXEL From 98f045e3c774d34b9edbba196eb033f09f0b4a93 Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 13 Aug 2025 15:15:22 -0400 Subject: [PATCH 7/8] Addres @tyeth's review --- platformio.ini | 11 +++-------- src/Wippersnapper.h | 18 +++++------------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/platformio.ini b/platformio.ini index aee3f0c18..28f065116 100644 --- a/platformio.ini +++ b/platformio.ini @@ -90,9 +90,9 @@ lib_deps = https://github.com/tyeth/omron-devhub_d6t-arduino.git https://github.com/pstolarz/OneWireNg.git ; COMMENT OUT FOR RP2040/RP2350 BOARDS - ; https://github.com/milesburton/Arduino-Temperature-Control-Library.git + https://github.com/milesburton/Arduino-Temperature-Control-Library.git ; AND UNCOMMENT FOR RP2040/RP2350 BOARDS - https://github.com/pstolarz/Arduino-Temperature-Control-Library.git + ; https://github.com/pstolarz/Arduino-Temperature-Control-Library.git https://github.com/Sensirion/arduino-sht.git https://github.com/Sensirion/arduino-i2c-scd4x.git https://github.com/Sensirion/arduino-i2c-sen5x.git @@ -135,6 +135,7 @@ platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git framework = arduino board_build.core = earlephilhower +board_build.filesystem_size = 0.5m lib_ignore = WiFiNINA, WiFi101, Adafruit Zero DMA Library, OneWire lib_compat_mode = soft ; can be stricter once pio detects SleepyDog on RP2040 @@ -654,12 +655,6 @@ build_flags = ; -DPIO_FRAMEWORK_ARDUINO_ENABLE_IPV6 [env:adafruit_fruitjam] -platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop -platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git board = adafruit_fruitjam -framework = arduino -board_build.core = earlephilhower -board_build.filesystem_size = 0.5m lib_ignore = WiFi, WiFi101, Adafruit Zero DMA Library -lib_compat_mode = soft build_flags = -DUSE_TINYUSB -DADAFRUIT_FRUITJAM_RP2350 \ No newline at end of file diff --git a/src/Wippersnapper.h b/src/Wippersnapper.h index d220d2f2e..136b529c1 100644 --- a/src/Wippersnapper.h +++ b/src/Wippersnapper.h @@ -47,24 +47,16 @@ // Define actual debug output functions when necessary. #ifdef WS_DEBUG #define WS_DEBUG_PRINT(...) \ - { \ - WS_PRINTER.print(__VA_ARGS__); \ - } ///< Prints debug output. + { WS_PRINTER.print(__VA_ARGS__); } ///< Prints debug output. #define WS_DEBUG_PRINTLN(...) \ - { \ - WS_PRINTER.println(__VA_ARGS__); \ - } ///< Prints line from debug output. + { WS_PRINTER.println(__VA_ARGS__); } ///< Prints line from debug output. #define WS_DEBUG_PRINTHEX(...) \ - { \ - WS_PRINTER.print(__VA_ARGS__, HEX); \ - } ///< Prints debug output. + { WS_PRINTER.print(__VA_ARGS__, HEX); } ///< Prints debug output. #else #define WS_DEBUG_PRINT(...) \ - { \ - } ///< Prints debug output + {} ///< Prints debug output #define WS_DEBUG_PRINTLN(...) \ - { \ - } ///< Prints line from debug output. + {} ///< Prints line from debug output. #endif #define WS_DELAY_WITH_WDT(timeout) \ From 5e76adca6a3d0cb6e1b4b91b5f5075a85073706d Mon Sep 17 00:00:00 2001 From: brentru Date: Wed, 13 Aug 2025 15:47:23 -0400 Subject: [PATCH 8/8] Drop semver down to b110 --- src/Wippersnapper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Wippersnapper.h b/src/Wippersnapper.h index 136b529c1..dc3152d01 100644 --- a/src/Wippersnapper.h +++ b/src/Wippersnapper.h @@ -142,7 +142,7 @@ #endif #define WS_VERSION \ - "1.0.0-beta.111" ///< WipperSnapper app. version (semver-formatted) + "1.0.0-beta.110" ///< WipperSnapper app. version (semver-formatted) // Reserved Adafruit IO MQTT topics #define TOPIC_IO_THROTTLE "/throttle" ///< Adafruit IO Throttle MQTT Topic