-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea5a166
commit eb6aec7
Showing
2 changed files
with
297 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,296 @@ | ||
--- | ||
layout: post | ||
title: "Unbricking a bricked TADA68" | ||
author: <a href="https://arialdomartini.github.io">Arialdo Martini</a> | ||
tags: | ||
- Mechanical Keyboards | ||
- QMK | ||
--- | ||
### TL;DR | ||
|
||
1. [Get an ISP Programmer](#get-an-isp-programmer) | ||
2. [Install avrdude](#Install-avrdude) | ||
3. [Download a boatloader](#Download-a-bootloader) | ||
4. [Connect the ISP Programmer to PC](#connect-the-isp-programmer-to-pc) | ||
5. [Disconnect the keybard from the PC](#disconnect-the-keyboard-from-the-pc) | ||
6. Connect the PCB to the ISP Programmer | ||
7. [Flash the bootloader](#Flash the bootloader) | ||
|
||
<!--more--> | ||
# 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 | ||
* [eBay.com - 3.3V / 5V USBASP USBISP AVR Programmer ATMEGA8](https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2380057.m570.l1313.TR0.TRC0.A0.H0.X3.3V+%2F+5V+USBASP+USBISP+AVR+Programmer+ATMEGA8.TRS1&_nkw=3.3V+%2F+5V+USBASP+USBISP+AVR+Programmer+ATMEGA8&_sacat=0) | ||
|
||
I bought this one: | ||
|
||
* [amazon.it - ILS - 3.3V / 5V USBASP USBISP AVR programmer for ATMEGA8 ATMEGA128](https://www.amazon.it/gp/product/B07ZP25N7R/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1) | ||
|
||
If you go with a different ISP programmer, you will probably need to modify accordingly the `avrdude`'s parameters. | ||
|
||
## Install avrdude | ||
|
||
```bash | ||
sudo pacman --sync avrdude | ||
``` | ||
|
||
## Download a bootloader | ||
Several bootloaders are available. | ||
|
||
[Mass Bootloader](#mass-bootloader) is the factory installed bootloader. It's not the best option, as it is deleted when the keyboard is ejected while in flash mode. | ||
|
||
|
||
|
||
### Massfrop Bootloader | ||
Download it from: | ||
|
||
https://github.com/rwilbur/tada68-bootloader-restore/raw/master/mass_bootloader_tada68.hex | ||
|
||
The source code is available at: | ||
|
||
https://github.com/rwilbur/tada68-bootloader-restore | ||
|
||
|
||
https://github.com/Massdrop/mdloader | ||
|
||
### MegaAVR DFU USB Bootloaders | ||
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 | ||
|
||
```bash | ||
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: | ||
|
||
```bash | ||
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: | ||
|
||
```bash | ||
sudo avrdude -c {programmer} -p {partno} -U {config-file} | ||
``` | ||
| Parameter | Meaning | Value | Reference | | ||
|:----------|:----------------------|:-------------------------------|---------------------------------------| | ||
| `-p` | partno: the chip part | `atmega32u4` | [partno](#partno) | | ||
| `-c` | programmer-id | `USBasp` | [programmer-id](#programmer-id) | | ||
| `-U` | memory operation | `flash:w:${bootloaderHexFile}` | [Memory operation](#memory-operation) | | ||
|
||
## partno | ||
`partno` should be the chip name. | ||
|
||
For TADA68 it *should* be: | ||
|
||
```bash | ||
ATmega32U4 | ||
``` | ||
|
||
which corresponds to | ||
|
||
```bash | ||
m32u4 | ||
``` | ||
|
||
This could be inferred from: | ||
|
||
```bash | ||
avrdude -p \? 2>&1| grep ATmega32U4 | ||
m32u4 = ATmega32U4 | ||
``` | ||
|
||
## programmer-id | ||
Programmer *should* be `m32u2` or `m32u4`. `m32u4` seems to be not available in `/etc/avrdude.conf` | ||
|
||
```bash | ||
$grep "# ATmega32U" -A 15 /etc/avrdude.conf | ||
|
||
# ATmega32U2 | ||
#------------------------------------------------------------ | ||
# Changes against AT90USB162 (beside IDs) | ||
# memory "flash" | ||
# size = 32768; | ||
# num_pages = 256; | ||
# memory "eeprom" | ||
# size = 1024; | ||
# num_pages = 256; | ||
part | ||
id = "m32u2"; | ||
desc = "ATmega32U2"; | ||
has_jtag = no; | ||
has_debugwire = yes; | ||
signature = 0x1e 0x95 0x8a; | ||
usbpid = 0x2ff0; | ||
|
||
``` | ||
|
||
The programmer *should* be | ||
|
||
```bash | ||
avrdude -c help | ||
``` | ||
|
||
```bash | ||
|
||
Valid programmers are: | ||
2232HIO = FT2232H based generic programmer | ||
4232h = FT4232H based generic programmer | ||
89isp = Atmel at89isp cable | ||
abcmini = ABCmini Board, aka Dick Smith HOTCHIP | ||
alf = Nightshade ALF-PgmAVR, http://nightshade.homeip.net/ | ||
arduino = Arduino | ||
arduino-ft232r = Arduino: FT232R connected to ISP | ||
atisp = AT-ISP V1.1 programming cable for AVR-SDK1 from <http://micro-research.co.th/> | ||
atmelice = Atmel-ICE (ARM/AVR) in JTAG mode | ||
atmelice_dw = Atmel-ICE (ARM/AVR) in debugWIRE mode | ||
atmelice_isp = Atmel-ICE (ARM/AVR) in ISP mode | ||
atmelice_pdi = Atmel-ICE (ARM/AVR) in PDI mode | ||
avr109 = Atmel AppNote AVR109 Boot Loader | ||
avr910 = Atmel Low Cost Serial Programmer | ||
avr911 = Atmel AppNote AVR911 AVROSP | ||
avrftdi = FT2232D based generic programmer | ||
avrisp = Atmel AVR ISP | ||
avrisp2 = Atmel AVR ISP mkII | ||
avrispmkII = Atmel AVR ISP mkII | ||
avrispv2 = Atmel AVR ISP V2 | ||
bascom = Bascom SAMPLE programming cable | ||
blaster = Altera ByteBlaster | ||
bsd = Brian Dean's Programmer, http://www.bsdhome.com/avrdude/ | ||
buspirate = The Bus Pirate | ||
buspirate_bb = The Bus Pirate (bitbang interface, supports TPI) | ||
butterfly = Atmel Butterfly Development Board | ||
butterfly_mk = Mikrokopter.de Butterfly | ||
bwmega = BitWizard ftdi_atmega builtin programmer | ||
C232HM = FT232H based module from FTDI and Glyn.com.au | ||
c2n232i = serial port banging, reset=dtr sck=!rts mosi=!txd miso=!cts | ||
dapa = Direct AVR Parallel Access cable | ||
dasa = serial port banging, reset=rts sck=dtr mosi=txd miso=cts | ||
dasa3 = serial port banging, reset=!dtr sck=rts mosi=txd miso=cts | ||
diecimila = alias for arduino-ft232r | ||
dragon_dw = Atmel AVR Dragon in debugWire mode | ||
dragon_hvsp = Atmel AVR Dragon in HVSP mode | ||
dragon_isp = Atmel AVR Dragon in ISP mode | ||
dragon_jtag = Atmel AVR Dragon in JTAG mode | ||
dragon_pdi = Atmel AVR Dragon in PDI mode | ||
dragon_pp = Atmel AVR Dragon in PP mode | ||
dt006 = Dontronics DT006 | ||
ere-isp-avr = ERE ISP-AVR <http://www.ere.co.th/download/sch050713.pdf> | ||
flip1 = FLIP USB DFU protocol version 1 (doc7618) | ||
flip2 = FLIP USB DFU protocol version 2 (AVR4023) | ||
frank-stk200 = Frank STK200 | ||
ft232r = FT232R Synchronous BitBang | ||
ft245r = FT245R Synchronous BitBang | ||
futurlec = Futurlec.com programming cable. | ||
jtag1 = Atmel JTAG ICE (mkI) | ||
jtag1slow = Atmel JTAG ICE (mkI) | ||
jtag2 = Atmel JTAG ICE mkII | ||
jtag2avr32 = Atmel JTAG ICE mkII im AVR32 mode | ||
jtag2dw = Atmel JTAG ICE mkII in debugWire mode | ||
jtag2fast = Atmel JTAG ICE mkII | ||
jtag2isp = Atmel JTAG ICE mkII in ISP mode | ||
jtag2pdi = Atmel JTAG ICE mkII PDI mode | ||
jtag2slow = Atmel JTAG ICE mkII | ||
jtag3 = Atmel AVR JTAGICE3 in JTAG mode | ||
jtag3dw = Atmel AVR JTAGICE3 in debugWIRE mode | ||
jtag3isp = Atmel AVR JTAGICE3 in ISP mode | ||
jtag3pdi = Atmel AVR JTAGICE3 in PDI mode | ||
jtagkey = Amontec JTAGKey, JTAGKey-Tiny and JTAGKey2 | ||
jtagmkI = Atmel JTAG ICE (mkI) | ||
jtagmkII = Atmel JTAG ICE mkII | ||
jtagmkII_avr32 = Atmel JTAG ICE mkII im AVR32 mode | ||
lm3s811 = Luminary Micro LM3S811 Eval Board (Rev. A) | ||
mib510 = Crossbow MIB510 programming board | ||
mkbutterfly = Mikrokopter.de Butterfly | ||
nibobee = NIBObee | ||
o-link = O-Link, OpenJTAG from www.100ask.net | ||
openmoko = Openmoko debug board (v3) | ||
pavr = Jason Kyle's pAVR Serial Programmer | ||
pickit2 = MicroChip's PICkit2 Programmer | ||
picoweb = Picoweb Programming Cable, http://www.picoweb.net/ | ||
pony-stk200 = Pony Prog STK200 | ||
ponyser = design ponyprog serial, reset=!txd sck=rts mosi=dtr miso=cts | ||
siprog = Lancos SI-Prog <http://www.lancos.com/siprogsch.html> | ||
sp12 = Steve Bolt's Programmer | ||
stk200 = STK200 | ||
stk500 = Atmel STK500 | ||
stk500hvsp = Atmel STK500 V2 in high-voltage serial programming mode | ||
stk500pp = Atmel STK500 V2 in parallel programming mode | ||
stk500v1 = Atmel STK500 Version 1.x firmware | ||
stk500v2 = Atmel STK500 Version 2.x firmware | ||
stk600 = Atmel STK600 | ||
stk600hvsp = Atmel STK600 in high-voltage serial programming mode | ||
stk600pp = Atmel STK600 in parallel programming mode | ||
ttl232r = FTDI TTL232R-5V with ICSP adapter | ||
tumpa = TIAO USB Multi-Protocol Adapter | ||
UM232H = FT232H based module from FTDI and Glyn.com.au | ||
uncompatino = uncompatino with all pairs of pins shorted | ||
usbasp = USBasp, http://www.fischl.de/usbasp/ | ||
usbasp-clone = Any usbasp clone with correct VID/PID | ||
usbtiny = USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/ | ||
wiring = Wiring | ||
xil = Xilinx JTAG cable | ||
xplainedmini = Atmel AVR XplainedMini in ISP mode | ||
xplainedmini_dw = Atmel AVR XplainedMini in debugWIRE mode | ||
xplainedpro = Atmel AVR XplainedPro in JTAG mode | ||
|
||
``` | ||
|
||
|
||
## Memory operation | ||
|
||
```bash | ||
flash:w:${bootloaderHexFile}` | ||
``` | ||
|
||
where `${bootloaderHexFile}` is the `.hex` file downloded in [Download bootloader](#download-bootloader) | ||
|
||
|
||
|
||
|
||
# References | ||
|
||
* [Bricked TADA68 and How I Fixed it - A Novice's Tale](https://www.reddit.com/r/MechanicalKeyboards/comments/66sji0/bricked_tada68_and_how_i_fixed_it_a_novices_tale/) | ||
* [Flashing bootloaders on AVR](https://deskthority.net/wiki/Flashing_bootloaders_on_AVR) | ||
* [How to un-brick Tada68 with Raspberry Pi](https://www.reddit.com/r/MechanicalKeyboards/comments/fu7rc0/how_to_unbrick_tada68_with_raspberry_pi/) | ||
* [[help] working on un-bricking my tada68, i think i'm close. help with the next step?](https://www.reddit.com/r/MechanicalKeyboards/comments/934jo0/help_working_on_unbricking_my_tada68_i_think_im/) | ||
|