Repairing the bootloader on the TADA68 using a Pi

The TADA68 is one amazing keyboard. Completely reprogrammable and PBT keycaps at just a hundred dollars! It’s not perfect though, because the bootloader is pretty weird. It’s over 4096 bytes big, which means it is not protected like a normal bootloader would be. Sometimes this goes wrong. Either something went wrong when flashing and flashing your .BIN file again fixes it, but in other cases the bootloader completely breaks. I had the former happen a lot of times so I wanted to replace the bootloader with something else.

Disclaimer: I am not responsible for any damage to your keyboard.

You’ll need:

  • A Raspberry Pi with only 26 pins and internet connectivity (40-pin models won’t work)
  • 6 jumper cables (either female-female with headers or female-male)
  • A keyboard to type on with while you’re flashing your other

Step 1: Setting up your Pi

First of all, make sure you have Raspbian (lite) installed on your sd-card. If not, you can find more information about installing Raspbian or another OS here.

Now this part is very important if you don’t have a screen attached to your Pi. There’s a drive called ‘boot’ when you insert the sd-card into your computer. Make a file called ‘ssh’ (no extension!). Then, start your Pi. You’ll see a device called ‘raspberrypi’ pop up in your router’s list of connected devices. Now connect to it using an SSH client (I like to use PuTTY) with the username ‘pi’ and the password ‘raspberry’.

When you’re logged in, enter this line:

curl https://maartendekkers.com/wp-content/uploads/2017/07/avrdude.sh | bash

This will download and install everything for you. The build has been modified to use the GPIO pins as a programmer. Installing will take a while though so you can continue to the next step.

Step 2: Drivers and QMK Flasher (for DFU bootloader)

Skip this step if you want the mass storage bootloader.

Download this zip file and extract it to your desktop or some other location where you can find it. You should also install QMK Flasher, because Atmel FLIP, the software made by Atmel to flash their chips, is horrendous. You’ll see a file called ‘QMK.Flasher.X.X.X.Installer.exe’. Download and open it, then follow the steps. Now there’s a downside to all of this: you won’t be able to use .BIN files like the ones you got from the Firmware Editor. Instead, we’ll be using .hex files. A .hex file with the standard TADA68 layout can be found here. For custom layouts I recommend EasyAVR or QMK Firmware if you like programming.

Step 3: Connecting the Pi to the TADA68

Take the PCB of your TADA68 out of its case by removing the screws under the tab, g, h, \, ←, ↓, space bar, left control and windows keys. Then flip it over.

ISP pins on the TADA68 for flashing bootloader

Here’s where you’re going to need those jumper cables. See the image above? Those holes are for programming the chip, the Atmel ATmega32u4. Here’s where you need to connect them on the Pi:

ISP connections on the Pi
These pins are the same of every model of the Raspberry Pi.

Step 4: Flashing!

Before we do anything, we have to make sure that the chip itself ain’t broken. Run avrdude -c gpio -p atmega32u4, which should output the following if everything’s alright:

avrdude: safemode: Fuses OK

avrdude done. Thank you.

Then, run avrdude -c gpio -p atmega32u4 -F -e -U flash:w:ATMega32U4-usbdevice_dfu-1_0_0.hex to flash the DFU bootloader or avrdude -c gpio -p atmega32u4 -F -e -U flash:w:mass_bootloader_tada68.hex to flash the mass storage bootloader, which should end with:

avrdude: safemode: Fuses OK

avrdude done. Thank you.

You can shut off your Pi by running sudo halt. You’re done now if you flashed the mass storage bootloader. There are some things you’ll have to do if you flashed the DFU bootloader. Remember that you downloaded those drivers? You’re going to need them now. Detach the cables attached to your PCB and Pi, and connect your TADA68 to your computer. It’s not going to type, because installing a new bootloader erased the flash storage. Right-click the Windows button on the taskbar, and open ‘Device Manager’. If you see an ATmega32U4 with an exclamation mark, that means you have to install the drivers. Right-click it, click ‘Update driver’ and press ‘Browse my computer for driver software’. Click browse, select the folder called ‘usb’ which you downloaded earlier and click ‘Next’. It’s going to ask you if you trust the software, just click yes.

Now open QMK Flasher and press ‘Choose .hex’. Choose your layout .hex file and press ‘Flash keyboard’. You should hear the sound of a device connecting. Now try typing on your TADA68!

Afterword

I hope this guide was useful to you. If you have a question or feedback, feel free to send me an e-mail or leave a comment.

6 responses to “Repairing the bootloader on the TADA68 using a Pi”

  1. Maxwell says:

    Thank you Maarten Dekkers for this write up!

    I am in the process of unbricking my TADA68 myself. I was wondering if I backup the bootloader and restore it using AVRDude, would it unbrick it? I prefer using the original mass storage to flash my firmware

    • maartenwut says:

      Hey Max, fortunately I recently purchased a new PCB for my TADA68 and got the original bootloader. I updated this guide accordingly. And no, making a copy of something broken won’t fix it.

  2. Bob Vork says:

    Hi Maarten,

    I got my tada68 this morning, and managed to brick it within 20 minutes. I already had a Raspberry pi, so I got some jumper cables and want to follow your guide. The problem is, my Pi has more pins than yours does in the picture. I tried matching the pins with https://pinout.xyz/pinout/pin2_5v_power, but not everything matches. When I run the avrdude check, it says “AVR device not responding”. Any tips on how to find the right pins?

Leave a Reply

Your email address will not be published. Required fields are marked *