Skip to content

Commit c653e06

Browse files
authored
Merge pull request #779 from adafruit/featherS2-migration
tinyuf2 build task changes (PR #774) plus Feather s2 migration
2 parents 331c6c8 + e0ccdc2 commit c653e06

File tree

3 files changed

+43
-14
lines changed

3 files changed

+43
-14
lines changed

.github/workflows/build-clang-doxy.yml

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
matrix:
2626
arduino-platform:
2727
[
28+
"feather_esp32s2",
2829
"funhouse_noota",
2930
"esp32s3_devkitc_1_n8",
3031
"xiao_esp32s3",
@@ -33,6 +34,8 @@ jobs:
3334
- offset: "0x0"
3435
- offset: "0x1000"
3536
arduino-platform: "funhouse_noota"
37+
- offset: "0x1000"
38+
arduino-platform: "feather_esp32s2"
3639
steps:
3740
- name: "skip if unwanted"
3841
continue-on-error: true
@@ -61,6 +64,7 @@ jobs:
6164
with:
6265
repository: adafruit/Wippersnapper_Boards
6366
path: ws-boards
67+
ref: migrate-4mb-to-esptool
6468
- name: Install CI-Arduino
6569
run: bash ci/actions_install.sh
6670
- name: Install extra Arduino libraries
@@ -141,6 +145,38 @@ jobs:
141145
echo $content
142146
echo EOF
143147
} >> "$GITHUB_OUTPUT"
148+
- name: fetch tinyuf2 combined.bin
149+
run: |
150+
DOWNLOAD_URL=$(curl -s https://api.github.com/repos/adafruit/tinyuf2/releases/latest | \
151+
jq -r '.assets[] | select(.browser_download_url | contains("tinyuf2-'${{fromJson(steps.get_board_json.outputs.boardJson).bootloaderBoardName}}'-") and endswith(".zip")) | .browser_download_url')
152+
if [ -z "$DOWNLOAD_URL" ]; then
153+
echo "Error: Could not find the latest tinyuf2 release for board ${fromJson(steps.get_board_json.outputs.boardJson).bootloaderBoardName}."
154+
exit 1
155+
fi
156+
wget "$DOWNLOAD_URL" -O tinyuf2.zip
157+
unzip -o tinyuf2.zip -d .
158+
159+
- name: move partition and bootloader files for tinyuf2 (to match flash_args)
160+
run: |
161+
# Copy files where they're expected to make flash_args happy
162+
mkdir bootloader
163+
cp bootloader.bin bootloader/bootloader.bin
164+
mkdir partition_table
165+
cp partition-table.bin partition_table/partition-table.bin
166+
167+
- name: Create new_flash_args file from flash_args with added app bin + output file
168+
run: |
169+
# Create new_flash_args with esptool parameters first and output file
170+
echo "--flash-mode ${{fromJson(steps.get_board_json.outputs.boardJson).esptool.flashMode}}" > new_flash_args
171+
echo "--flash-freq ${{fromJson(steps.get_board_json.outputs.boardJson).esptool.flashFreq}}" >> new_flash_args
172+
echo "--flash-size ${{fromJson(steps.get_board_json.outputs.boardJson).esptool.flashSize}}" >> new_flash_args
173+
echo "-o wippersnapper.${{ matrix.arduino-platform }}.fatfs.${{ env.WS_VERSION }}.combined.bin" >> new_flash_args
174+
175+
# Append flash_args content to new_flash_args, skipping the first line
176+
tail -n +2 flash_args >> new_flash_args
177+
178+
# Append main app to flash_args file
179+
echo "0x10000 wippersnapper.${{ matrix.arduino-platform }}.fatfs.${{ env.WS_VERSION }}.bin" >> new_flash_args
144180
- name: Check boot_app0 file existence (esp32sx built from core, not-source)
145181
id: check_files
146182
uses: andstor/file-existence-action@v3
@@ -156,23 +192,17 @@ jobs:
156192
ls /home/runner/Arduino/hardware/espressif/esp32/tools/partitions
157193
- name: boot_app0 file from arduino-cli core
158194
if: steps.check_files.outputs.files_exists == 'true'
159-
run: mv /home/runner/.arduino15/packages/esp32/hardware/esp32/*/tools/partitions/boot_app0.bin wippersnapper.${{ matrix.arduino-platform }}.fatfs.${{ env.WS_VERSION }}.boot_app0.bin
195+
run: cp /home/runner/.arduino15/packages/esp32/hardware/esp32/*/tools/partitions/boot_app0.bin wippersnapper.${{ matrix.arduino-platform }}.fatfs.${{ env.WS_VERSION }}.boot_app0.bin
160196
- name: boot_app0 file from esp32 source bsp
161197
if: steps.check_files.outputs.files_exists == 'false'
162-
run: mv /home/runner/Arduino/hardware/espressif/esp32/tools/partitions/boot_app0.bin wippersnapper.${{ matrix.arduino-platform }}.fatfs.${{ env.WS_VERSION }}.boot_app0.bin
198+
run: cp /home/runner/Arduino/hardware/espressif/esp32/tools/partitions/boot_app0.bin wippersnapper.${{ matrix.arduino-platform }}.fatfs.${{ env.WS_VERSION }}.boot_app0.bin
199+
- name: Copy boot_app0 file to ota_data_initial.bin (overwrite tinyuf2 boot preference)
200+
run: cp wippersnapper.${{ matrix.arduino-platform }}.fatfs.${{ env.WS_VERSION }}.boot_app0.bin ota_data_initial.bin
163201
- name: Create combined binary using Esptool merge-bin
164202
run: |
165203
echo ${{ steps.get_board_json.outputs.boardJson }}
166204
echo ${{ fromJson(steps.get_board_json.outputs.boardJson) }}
167-
python3 -m esptool --chip ${{fromJson(steps.get_board_json.outputs.boardJson).esptool.chip}} merge-bin \
168-
--flash-mode ${{fromJson(steps.get_board_json.outputs.boardJson).esptool.flashMode}} \
169-
--flash-freq ${{fromJson(steps.get_board_json.outputs.boardJson).esptool.flashFreq}} \
170-
--flash-size ${{fromJson(steps.get_board_json.outputs.boardJson).esptool.flashSize}} \
171-
-o wippersnapper.${{ matrix.arduino-platform }}.fatfs.${{ env.WS_VERSION }}.combined.bin \
172-
${{ matrix.offset }} wippersnapper.${{ matrix.arduino-platform }}.fatfs.${{ env.WS_VERSION }}.bootloader.bin \
173-
0x8000 wippersnapper.${{ matrix.arduino-platform }}.fatfs.${{ env.WS_VERSION }}.partitions.bin \
174-
0xe000 wippersnapper.${{ matrix.arduino-platform }}.fatfs.${{ env.WS_VERSION }}.boot_app0.bin \
175-
0x10000 wippersnapper.${{ matrix.arduino-platform }}.fatfs.${{ env.WS_VERSION }}.bin
205+
python3 -m esptool --chip ${{fromJson(steps.get_board_json.outputs.boardJson).esptool.chip}} merge-bin @new_flash_args
176206
- name: Zip build artifacts
177207
run: |
178208
zip -r wippersnapper.${{ matrix.arduino-platform }}.fatfs.${{ env.WS_VERSION }}.zip wippersnapper.${{ matrix.arduino-platform }}.fatfs.${{ env.WS_VERSION }}.*
@@ -203,7 +233,6 @@ jobs:
203233
"magtag",
204234
"metroesp32s2",
205235
"metro_esp32s3",
206-
"feather_esp32s2",
207236
"feather_esp32s2_tft",
208237
"feather_esp32s2_reverse_tft",
209238
"feather_esp32s3",

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Adafruit WipperSnapper
2-
version=1.0.0-beta.106
2+
version=1.0.0-beta.107
33
author=Adafruit
44
maintainer=Adafruit <adafruitio@adafruit.com>
55
sentence=Arduino application for Adafruit.io WipperSnapper

src/Wippersnapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
#endif
143143

144144
#define WS_VERSION \
145-
"1.0.0-beta.106" ///< WipperSnapper app. version (semver-formatted)
145+
"1.0.0-beta.107" ///< WipperSnapper app. version (semver-formatted)
146146

147147
// Reserved Adafruit IO MQTT topics
148148
#define TOPIC_IO_THROTTLE "/throttle" ///< Adafruit IO Throttle MQTT Topic

0 commit comments

Comments
 (0)