Files
hardware/.github/workflows/firmware.yml
T
Claude 6d7a5dcda5 firmware: the wideband stick (PS_BOARD=wb), TLV320AIC3204 over USB
pico-serial WB (SPEC-WB.md): the Line stick's USB device in front of a
TLV320AIC3204 codec at 96 kHz (48 and 192 kHz for tests), USB 1209:0003.

- Clocks (SPEC-WB 4): MCLK is the 12 MHz crystal on GPIO21 (GPOUT0);
  the codec's PLL P=1 R=1 J.D=8.1920 makes 98.304 MHz; NDAC=NADC=
  MDAC=MADC=4; 96 kHz: DOSR=AOSR=64, PRB_P7/PRB_R7, BCLK N=4 (6.144
  MHz, 64 a frame); 192 kHz: 32, PRB_P17/PRB_R13, N=2; 48 kHz: 128,
  PRB_P1/PRB_R1, N=8. The codec is the I2S master, 32-bit words.
- Bring-up (src/core/wb_codec.c) in SLAA557's order: pin and software
  reset, PLL, dividers, I2S, INT1 on MFP5, weak AVDD off then the A-LDO
  at 1.77 V, CM 0.9 V, the left DAC's + and - to HPL and HPR (one DAC,
  a differential drive), drivers up and their gain flags waited for,
  then the DAC and both ADCs, their flags waited for.
- The hybrid in the left MicPGA: + IN1L, IN1R; - IN2R, IN3R; 10 k each
  (P1 R52=0x41, R54=0x14): line minus replica. The right MicPGA takes
  the line alone (IN2R - IN1L, 20 k); the replica alone can't be routed
  differentially.
- I2S slave in PIO (src/wb/i2s.pio), full duplex, DMA ping-pong blocks of
  32 frames into src/core/wb_audio.c; out of step, it stops and is
  restarted (counted).
- Requests (src/core/wb_proto.h): info, status (peaks, codec flags),
  rate, carrier LED, TX gain (DAC volume), RX gain (MicPGA), input
  channel, firmware and codec loopbacks, codec register read/write by
  page, reset, UF2. Mono S16 packets up to 240 samples (480 bytes).
- test_wb.c: the clocks re-derived from the registers and checked
  against SLAA557's limits for every rate, the MicPGA bits against the
  netlist, the bring-up order and timeouts, packet sizing, the samples
  path, the requests. Each of 15 deliberate breaks is caught.
- CI builds PS_BOARD=wb and runs test_wb.

All five boards build (SDK 2.3.1, TinyUSB 0.21.0); host tests and
check_docs pass. Nothing has run on a WB board yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013PRsUCpxazyipPn5UGGkF8
2026-10-27 09:37:55 +00:00

82 lines
2.9 KiB
YAML

# SPDX-License-Identifier: AGPL-3.0-only
# Copyright (C) 2026 Neo-Desktop
name: firmware
on:
push:
paths: ["firmware/**", "hardware/netlist/**", ".github/workflows/firmware.yml"]
pull_request:
paths: ["firmware/**", "hardware/netlist/**", ".github/workflows/firmware.yml"]
jobs:
build-and-test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Tools
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib ninja-build cmake
- name: Pin header matches the netlist
run: |
python3 hardware/netlist/build_netlist.py
git diff --exit-code -- firmware/src/generated hardware/netlist
- name: Every function is documented
run: python3 firmware/tools/check_docs.py
- name: Core tests (host)
run: make -C firmware/test run
- name: Build (hood board)
run: |
cmake -S firmware -B firmware/build-hood -G Ninja -DPS_BOARD=hood
ninja -C firmware/build-hood
- name: Build (W board, Bluetooth)
run: |
cmake -S firmware -B firmware/build-w -G Ninja -DPS_BOARD=w \
-DPICO_SDK_PATH=$PWD/firmware/build-hood/_deps/pico_sdk-src \
-DPICO_TINYUSB_PATH=$PWD/firmware/build-hood/_deps/tinyusb-src
ninja -C firmware/build-w
- name: Build (Pico bench rig)
run: |
cmake -S firmware -B firmware/build-pico -G Ninja -DPS_BOARD=pico \
-DPICO_SDK_PATH=$PWD/firmware/build-hood/_deps/pico_sdk-src \
-DPICO_TINYUSB_PATH=$PWD/firmware/build-hood/_deps/tinyusb-src
ninja -C firmware/build-pico
- name: Build (phone-line stick)
run: |
cmake -S firmware -B firmware/build-line -G Ninja -DPS_BOARD=line \
-DPICO_SDK_PATH=$PWD/firmware/build-hood/_deps/pico_sdk-src \
-DPICO_TINYUSB_PATH=$PWD/firmware/build-hood/_deps/tinyusb-src
ninja -C firmware/build-line
- name: Build (wideband stick)
run: |
cmake -S firmware -B firmware/build-wb -G Ninja -DPS_BOARD=wb \
-DPICO_SDK_PATH=$PWD/firmware/build-hood/_deps/pico_sdk-src \
-DPICO_TINYUSB_PATH=$PWD/firmware/build-hood/_deps/tinyusb-src
ninja -C firmware/build-wb
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Emulator test (rp2040js)
run: firmware/test/emu/run.sh firmware/build-hood/pico-serial-hood.bin
- uses: actions/upload-artifact@v4
with:
name: pico-serial-firmware
path: |
firmware/build-hood/pico-serial-hood.uf2
firmware/build-w/pico-serial-w.uf2
firmware/build-pico/pico-serial-pico.uf2
firmware/build-line/pico-serial-line.uf2
firmware/build-wb/pico-serial-wb.uf2