# AvocAudio RP2040 Bring-Up Firmware First milestone firmware for the bare RP2040 on AvocAudio v3 Rev 2. It provides USB CDC startup diagnostics, LED blink, bounded DHT probing, read-only boot-flash identification, a low-speed bit-banged SD SPI-mode/OCR diagnostic, and a PIO UART LoRa-E5 AT probe. ## Build Install a current Raspberry Pi Pico SDK and ARM GNU toolchain. Make `pico_sdk_import.cmake` available beside `CMakeLists.txt` (copy it from `pico-sdk/external/`) or set `PICO_SDK_PATH`. ```sh mkdir build && cd build cmake -DPICO_BOARD=pico .. cmake --build . -j ``` Outputs include `avocaudio_bringup.uf2`, `.elf`, `.bin`, and `.hex`. ## Flash and test 1. Hold BOOTSEL while connecting USB, then copy `build/avocaudio_bringup.uf2` to the RPI-RP2 drive. 2. Open the USB CDC serial port at any terminal baud (USB CDC ignores baud). 3. The program waits only for the configured USB grace period, prints the startup table, then continues scheduled tests. 4. Verify continuous LED blinking, flash ID, SD initialization result, DHT reports every 2.5 s, and bounded LoRa `AT` retries. ## Important limits - The PCB currently has 0 routed traces; this firmware is based on verified schematic connectivity only. - SW2 drives RUN and is not readable. SW1/BOOTSEL shares QSPI flash CS and is deliberately not sampled while XIP executes. No safe firmware-readable user button is validated. - LoRa reset active level/timing and 9600 8N1 defaults are configurable in `src/avocaudio_board.h` and require hardware confirmation. - The SD diagnostic enters SPI mode and reads OCR only; it does not mount FAT. - Periodic SD reinitialization is disabled by default. Enabling `AVO_SD_PERIODIC_RETRY` introduces a bounded approximately 1 second worst-case cooperative pause from ACMD41 retries. - DHT11/DHT22 is inferred from the received payload and must be confirmed against the fitted sensor. - LED active-high is inferred and configurable. - Microphone functions are intentionally outside this milestone. - Full Pico SDK compilation remains unverified.