Skip to content

Build and integrate slave firmware #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Jul 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions .github/workflows/parallel_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: IDF v5.4 parallel build

on:
workflow_dispatch: # Manually start a workflow

jobs:
build-libs:
name: Build Libs for ${{ matrix.target }}
runs-on: macos-14
strategy:
matrix:
target: [esp32, esp32s2, esp32s3, esp32c2, esp32c3, esp32c6, esp32h2, esp32p4]
fail-fast: true
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: bash ./tools/prepare-ci.sh
- name: Get current branch
run: |
echo "GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
- name: Build Libs for ${{ matrix.target }}
run: bash ./build.sh -e -t ${{ matrix.target }}
- name: Upload artifacts for ${{ matrix.target }}
uses: actions/upload-artifact@v4
with:
name: artifacts-${{ matrix.target }}
path: dist

build-slave_firmware:
name: Build Slave Firmware
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: bash ./tools/prepare-ci.sh
- name: Build slave firmware
run: |
bash ./tools/compile_slave.sh
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: slave_firmware
path: wifi_copro_fw

combine-artifacts:
name: Combine artifacts and create framework
needs: [build-libs, build-slave_firmware]
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: dist
pattern: artifacts-*
merge-multiple: true
- name: Download slave firmware
uses: actions/download-artifact@v4
with:
name: slave_firmware
path: slave_firmware
- name: Create complete framework
run: |
mkdir -p out dist/framework-arduinoespressif32
# Combine all target builds
for zip_file in dist/artifacts-*/framework-arduinoespressif32-*.zip; do
echo "Processing $zip_file"
unzip -q "$zip_file" -d out
done
# Remove Arduino IDE specific files (not needed for PlatformIO)
rm -f out/package_esp32_index.template.json
# Copy framework files
cp -r out/* dist/framework-arduinoespressif32/
# Integrate slave firmware directly
mkdir -p dist/framework-arduinoespressif32/tools/slave_firmware
cp -r slave_firmware/* dist/framework-arduinoespressif32/tools/slave_firmware/
# Create final framework ZIP
(cd dist && zip -qr framework-arduinoespressif32.zip framework-arduinoespressif32)

- name: Upload framework artifact
uses: actions/upload-artifact@v4
with:
name: framework
path: |
dist/framework*
dist/release-info.txt

release_framework:
name: Release Framework
needs: combine-artifacts
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Download complete framework
uses: actions/download-artifact@v4
with:
name: framework
path: dist
- name: Release
uses: jason2866/action-gh-release@v1.3
with:
tag_name: ${{ github.run_number }}
body_path: dist/release-info.txt
prerelease: true
files: |
dist/framework*
dist/release-info.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58 changes: 55 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,62 @@ jobs:
run: |
echo "GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
- name: Build Arduino Libs
env:
GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }}
GIT_AUTHOR_EMAIL: ${{ secrets.PUSH_EMAIL }}
run: bash ./build.sh
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: framework
path: |
dist/framework*
release-info.txt

build-slave_firmware:
name: Build Slave Firmware
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: bash ./tools/prepare-ci.sh
- name: Build slave firmware
run: |
bash ./tools/compile_slave.sh
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: slave_firmware
path: wifi_copro_fw

release_framework:
name: Release Framework
needs: [build-libs, build-slave_firmware]
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Download framework artifact
uses: actions/download-artifact@v4
with:
name: framework
path: .
- name: Download slave_firmware artifact
uses: actions/download-artifact@v4
with:
name: slave_firmware
path: slave_firmware
- name: Add slave_firmware to framework zip
run: |
FRAMEWORK_ZIP=$(ls dist/framework*.zip | head -n 1)
unzip -q "$FRAMEWORK_ZIP" -d dist/unpacked
mkdir -p dist/unpacked/framework-arduinoespressif32/tools/slave_firmware
cp -r slave_firmware/* dist/unpacked/framework-arduinoespressif32/tools/slave_firmware/
(cd dist/unpacked && zip -qr ../$(basename "$FRAMEWORK_ZIP") .)
- name: Release
uses: jason2866/action-gh-release@v1.3
with:
Expand Down
38 changes: 38 additions & 0 deletions tools/compile_slave.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# This script is used to build the slave image for wifi_hosted

export IDF_CCACHE_ENABLE=${CCACHE_ENABLE:-1}

rm -rf dependencies.lock

echo "* Installing/Updating ESP-IDF and all components..."

source ./tools/install-esp-idf.sh
if [ $? -ne 0 ]; then exit 1; fi


slave_targets=(
"esp32"
"esp32s3"
"esp32c2"
"esp32c3"
# "esp32c5"
"esp32c6"
)

idf.py create-project-from-example "espressif/esp_hosted:slave"
mkdir wifi_copro_fw
cd ./slave
echo "Found firmware version: $(<./main/coprocessor_fw_version.txt)"

for target in "${slave_targets[@]}"; do
echo "Building for target: $target"
idf.py set-target "$target"
idf.py clean
idf.py build
cp ./build/network_adapter.bin ../wifi_copro_fw/network_adapter_"$target".bin
echo "Build completed for target: $target"
done

cp ./main/coprocessor_fw_version.txt ../wifi_copro_fw/coprocessor_fw_version.txt
5 changes: 3 additions & 2 deletions tools/prepare-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ brew install gawk
brew install gperf
#brew install ninja
brew install ccache
python -m pip install --upgrade pip
pip install wheel future pyelftools
python -m pip install uv
uv venv
uv pip install future pyelftools