20c59e730c
TeamCity CI (.teamcity/settings.kts): - Clones/updates Pico SDK automatically - Builds firmware with cmake + make - Publishes .uf2 and .elf as artifacts - VCS trigger on all branches Manufacturing files (hardware/manufacturing/): - BOM_PCBWay.csv: LCSC part numbers for assembly - CPL_PCBWay.csv: Component placement coordinates - README with order checklist and specifications Build script (firmware/build.sh): - Standalone build script for local development - Auto-detects Pico SDK location
56 lines
1.2 KiB
Bash
Executable File
56 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# SN-L00 Firmware Build Script
|
|
# Used by CI and local development
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
BUILD_DIR="${SCRIPT_DIR}/build"
|
|
|
|
# Check for Pico SDK
|
|
if [ -z "$PICO_SDK_PATH" ]; then
|
|
# Try common locations
|
|
if [ -d "/usr/share/pico-sdk" ]; then
|
|
export PICO_SDK_PATH="/usr/share/pico-sdk"
|
|
elif [ -d "$HOME/pico-sdk" ]; then
|
|
export PICO_SDK_PATH="$HOME/pico-sdk"
|
|
elif [ -d "/opt/pico-sdk" ]; then
|
|
export PICO_SDK_PATH="/opt/pico-sdk"
|
|
else
|
|
echo "ERROR: PICO_SDK_PATH not set and SDK not found in common locations"
|
|
echo "Please set PICO_SDK_PATH or install pico-sdk"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
echo "Using Pico SDK: $PICO_SDK_PATH"
|
|
|
|
# Clean build if requested
|
|
if [ "$1" = "clean" ]; then
|
|
echo "Cleaning build directory..."
|
|
rm -rf "$BUILD_DIR"
|
|
fi
|
|
|
|
# Create build directory
|
|
mkdir -p "$BUILD_DIR"
|
|
cd "$BUILD_DIR"
|
|
|
|
# Configure
|
|
echo "Configuring..."
|
|
cmake .. -DCMAKE_BUILD_TYPE=Release
|
|
|
|
# Build
|
|
echo "Building..."
|
|
make -j$(nproc)
|
|
|
|
# Report results
|
|
if [ -f "sn_l00.uf2" ]; then
|
|
echo ""
|
|
echo "Build successful!"
|
|
echo "Output: $BUILD_DIR/sn_l00.uf2"
|
|
ls -lh sn_l00.uf2 sn_l00.elf
|
|
else
|
|
echo "Build failed - no output file"
|
|
exit 1
|
|
fi
|