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.

ArduBDM PCB with Arduino Nano and BDM header

Download firmware · Source on GitHub

Features

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 pinSignalArduinoDescription
1DSD8Not used by CPU32 BDM, wired for other targets
2BERRD6Bus error, input by default
3GNDGND
4BKPT/DSCLKD5Breakpoint / serial clock
5GNDGND
6FREEZED4High when the target is in BDM
7RESETD7Driven low or released, never high
8IFETCH/DSID3Data to target
9VDDA0Target voltage sense
10IPIPE/DSOD2Data 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 DSO

Flashing 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.hex

Status

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 💕