Skip to content

Commit

Permalink
Merge pull request #615 from adafruit/add-adafruit-feather-esp32c6
Browse files Browse the repository at this point in the history
Add Adafruit Feather ESP32-C6
  • Loading branch information
tyeth authored Aug 20, 2024
2 parents 12ea607 + 5c4dda0 commit 5990002
Show file tree
Hide file tree
Showing 12 changed files with 178 additions and 18 deletions.
118 changes: 117 additions & 1 deletion .github/workflows/build-clang-doxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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<<EOF'
echo $content
echo EOF
} >> "$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:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Adafruit WipperSnapper
version=1.0.0-beta.88
version=1.0.0-alpha.89
author=Adafruit
maintainer=Adafruit <[email protected]>
sentence=Arduino application for Adafruit.io WipperSnapper
Expand Down
59 changes: 45 additions & 14 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand All @@ -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
Expand All @@ -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


Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -384,4 +416,3 @@ build_flags =
; ; No USB stack
; build_flags = -DPIO_FRAMEWORK_ARDUINO_NO_USB
; -DPIO_FRAMEWORK_ARDUINO_ENABLE_IPV6

2 changes: 1 addition & 1 deletion src/Wippersnapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/Wippersnapper_Boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/provisioning/littlefs/WipperSnapper_LittleFS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

/**************************************************************************/
Expand Down

0 comments on commit 5990002

Please sign in to comment.