Installing or unbricking a custom TADA68 bootloader using a Raspberry Pi

 

Disclaimer: I made this guide using information I found on the internet. It worked for me, but I can not and will not guarantee that this will work for you. Other keyboards with an ATmega32U4 will probably work as well as long as you wire it correctly.

So, you’re getting tired of that unstable mass storage bootloader on your TADA68? Yeah, me too, so let’s just get rid of it.

You’ll need:

  • A Raspberry Pi with internet connectivity
  • 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 these lines:

wget http://maartendekkers.com/wp-content/uploads/2017/07/avrdude.zip

To download the zip file including avrdude and the bootloader for the ATmega32U4.

unzip avrdude.zip

To unzip the file we just downloaded.

cd avrdude

To enter the folder called ‘avrdude’.

./install-raspbian

To run the install script which will install AVRDUDE. This build has been modified to use the GPIO as a programmer. This will take a while though so you can continue to the next step.

Step 2: Drivers and QMK Flasher

You can do something else while your Pi is busy with installing AVRDUDE. 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 unscrewing the screws under the tab, g, h, \, ←, ↓, the space bar, 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

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: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9587

avrdude: safemode: Fuses OK

avrdude done. Thank you.

Make a backup of your bootloader by running avrdude -c gpio -p atmega32u4 -b 19200 -U flash:r:./backup_flash.bin:r. If you want to revert to the mass storage bootloader, run avrdude -c gpio -p atmega32u4 -b 19200 -U flash:w:./backup_flash.bin.

Then, run avrdude -c gpio -p atmega32u4 -F -e -U flash:w:ATMega32U4-usbdevice_dfu-1_0_0.hex to flash Atmel’s bootloader, which should end with:

avrdude: verifying ...

avrdude: 32768 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.

Okay, that’s done. You can shut off your Pi by running sudo halt. 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 work, 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 .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. I have one request for you: I need the original bootloader. So if you did back it up, please send it to me so I can place it here for other people to use. (Or perhaps play around with it..)

No comments to be found.

Leave a Reply

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