Unbricking a bricked TADA68

Arialdo Martini — 8/07/2020 — Mechanical Keyboards QMK

TL;DR

  1. Get an ISP Programmer
  2. Install avrdude
  3. Download a boatloader
  4. Connect the ISP Programmer to PC
  5. Disconnect the keybard from the PC
  6. Connect the PCB to the ISP Programmer
  7. Flash the bootloader

Why does TADA68 bricks

// TODO explain what does happens with Massdrop Loader

Repair a bricked TADA68

Get an ISP Programmer

As an ISP Programmer, go with USBasp or a USBasp clone. Look for the following:

USBasp USBISP 3.3V / 5V AVR Programmer USB ATMEGA8

I bought this one:

If you go with a different ISP programmer, you will probably need to modify accordingly the avrdude’s parameters.

Install avrdude

sudo pacman --sync avrdude

Download a bootloader

Several bootloaders are available. I tried the following 2:

MassDrop Bootloader

Download it from the repository https://github.com/Massdrop/mdloader:

The source code is available at:

MegaAVR DFU USB Bootloader

Download it from

  • http://ww1.microchip.com/downloads/en/DeviceDoc/megaUSB_DFU_Bootloaders.zip or
  • http://www.microchip.com/wwwproducts/en/ATMEGA32U4 under Documents -> Software

Unzip it. Then, use

ATMega32U4-usbdevice_dfu-1_0_0.hex

Disclaimer: I wasn’t able to make it work.

Disconnect the keybard from the PC

The keyboard needn’t be connected throught its USB cable. I’m not sure what would happen if the following steps are performed while the keyboard is connected. Disconnect it, just in case.

Connect the ISP Programmer to PC

That’s the hardest part. I needed the 2 hands of a second person.

I used the following set of test leads

https://www.amazon.it/gp/product/B088LN43JT/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1

which proved to be terrible.

// TODO add a photo of the TADA68 ISP’s pins // TODO add a photo of the test leads // TODO add a photo of the USBasp’s pins // TODO show the test leads claws // TODO explain how to get work around the claws

Flash the bootloader

Run:

sudo avrdude -c USBasp -p atmega32u4 -U flash:w:mass_bootloader_tada68.hex

It all takes about 10 seconds.

After that, disconnect the ISP programmer, and connect the keyboard to the PC with the ordinary USB cable.

Notes

avrdude has tons of parameters. We would use just 3 of them:

sudo avrdude -p {partno} -c {programmer} -U {config-file}
Parameter Meaning Value Reference
-p partno: the chip part atmega32u4 partno
-c programmer-id USBasp programmer-id
-U memory operation flash:w:${bootloaderHexFile} Memory operation

partno

partno should be the chip name.

For TADA68 it should be:

ATmega32U4

which corresponds to

m32u4

This could be inferred from:

avrdude -p \? 2>&1| grep ATmega32U4 
  m32u4    = ATmega32U4

programmer-id

I made it work using USBasp.

For what I got, a programmer is the electrical description of the ISP Programmer, including all its pins. Therefore, this parameter depends on the ISP programmer being used.

There is a large set rogrammers defined in /etc/avrdude.conf. If your programmer is not included there, it can be defined in a custom configuration file, and passed to avrdude via the -C option.

Memory operation

This is the operation to perform, together with its parameters. It’s specified with the -U option in avrdude. I used:

-U flash:w:${bootloaderHexFile}`

where bootloaderHexFile is the .hex file downloded in Download a bootloader

References