From 681450f4ad2a9980255455a74e4c5e6684284be3 Mon Sep 17 00:00:00 2001 From: Allen Hill Date: Wed, 8 Jul 2026 14:37:17 -0700 Subject: [PATCH] Update READMEs --- CMakePresets.json | 1 + README.md | 57 ++++++++++++------------------ hardware/README.md | 7 ++++ hardware/mockingboard-v1/README.md | 23 ++++++++++++ 4 files changed, 54 insertions(+), 34 deletions(-) create mode 100644 hardware/README.md create mode 100644 hardware/mockingboard-v1/README.md diff --git a/CMakePresets.json b/CMakePresets.json index 8fd28eb..9bc0ec6 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -22,6 +22,7 @@ "hidden": true, "description": "AVR ATtiny3216 cross-compile toolchain + matching port", "toolchainFile": "${sourceDir}/cmake/avr-gcc-toolchain.cmake", + "binaryDir": "${sourceDir}/out/build/attiny3216", "cacheVariables": { "AVCLAN_TARGET": "avr-attiny3216", "FREQSEL": "20MHz", diff --git a/README.md b/README.md index 92c3449..175076c 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This project adds an aux in to the stock head unit of compatible Toyota vehicles - "Scan" button repurposed to enter bluetooth pairing mode - Button actions (play/pause, track skip, ff/rw, \[disc\] repeat/shuffle) mapped to AVRCP - Song info/status (time, etc) relayed to head-unit (i.e. time display matches actual song/audio time) -- Redesign hardware based on RPi Pico 2W (RP2350 + Bluetooth) +- Redesigned hardware based on RPi Pico 2W (RP2350 + Bluetooth) - PIO used to implement: - AVCLAN comms - I2S audio @@ -39,32 +39,6 @@ This project adds an aux in to the stock head unit of compatible Toyota vehicles - https://web.archive.org/web/20240519043021/https://pop.fsck.pl/hardware/toyota-corolla.html - https://github.com/GadgetNutt/AVC-LAN-Module-Builder -# Hardware - -I ordered the boards partially assembled from JLCPCB (to keep costs down, I ordered and soldered some non-standard/stocked parts myself.) - -The non-populated/assembled BOM is: - -| Mouser #: | Mfr. #: | Desc.: | Order Qty. | Unit Price (USD) | -| ------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------ | ---------- | ----------- | -| 579-ATTINY3216-SNR | ATTINY3216-SNR | 8-bit Microcontrollers - MCU 8-bit Microcontrollers - MCU 20MHz, 32KB, SOIC20, Ind 105C, Green, T&R | 1 | $1.27 | -| 523-L717SDE09PA4CH4 | L717SDE09PA4CH4F | D-Sub Standard Connectors D-Sub Standard Connectors D SUB R/A | 1 | $1.98 | -| 490-SJ-43514 | SJ-43514 | Phone Connectors Phone Connectors audio jack, 3.5 mm, rt, 4 conductor, through hole, 0 switches | 1 | $1.35 | -| 667-ERZ-V20D220 | ERZ-V20D220 | Varistors Varistors 22V 2000A ZNR SUR ABSORBER 20MM | 1 | $1.24 | -| 538-22-28-8093 | 22-28-8093 | Headers & Wire Housings Headers & Wire Housings 2.54MM BREAKAWAY RA 9 CKT Gold | 2 | $0.76 | -| 865-XC6701D502JR-G | XC6701D502JR-G | LDO Voltage Regulators LDO Voltage Regulators 28V High Speed Voltage Regulator | 1 | $1.36 | -| 563-EXN-23350-BK | EXN-23350-BK | Enclosures, Boxes, & Cases Enclosures, Boxes, & Cases Extruded Aluminum Enclosure Black (1.4 X 2.7 X 1.9 In) | 1 | $14.40 | - -An earlier version of the board* lacked cutouts in the corners to fit the ends of the intended housing, so I haven't used the listed enclosure (yet). - -*Only version of the board I have ordered so far. - -## Cable harness - -I ordered a [cable harness](https://www.amazon.com/dp/B01EUZ8CFU) from Amazon to acquire the head-unit side connector. I then cut the male end off a DB9 cable and connected the wires according to the following cable harness diagram: - -![cable diagram](./hardware/harness/harness.png) - # Firmware ### Building @@ -80,23 +54,38 @@ I ordered a [cable harness](https://www.amazon.com/dp/B01EUZ8CFU) from Amazon to #### Natively/without VS Code Dev Containers 1. Install avr-gcc >= v13.1, binutils >= v2.39, cmake >= v3.24 -2. Configure cmake with a hardware-target preset, e.g. `cmake --preset attiny3216-debug-usb0` - (the preset selects the AVR cross-compile toolchain; `cmake --list-presets` shows the rest) - - Trigger builds with `cmake --build build` +2. Configure cmake with a hardware-target preset, `cmake --list-presets` to discover options + - Trigger builds with e.g. `cmake --build out/build/attiny3216` 3. Start developing! -### Flashing +# Hardware -The CMake target `flash` uses the AVRDude utility using the "serialupdi" programmer type. I use a [USB => Serial converter](https://www.adafruit.com/product/5335) with the Rx and Tx lines connected, using one of the options described [by SpenceKonde here](https://github.com/SpenceKonde/AVR-Guidance/blob/master/UPDI/jtag2updi.md). +## First generation + +See [here](hardware/mockingboard-v1/README.md) for details. + +## Second generation + +Under development! # Protocol reverse-engineering The "scripts/packet-analysis" folder contains a [Wireshark](https://www.wireshark.org/) [Lua plugin](https://www.wireshark.org/docs/wsdg_html_chunked/wsluarm.html) that defines a dissector for IEBUS and AVC-LAN messages. +The dissector's `known_devices` / `known_actions` tables are the source of truth +for AVC-LAN device and action names. `scripts/sync_avclan_enums.py` reconciles +the firmware's C++ `Device` / `Action` enums (and every reference under `src/`) +against them, matching by value so renamed values are propagated. It runs as a +pre-commit hook — the top-level CMake configure step points `core.hooksPath` at +`.githooks/`, so `cmake --preset …` activates it automatically (opt out with +`-DINSTALL_GIT_HOOKS=OFF`; `git commit --no-verify` bypasses one commit). The +hook only reports drift; run `scripts/sync_avclan_enums.py --fix` to apply, and +`--lint` to check that the dissector's own names are valid identifiers. + # License -The firmware for this project is licensed under the [GNU GPLv3](https://www.gnu.org/licenses/gpl-3.0.html), -and the hardware is licensed under the [Solderpad Hardware License v2.1](http://solderpad.org/licenses/SHL-2.1/), a +The firmware for this project is licensed under the [GNU GPLv3](https://www.gnu.org/licenses/gpl-3.0.html). The AVR-Attiny3216 hardware target depends on a vendored [MIT](https://spdx.org/licenses/MIT) licensed [UART library](https://github.com/jnk0le/AVR-UART-lib), and the [MPL-2.0](https://www.mozilla.org/MPL/2.0/) licensed [avr-libstdcpp](https://github.com/modm-io/avr-libstdcpp/) C++ STL subset. +The hardware is licensed under the [Solderpad Hardware License v2.1](http://solderpad.org/licenses/SHL-2.1/), a wraparound license to the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0.txt). diff --git a/hardware/README.md b/hardware/README.md new file mode 100644 index 0000000..f50d498 --- /dev/null +++ b/hardware/README.md @@ -0,0 +1,7 @@ +# Hardware + +## Cable harness + +I ordered a [cable harness](https://www.amazon.com/dp/B01EUZ8CFU) from Amazon to acquire the head-unit side connector. I then cut the male end off a DB9 cable and connected the wires according to the following cable harness diagram: + +![cable diagram](./hardware/harness/harness.png) diff --git a/hardware/mockingboard-v1/README.md b/hardware/mockingboard-v1/README.md new file mode 100644 index 0000000..66e7c7c --- /dev/null +++ b/hardware/mockingboard-v1/README.md @@ -0,0 +1,23 @@ +# Hardware + +I ordered the boards partially assembled from JLCPCB (to keep costs down, I ordered and soldered some non-standard/stocked parts myself.) + +The non-populated/assembled BOM is: + +| Mouser #: | Mfr. #: | Desc.: | Order Qty. | Unit Price (USD) | +| ------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------ | ---------- | ----------- | +| 579-ATTINY3216-SNR | ATTINY3216-SNR | 8-bit Microcontrollers - MCU 8-bit Microcontrollers - MCU 20MHz, 32KB, SOIC20, Ind 105C, Green, T&R | 1 | $1.27 | +| 523-L717SDE09PA4CH4 | L717SDE09PA4CH4F | D-Sub Standard Connectors D-Sub Standard Connectors D SUB R/A | 1 | $1.98 | +| 490-SJ-43514 | SJ-43514 | Phone Connectors Phone Connectors audio jack, 3.5 mm, rt, 4 conductor, through hole, 0 switches | 1 | $1.35 | +| 667-ERZ-V20D220 | ERZ-V20D220 | Varistors Varistors 22V 2000A ZNR SUR ABSORBER 20MM | 1 | $1.24 | +| 538-22-28-8093 | 22-28-8093 | Headers & Wire Housings Headers & Wire Housings 2.54MM BREAKAWAY RA 9 CKT Gold | 2 | $0.76 | +| 865-XC6701D502JR-G | XC6701D502JR-G | LDO Voltage Regulators LDO Voltage Regulators 28V High Speed Voltage Regulator | 1 | $1.36 | +| 563-EXN-23350-BK | EXN-23350-BK | Enclosures, Boxes, & Cases Enclosures, Boxes, & Cases Extruded Aluminum Enclosure Black (1.4 X 2.7 X 1.9 In) | 1 | $14.40 | + +An earlier version of the board* lacked cutouts in the corners to fit the ends of the intended housing, so I haven't used the listed enclosure (yet). + +*Only version of the board I have ordered so far. + +### Flashing + +The CMake target `flash` uses the AVRDude utility using the "serialupdi" programmer type. I use a [USB => Serial converter](https://www.adafruit.com/product/5335) with the Rx and Tx lines connected, using one of the options described [by SpenceKonde here](https://github.com/SpenceKonde/AVR-Guidance/blob/master/UPDI/jtag2updi.md).