diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index 7c1c7c210..672198375 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -223,7 +223,7 @@ jobs: wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.bin build-esp32: - name: Build WipperSnapper ESP32, ESP32-C3 + name: Build WipperSnapper ESP32, ESP32-Cx runs-on: ubuntu-latest strategy: fail-fast: false @@ -235,11 +235,14 @@ jobs: "feather_esp32_v2", "itsybitsy_esp32", "wippersnapper_qtpy_esp32c3", + "wippersnapper_feather_esp32c6", ] include: - offset: "0x1000" - offset: "0x0" arduino-platform: "wippersnapper_qtpy_esp32c3" + - offset: "0x0" + arduino-platform: "wippersnapper_feather_esp32c6" steps: - uses: actions/setup-python@v4 with: @@ -610,6 +613,119 @@ jobs: wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.bin + build-esp32-dev: + name: Build WipperSnapper ESP32/Cx DEV BUILDS + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + arduino-platform: + [ + "wippersnapper_feather_esp32c6_debug", + ] + include: + - offset: "0x1000" + - offset: "0x0" + arduino-platform: "wippersnapper_feather_esp32c6_debug" + steps: + - uses: actions/setup-python@v4 + with: + python-version: "3.x" + - uses: actions/checkout@v4 + - name: Get WipperSnapper version + run: | + git fetch --prune --unshallow --tags + git describe --dirty --tags + echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags) + - uses: actions/checkout@v4 + with: + repository: adafruit/ci-arduino + path: ci + - name: Checkout Board Definitions + uses: actions/checkout@v4 + with: + repository: adafruit/Wippersnapper_Boards + path: ws-boards + - name: Install CI-Arduino + run: bash ci/actions_install.sh + - name: Install extra Arduino libraries + run: | + git clone --quiet https://github.com/milesburton/Arduino-Temperature-Control-Library.git /home/runner/Arduino/libraries/Arduino-Temperature-Control-Library + git clone --quiet https://github.com/pstolarz/OneWireNg.git /home/runner/Arduino/libraries/OneWireNg + - name: Download and install stable Nanopb + run: | + # Download and extract nanopb + wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.8.tar.gz + tar -xf nanopb-0.4.8.tar.gz + # Copy files to WipperSnapper's src/nanopb directory + cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb + mv nanopb/pb.h src/nanopb/nanopb.pb.h + - name: Install Dependencies + run: | + pip3 install esptool + - name: build ESP32 platforms + run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 + - name: Check artifacts + run: | + ls examples/wippersnapper_debug/build/* + - name: Rename build artifacts to reflect the platform name + run: | + mv examples/wippersnapper_debug/build/*/wippersnapper_debug.ino.bin wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.bin + mv examples/wippersnapper_debug/build/*/wippersnapper_debug.ino.elf wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.elf + mv examples/wippersnapper_debug/build/*/wippersnapper_debug.ino.map wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.map + mv examples/wippersnapper_debug/build/*/wippersnapper_debug.ino.bootloader.bin wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.bootloader.bin + mv examples/wippersnapper_debug/build/*/wippersnapper_debug.ino.partitions.bin wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.partitions.bin + - name: Check boot_app0 file existence (esp32 built from core, not-source) + id: check_files + uses: andstor/file-existence-action@v2 + with: + files: "/home/runner/.arduino15/packages/esp32/hardware/esp32/*/tools/partitions/boot_app0.bin" + - name: boot_app0 file from arduino-cli core + if: steps.check_files.outputs.files_exists == 'true' + run: mv /home/runner/.arduino15/packages/esp32/hardware/esp32/*/tools/partitions/boot_app0.bin wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.boot_app0.bin + - name: boot_app0 file from esp32 source bsp + if: steps.check_files.outputs.files_exists == 'false' + run: mv /home/runner/Arduino/hardware/espressif/esp32/tools/partitions/boot_app0.bin wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.boot_app0.bin + - name: Get Board Flash Parameters + id: get_board_json + run: | + board_name=${{ matrix.arduino-platform }} + # Remove '_noota' suffix if present + board_name=${board_name%_noota} + # Remove '_debug' suffix if present + board_name=${board_name%_debug} + # Remove 'wippersnapper_' prefix if present + board_name=${board_name#wippersnapper_} + content=$(cat ws-boards/boards/${board_name//_/-}/definition.json) + { + echo 'boardJson<> "$GITHUB_OUTPUT" + - name: Create combined binary using Esptool merge_bin + run: | + echo ${{ steps.get_board_json.outputs.boardJson }} + echo ${{ fromJson(steps.get_board_json.outputs.boardJson) }} + python3 -m esptool --chip ${{fromJson(steps.get_board_json.outputs.boardJson).esptool.chip}} merge_bin \ + --flash_mode ${{fromJson(steps.get_board_json.outputs.boardJson).esptool.flashMode}} \ + --flash_freq ${{fromJson(steps.get_board_json.outputs.boardJson).esptool.flashFreq}} \ + --flash_size ${{fromJson(steps.get_board_json.outputs.boardJson).esptool.flashSize}} \ + -o wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.combined.bin \ + ${{ matrix.offset }} wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.bootloader.bin \ + 0x8000 wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.partitions.bin \ + 0xe000 wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.boot_app0.bin \ + 0x10000 wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.bin + - name: Zip build artifacts + run: | + zip -r wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.zip wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.* + - name: upload build artifacts zip + uses: actions/upload-artifact@v3 + with: + name: build-files-dev + path: | + wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.zip + + clang_and_doxy: runs-on: ubuntu-latest needs: diff --git a/examples/Wippersnapper_NoFS/.wippersnapper_feather_esp32c6.test.skip b/examples/Wippersnapper_NoFS/.wippersnapper_feather_esp32c6.test.skip new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/examples/Wippersnapper_NoFS/.wippersnapper_feather_esp32c6.test.skip @@ -0,0 +1 @@ + diff --git a/examples/Wippersnapper_NoFS/.wippersnapper_feather_esp32c6_debug.test.skip b/examples/Wippersnapper_NoFS/.wippersnapper_feather_esp32c6_debug.test.skip new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/examples/Wippersnapper_NoFS/.wippersnapper_feather_esp32c6_debug.test.skip @@ -0,0 +1 @@ + diff --git a/examples/Wippersnapper_demo/.wippersnapper_feather_esp32c6.generate b/examples/Wippersnapper_demo/.wippersnapper_feather_esp32c6.generate new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/examples/Wippersnapper_demo/.wippersnapper_feather_esp32c6.generate @@ -0,0 +1 @@ + diff --git a/examples/Wippersnapper_demo/.wippersnapper_feather_esp32c6_debug.test.skip b/examples/Wippersnapper_demo/.wippersnapper_feather_esp32c6_debug.test.skip new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/examples/Wippersnapper_demo/.wippersnapper_feather_esp32c6_debug.test.skip @@ -0,0 +1 @@ + diff --git a/examples/wippersnapper_debug/.wippersnapper_feather_esp32c6.test.skip b/examples/wippersnapper_debug/.wippersnapper_feather_esp32c6.test.skip new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/examples/wippersnapper_debug/.wippersnapper_feather_esp32c6.test.skip @@ -0,0 +1 @@ + diff --git a/examples/wippersnapper_debug/.wippersnapper_feather_esp32c6_debug.generate b/examples/wippersnapper_debug/.wippersnapper_feather_esp32c6_debug.generate new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/examples/wippersnapper_debug/.wippersnapper_feather_esp32c6_debug.generate @@ -0,0 +1 @@ + diff --git a/library.properties b/library.properties index caa57f7ef..1aa7a2725 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Adafruit WipperSnapper -version=1.0.0-beta.88 +version=1.0.0-alpha.89 author=Adafruit maintainer=Adafruit sentence=Arduino application for Adafruit.io WipperSnapper diff --git a/platformio.ini b/platformio.ini index 1ed2b6d54..87ff73c73 100644 --- a/platformio.ini +++ b/platformio.ini @@ -70,7 +70,7 @@ lib_deps = adafruit/Adafruit TouchScreen adafruit/Adafruit MQTT Library bblanchon/ArduinoJson - https://github.com/PaulStoffregen/OneWire.git + https://github.com/pstolarz/OneWireNg.git https://github.com/milesburton/Arduino-Temperature-Control-Library.git https://github.com/Sensirion/arduino-sht.git https://github.com/Sensirion/arduino-i2c-scd4x.git @@ -81,14 +81,16 @@ lib_deps = ; Common build environment for ESP32 platform [common:esp32] -platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.03/platform-espressif32.zip -lib_ignore = WiFiNINA, WiFi101 +; platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.04/platform-espressif32.zip +; This is needed for Adafruit Feather C6 in platformio (until 51.03.05): +platform = https://github.com/pioarduino/platform-espressif32#develop +lib_ignore = WiFiNINA, WiFi101, OneWire monitor_filters = esp32_exception_decoder, time ; Common build environment for ESP8266 platform [common:esp8266] platform = espressif8266 -lib_ignore = WiFiNINA, WiFi101, Adafruit TinyUSB Library +lib_ignore = WiFiNINA, WiFi101, Adafruit TinyUSB Library, OneWire ; Common build environment for Atmel/Microchip SAMDx platform [common:atsamd] @@ -98,6 +100,7 @@ platform_packages = platformio/tool-jlink@^1.78811.0 lib_ldf_mode = deep lib_archive = no ; debug timer issues see https://community.platformio.org/t/choose-usb-stack-as-tiny-usb/22451/5 +lib_ignore = OneWire [common:rp2040] platform = https://github.com/maxgerhardt/platform-raspberrypi.git @@ -110,7 +113,7 @@ 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 +lib_ignore = WiFiNINA, WiFi101, Adafruit Zero DMA Library, OneWire lib_compat_mode = soft ; can be strict once pio detects SleepyDog on RP2040 @@ -142,6 +145,35 @@ board = adafruit_itsybitsy_esp32 build_flags = -DARDUINO_ADAFRUIT_ITSYBITSY_ESP32 board_build.filesystem = littlefs +; Adafruit ESP32 Feather C6 +[env:adafruit_feather_esp32c6_4mbflash_nopsram] +extends = common:esp32 +board = adafruit_feather_esp32c6 +build_flags = + -DARDUINO_ADAFRUIT_FEATHER_ESP32C6 + -DARDUINO_USB_CDC_ON_BOOT=1 + -DCORE_DEBUG_LEVEL=3 +board_build.filesystem = littlefs +board_build.partitions = min_spiffs.csv + +; Espressif ESP32-C6 4MB NO PSRAM esp32-c6-devkitm-1 +[env:espressif_esp32-c6-devkitm-1] +extends = common:esp32 +board = esp32-c6-devkitm-1 +build_type = debug +build_flags = + -DARDUINO_ESPRESSIF_ESP32C6_DEVKITM_1 + -DARDUINO_ADAFRUIT_FEATHER_ESP32C6 + -DNDEBUG=1 + -DDEBUG=1 + -DESP_LOG_LEVEL=5 + -DARDUINO_CORE_DEBUG_LEVEL=5 + -DARDUINO_DEBUG_LEVEL=5 + -DARDUINO_LOG_LEVEL=5 + -DCORE_DEBUG_LEVEL=5 + -DARDUHAL_LOG_LEVEL=5 +board_build.filesystem = littlefs +board_build.partitions = min_spiffs.csv ; Adafruit Feather ESP32-S2 [env:featheresp32s2] @@ -259,7 +291,7 @@ extra_scripts = pre:rename_usb_config.py extends = common:esp32 board = esp32-s3-devkitc-1 build_type = debug -build_flags = +build_flags = -DUSE_TINYUSB=1 -DARDUINO_ESPRESSIF_ESP32S3_DEVKITC_1_N8 -DNDEBUG=1 @@ -308,13 +340,13 @@ monitor_port = auto ; debug_init_break = tbreak clearConfiguration lib_ignore = USBHost build_flags = -DUSE_TINYUSB - -D__SAMD51J20A__ - -DCRYSTALLESS - -DADAFRUIT_PYPORTAL_M4_TITANO - -D__SAMD51__ - -D__FPU_PRESENT - -DARM_MATH_CM4 - -mfloat-abi=hard + -D__SAMD51J20A__ + -DCRYSTALLESS + -DADAFRUIT_PYPORTAL_M4_TITANO + -D__SAMD51__ + -D__FPU_PRESENT + -DARM_MATH_CM4 + -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DCORE_DEBUG_LEVEL=5 -DARDUINO_USB_CDC_ON_BOOT=1 @@ -384,4 +416,3 @@ build_flags = ; ; No USB stack ; build_flags = -DPIO_FRAMEWORK_ARDUINO_NO_USB ; -DPIO_FRAMEWORK_ARDUINO_ENABLE_IPV6 - \ No newline at end of file diff --git a/src/Wippersnapper.h b/src/Wippersnapper.h index 6966dd058..fc4d41928 100644 --- a/src/Wippersnapper.h +++ b/src/Wippersnapper.h @@ -142,7 +142,7 @@ #endif #define WS_VERSION \ - "1.0.0-beta.88" ///< WipperSnapper app. version (semver-formatted) + "1.0.0-alpha.89" ///< 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 bd3c263a6..b119329a1 100644 --- a/src/Wippersnapper_Boards.h +++ b/src/Wippersnapper_Boards.h @@ -150,6 +150,12 @@ #define USE_LITTLEFS #define USE_STATUS_LED #define STATUS_LED_PIN 13 +#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32C6) +#define BOARD_ID "feather-esp32c6" +#define USE_LITTLEFS +#define USE_STATUS_NEOPIXEL +#define STATUS_NEOPIXEL_PIN PIN_NEOPIXEL +#define STATUS_NEOPIXEL_NUM 1 #elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2) #define BOARD_ID "feather-esp32-v2" #define USE_LITTLEFS diff --git a/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp b/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp index 57a534a86..e3ccf3831 100644 --- a/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp +++ b/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp @@ -17,7 +17,8 @@ defined(ARDUINO_ADAFRUIT_ITSYBITSY_ESP32) || \ defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2) || \ defined(ARDUINO_ADAFRUIT_QTPY_ESP32_PICO) || \ - defined(ARDUINO_ADAFRUIT_QTPY_ESP32C3) + defined(ARDUINO_ADAFRUIT_QTPY_ESP32C3) || \ + defined(ARDUINO_ADAFRUIT_FEATHER_ESP32C6) #include "WipperSnapper_LittleFS.h" /**************************************************************************/