ArduBDM
A BDM (Background Debug Mode) adapter for the CPU32 family (MC68332/MC68376) found in SAAB Trionic 5, 7 and 8 ECUs. It runs on an Arduino Nano with the ATmega328PB, bit-bangs the BDM protocol and talks to the host over USB serial. Together with BDMTool it reads, erases and flashes the ECU.

Download firmware · Source on GitHub
Features
- Reset into BDM, run, stop and single step the target
- Read and write memory and registers
- Fast block dumps: a full 512 KB Trionic 7 read takes about 7 seconds
- RAM-resident flash drivers for AMD 29Fxxx (Trionic 7/8) and 28F010 (Trionic 5) chips; a full 512 KB erase, write and verify takes about 30 seconds with BDMTool
- Simple ASCII serial protocol at 1 Mbaud, easy to script
- Target voltage monitoring
Hardware
The PCB is a small hat for the Arduino Nano with a shrouded 2x5 IDC box header for the BDM cable. No other components are needed, the ECU supplies the pull-ups and everything runs at 5 V. The KiCad project is in the repository.
Pinout
10-pin CPU32 BDM header to Arduino pin. The plug goes on 1:1 with the red stripe at pin 1.
| BDM pin | Signal | Arduino | Description |
|---|---|---|---|
| 1 | DS | D8 | Not used by CPU32 BDM, wired for other targets |
| 2 | BERR | D6 | Bus error, input by default |
| 3 | GND | GND | |
| 4 | BKPT/DSCLK | D5 | Breakpoint / serial clock |
| 5 | GND | GND | |
| 6 | FREEZE | D4 | High when the target is in BDM |
| 7 | RESET | D7 | Driven low or released, never high |
| 8 | IFETCH/DSI | D3 | Data to target |
| 9 | VDD | A0 | Target voltage sense |
| 10 | IPIPE/DSO | D2 | Data from target |
BDM header, top view, pin 1 marked on the ECU board:
1 DS 2 BERR
3 GND 4 BKPT/DSCLK
5 GND 6 FREEZE
7 RESET 8 DSI
9 VDD 10 DSOFlashing the firmware
Build and upload with PlatformIO, or grab a prebuilt hex from the releases page and flash it with avrdude:
avrdude -c arduino -p m328pb -P /dev/ttyUSB0 -b 115200 -U flash:w:ardubdm-vX.hexStatus
Bench verified on Trionic 7 and Trionic 5.5: reading, erasing and flashing full images that match CombiAdapter reads byte for byte. Note that a Trionic 5 needs 14-15 V on the bench when flashing.
If you like the project please donate 💕