2016-03-25 Atreus Firmware Upgrade

When I got my keyboard, Phil Hagelberg wrote:

Since the keyboard is a bit older, it doesn’t have the latest firmware. You might be interested in updating it once you get it. The default layout has changed to one that has easier access to the arrow keys; you can see it here:
https://atreus.technomancy.us/tmk

https://atreus.technomancy.us/tmk

So, I downloaded a precompiled firmware from his page and got myself the pcbdown/qwerty file.

precompiled firmware

Next, I looked at the Quick Start instructions, got myself `avrdude` via Homebrew.

Quick Start

Homebrew

I ran into a problem trying to determine the `/dev` filename on my laptop. No entry would appear!

What I was missing is what Chris Goellner told me on the mailing list:

The trick is to run the:
ls /dev > /tmp/dev-on
during the 8 seconds when the boot loader is active.
ls /dev > /tmp/dev-on

So with `FN+ESC` `RET` I was able to get into the mode where the keyboard is no longer responsive for eight seconds. This is important: You know that you managed to reset the board when it no longer reacts.

Now I was ready to run the `ls` within eight seconds of resetting the keyboard. You can’t be too quick and you can’t be too slow. On the third attempt or so I finally got something:

alex@Megabombus:~$ diff /tmp/dev-off /tmp/dev-on
15a16
> cu.usbmodem641
192a194
> tty.usbmodem641

And then, a few attempts of this:

alex@Megabombus:~$ avrdude -p atmega32u4 -c avr109 -U flash:w:src/atreus-pcbdown-qwerty.hex -P /dev/cu.usbmodem641
avrdude: ser_open(): can't open device "/dev/cu.usbmodem641": No such file or directory

avrdude done.  Thank you.

But finally I got the timing somewhat right:

alex@Megabombus:~$ avrdude -p atmega32u4 -c avr109 -U flash:w:src/atreus-pcbdown-qwerty.hex -P /dev/cu.usbmodem641

Connecting to programmer: .avrdude: ser_drain(): read error: Device not configured
avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding

avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_drain(): read error: Device not configured
avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = ""; type = ?
    Software Version = ?.; Hardware Version =     .
avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: exit bootloader
avrdude: ser_close(): can't reset attributes for device: Device not configured

avrdude done.  Thank you.

That doesn’t look right! So I tried it again.

alex@Megabombus:~$ avrdude -p atmega32u4 -c avr109 -U flash:w:src/atreus-pcbdown-qwerty.hex -P /dev/cu.usbmodem641

Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
    Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x44

avrdude: AVR device initialized and ready to accept instructions

Reading | `#``#``#``#``#``#``#``#``#``#` | 100% 0.00s

avrdude: Device signature = 0x1e9587 (probably m32u4)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "src/atreus-pcbdown-qwerty.hex"
avrdude: input file src/atreus-pcbdown-qwerty.hex auto detected as Intel Hex
avrdude: writing flash (14938 bytes):

Writing | `#``#``#``#``#``#``#``#``#``#` | 100% 1.30s

avrdude: 14938 bytes of flash written
avrdude: verifying flash memory against src/atreus-pcbdown-qwerty.hex:
avrdude: load data flash data from input file src/atreus-pcbdown-qwerty.hex:
avrdude: input file src/atreus-pcbdown-qwerty.hex auto detected as Intel Hex
avrdude: input file src/atreus-pcbdown-qwerty.hex contains 14938 bytes
avrdude: reading on-chip flash data:

Reading | `#``#``#``#``#``#``#``#``#``#` | 100% 0.33s

avrdude: verifying ...
avrdude: 14938 bytes of flash verified

avrdude: safemode: Fuses OK (E:C8, H:D0, L:FF)

avrdude done.  Thank you.

Yay!

Except... My keyboard now seems to have the following layout:

p o i u z     t r e w q
ö l k j h     g f d s a
- . , m n     b v c x y
ret ä ' fn spc  bsp shift ctrl tab esc

This looks like reverse QWERTY! (With a Swiss German layout...)

I went back to the precompiled firmware page and got myself the standard/qwerty file, and tried again.

precompiled firmware

Things to note:

1. I had the wrong but updated firmware, to now the reset is `FN+ESC` `b` instead of `FN+ESC` `RET` (on the new layout!)

2. the `/dev` entry had changed from `/dev/cu.usbmodem641` to `/dev/cu.usbmodem411`

But it worked, eventually. But... same problem? Something is still wrong.

Another question to the list and Phil uploaded new firmware. And it worked! Success! 😄

​#Atreus ​#Keyboard

Comments

(Please contact me if you want to remove your comment.)

It is also important to note that atreus fork is 449 commits behind upstream. That is probably significant. Maybe there is a way to use upstream version?

There are complaints ¹ and attempts ² ³ to merge it, but these are kinda old. Interesting, what is going on?

¹

²

³

– AlexDaniel 2016-03-28 03:04 UTC

---

Apparently upstream is no longer taking new keyboards. ⁴

– Alex Schroeder 2016-03-28 14:41 UTC