Initial public khodo snapshot
ci / checks (push) Successful in 38m58s

This commit is contained in:
khodowany
2026-09-04 19:30:11 -05:00
commit 4f9a269f85
99 changed files with 59585 additions and 0 deletions
+67
View File
@@ -0,0 +1,67 @@
#!/usr/bin/env bash
set -euo pipefail
if [ "$#" -ne 7 ]; then
echo "usage: build_pico_firmware.sh BUILD_DIR OUTPUT_UF2 SDK_VERSION WIFI_SSID WIFI_PASSPHRASE ZERO_HOST ZERO_PORT" >&2
exit 2
fi
source_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
build_dir=$1
output_uf2=$2
sdk_version=$3
wifi_ssid=$4
wifi_passphrase=$5
zero_host=$6
zero_port=$7
pico_sdk_path=${VAMP_PICO_SDK_PATH:-${PICO_SDK_PATH:-}}
sdk_args=(
-DPICO_SDK_FETCH_FROM_GIT=ON
"-DPICO_SDK_FETCH_FROM_GIT_TAG=${sdk_version}"
)
if [ -n "$pico_sdk_path" ]; then
pico_sdk_path=$(cd "$pico_sdk_path" && pwd)
sdk_args=(
"-DPICO_SDK_PATH=${pico_sdk_path}"
-DPICO_SDK_FETCH_FROM_GIT=OFF
)
fi
mkdir -p "$(dirname "$output_uf2")"
unset CC CXX CPP AS AR LD RANLIB STRIP CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
for tool in cmake ninja; do
if ! command -v "$tool" >/dev/null 2>&1; then
echo "missing required tool: $tool" >&2
exit 1
fi
done
if [ -z "${PICO_TOOLCHAIN_PATH:-}" ]; then
for tool in arm-none-eabi-gcc arm-none-eabi-g++; do
if ! command -v "$tool" >/dev/null 2>&1; then
echo "missing required tool: $tool, or set PICO_TOOLCHAIN_PATH" >&2
exit 1
fi
done
fi
cmake -E rm -f "$build_dir/CMakeCache.txt"
cmake -E rm -rf "$build_dir/CMakeFiles"
cmake \
-S "$source_dir" \
-B "$build_dir" \
-G Ninja \
-DVAMP_PICO_FIRMWARE_PROJECT=ON \
-DPICO_BOARD=pico2_w \
-DPICO_GCC_TRIPLE=arm-none-eabi \
"${sdk_args[@]}" \
"-DVAMP_PICO_WIFI_SSID=${wifi_ssid}" \
"-DVAMP_PICO_WIFI_PASSPHRASE=${wifi_passphrase}" \
"-DVAMP_ZERO_HOST=${zero_host}" \
"-DVAMP_ZERO_PORT=${zero_port}"
cmake --build "$build_dir" --target product-vamp-pico2w --parallel "${VAMP_BUILD_JOBS:-2}"
cmake -E copy "$build_dir/product-vamp-pico2w.uf2" "$output_uf2"