Arch Linux: Arduino: Flashing firmware: Unresponsive keyboard (SOLVED)

Oh darn… I’ve had the keyboard for only a few hours and it appears to be “bricked” now. I was changing some key mappings and obviously messed something up while it was flashing.

No response when plugged in normally. Not in lsusb.
When holding prog key and plugging in, the prog key lights up. (good). Still not in lsusb.

In either case I cannot get the firmware restored from the Arduino IDE and the result is the same.

Pasting image because copying the text from Arduino IDE doesn’t seem to work properly (missing lines):

Screenshot_2017-11-03_18-06-21

The good news is, bricking your keyboard is hard. Even if you mess something up in your firmware, and the keyboard crashes as soon as it boots, it is still not bricked. (Although lsusb not showing anything is a bit worrying, but lets not despair just yet!)

If all else fails, there’s a hardware reset button under the enclosure of the left half. You can try taking the enclosure off, and pressing that button (if I remember correctly, it should be around the extension headers; it’s hard to miss, but it is a small little button), and try flashing then. You do not need to hold the PROG key in this case.

I would suggest re-flashing the factory firmware to hopefully restore the keyboard to a working state, and go from there.

2 Likes

How do I go about re-flashing the factory firmware, other than what I’m trying in the IDE?

I believe the difference from what you’re trying would be

  1. load the factory firmware into the IDE
  2. open up the left-half enclosure to get at the reset button
  3. instead of holding the Prog button when you click upload in the IDE, push the reset button

You probably want to email help@keyboard.io, though. I’m admittedly not an expert. Also, Jesse mentioned in the IRC channel that email was the best way to reach him this weekend.

2 Likes

You shouldn’t need to hit the reset button. Flashing problem on Ubuntu (SOLVED) may give you what you need.

i’m mostly offline this weekend but happy to help on Monday.

2 Likes
% avrdude -patmega32u4 -cavr109 -D -P /dev/ttyS0 -b57600 -Uflash:w:atmega32u4_firmware.hex:i

Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding

avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = "F"; type = �
    Software Version = {.; Hardware Version = H.V
avrdude: butterfly_recv(): programmer is not responding
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: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: exit bootloader

avrdude done.  Thank you.

Same thing after pressing the reset button.

I tried plugging it into a Windows machine. I couldn’t get Arduino to see any port. When I plugged it in with no Prog press, nothing happened. No detection by the OS. When I plugged it in holding Prog, it detected it (notification said something about Model 01) but then after 2-3 seconds it made the “device unplugged” sound. I couldn’t see any COM port in Arduino IDE (greyed out).

What version of Windows? If Win 7, 8, or 8.1 you will need to manually install the necessary USB Driver. See Installing USB Driver on Windows

Windows 10, so that shouldn’t be the problem.
Nothing working so far, but thank you all for the suggestions. The keyboard was working great before I started messing around with the layout / flashing, so I’m pretty confident there’s an “easy” fix…

Perhaps your having just flashed it is a red herring (in that the “real” problem just surfaced right after you did such). In the vein of an “easy fix” try:

  1. A different USB cable. There have been reports of one or two bad cables. But when doing so be aware of the issue that some third party cables don’t quite fit right due to the recessing of the USB connection port. A cable with a large “head” may not push all the way in. See this thread for some detail.
  2. Take a look at this post about Misaligned USB Ports

Hmm, prog light comes on (and stays on) so I didn’t think it was the cable. I’ll double check though!

1 Like

Tried with different cable, same thing.

When I plug it in under “prog” mode, it does show up in lsusb, but only very briefly:

Bus 002 Device 027: ID 1209:2300 InterBiometrics Keyboardio Keyboardio Model 01 Bootloader

udevadm monitor:

% udevadm monitor --subsystem-match=usb --property
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[64464.973940] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
ACTION=add
BUSNUM=002
DEVNAME=/dev/bus/usb/002/028
DEVNUM=028
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2
DEVTYPE=usb_device
MAJOR=189
MINOR=155
PRODUCT=1209/2300/1
SEQNUM=4929
SUBSYSTEM=usb
TYPE=2/0/0

KERNEL[64464.974581] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0
DEVTYPE=usb_interface
INTERFACE=2/2/1
MODALIAS=usb:v1209p2300d0001dc02dsc00dp00ic02isc02ip01in00
PRODUCT=1209/2300/1
SEQNUM=4930
SUBSYSTEM=usb
TYPE=2/0/0

KERNEL[64464.976482] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.1 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.1
DEVTYPE=usb_interface
DRIVER=cdc_acm
INTERFACE=10/0/0
MODALIAS=usb:v1209p2300d0001dc02dsc00dp00ic0Aisc00ip00in01
PRODUCT=1209/2300/1
SEQNUM=4932
SUBSYSTEM=usb
TYPE=2/0/0

UDEV  [64465.542707] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
ACTION=add
BUSNUM=002
DEVNAME=/dev/bus/usb/002/028
DEVNUM=028
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2
DEVTYPE=usb_device
DRIVER=usb
ID_BUS=usb
ID_MM_DEVICE_IGNORE=1
ID_MODEL=Model_01
ID_MODEL_ENC=Model\x2001\x20
ID_MODEL_FROM_DATABASE=Keyboardio Keyboardio Model 01 Bootloader
ID_MODEL_ID=2300
ID_REVISION=0001
ID_SERIAL=Keyboardio_Model_01_kbio01
ID_SERIAL_SHORT=kbio01
ID_USB_INTERFACES=:020201:0a0000:
ID_VENDOR=Keyboardio
ID_VENDOR_ENC=Keyboardio\x20
ID_VENDOR_FROM_DATABASE=InterBiometrics
ID_VENDOR_ID=1209
MAJOR=189
MINOR=155
PRODUCT=1209/2300/1
SEQNUM=4929
SUBSYSTEM=usb
TYPE=2/0/0
USEC_INITIALIZED=64464984151

UDEV  [64465.548183] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
.MM_USBIFNUM=00
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0
DEVTYPE=usb_interface
DRIVER=cdc_acm
ID_MODEL_FROM_DATABASE=Keyboardio Keyboardio Model 01 Bootloader
ID_USB_CLASS_FROM_DATABASE=Communications
ID_VENDOR_FROM_DATABASE=InterBiometrics
INTERFACE=2/2/1
MODALIAS=usb:v1209p2300d0001dc02dsc00dp00ic02isc02ip01in00
PRODUCT=1209/2300/1
SEQNUM=4930
SUBSYSTEM=usb
TYPE=2/0/0
USEC_INITIALIZED=64465547405
adb_user=yes

UDEV  [64465.549801] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.1 (usb)
.MM_USBIFNUM=01
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.1
DEVTYPE=usb_interface
DRIVER=cdc_acm
ID_MODEL_FROM_DATABASE=Keyboardio Keyboardio Model 01 Bootloader
ID_USB_CLASS_FROM_DATABASE=Communications
ID_VENDOR_FROM_DATABASE=InterBiometrics
INTERFACE=10/0/0
MODALIAS=usb:v1209p2300d0001dc02dsc00dp00ic0Aisc00ip00in01
PRODUCT=1209/2300/1
SEQNUM=4932
SUBSYSTEM=usb
TYPE=2/0/0
USEC_INITIALIZED=64465549101
adb_user=yes

KERNEL[64472.599765] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0
DEVTYPE=usb_interface
INTERFACE=2/2/1
MODALIAS=usb:v1209p2300d0001dc02dsc00dp00ic02isc02ip01in00
PRODUCT=1209/2300/1
SEQNUM=4934
SUBSYSTEM=usb
TYPE=2/0/0

KERNEL[64472.599983] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.1 (usb)
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.1
DEVTYPE=usb_interface
INTERFACE=10/0/0
MODALIAS=usb:v1209p2300d0001dc02dsc00dp00ic0Aisc00ip00in01
PRODUCT=1209/2300/1
SEQNUM=4935
SUBSYSTEM=usb
TYPE=2/0/0

KERNEL[64472.600339] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
ACTION=remove
BUSNUM=002
DEVNAME=/dev/bus/usb/002/028
DEVNUM=028
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2
DEVTYPE=usb_device
MAJOR=189
MINOR=155
PRODUCT=1209/2300/1
SEQNUM=4936
SUBSYSTEM=usb
TYPE=2/0/0

UDEV  [64472.603925] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.1 (usb)
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.1
DEVTYPE=usb_interface
ID_MODEL_FROM_DATABASE=Keyboardio Keyboardio Model 01 Bootloader
ID_USB_CLASS_FROM_DATABASE=Communications
ID_VENDOR_FROM_DATABASE=InterBiometrics
INTERFACE=10/0/0
MODALIAS=usb:v1209p2300d0001dc02dsc00dp00ic0Aisc00ip00in01
PRODUCT=1209/2300/1
SEQNUM=4935
SUBSYSTEM=usb
TYPE=2/0/0
USEC_INITIALIZED=64465549101
adb_user=yes

UDEV  [64472.604873] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0
DEVTYPE=usb_interface
ID_MODEL_FROM_DATABASE=Keyboardio Keyboardio Model 01 Bootloader
ID_USB_CLASS_FROM_DATABASE=Communications
ID_VENDOR_FROM_DATABASE=InterBiometrics
INTERFACE=2/2/1
MODALIAS=usb:v1209p2300d0001dc02dsc00dp00ic02isc02ip01in00
PRODUCT=1209/2300/1
SEQNUM=4934
SUBSYSTEM=usb
TYPE=2/0/0
USEC_INITIALIZED=64465547405
adb_user=yes

UDEV  [64472.622522] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
ACTION=remove
BUSNUM=002
DEVNAME=/dev/bus/usb/002/028
DEVNUM=028
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2
DEVTYPE=usb_device
ID_BUS=usb
ID_MM_DEVICE_IGNORE=1
ID_MODEL=Model_01
ID_MODEL_ENC=Model\x2001\x20
ID_MODEL_FROM_DATABASE=Keyboardio Keyboardio Model 01 Bootloader
ID_MODEL_ID=2300
ID_REVISION=0001
ID_SERIAL=Keyboardio_Model_01_kbio01
ID_SERIAL_SHORT=kbio01
ID_USB_INTERFACES=:020201:0a0000:
ID_VENDOR=Keyboardio
ID_VENDOR_ENC=Keyboardio\x20
ID_VENDOR_FROM_DATABASE=InterBiometrics
ID_VENDOR_ID=1209
MAJOR=189
MINOR=155
PRODUCT=1209/2300/1
SEQNUM=4936
SUBSYSTEM=usb
TYPE=2/0/0
USEC_INITIALIZED=64464984151
adb_user=yes```
1 Like

In case it helps, here’s my writeup on how you can setup on Arch Linux/checkout the factory firmware and flash it all w/o touching the Arduino IDE: Problems getting started reflashing model 01 on Arch Linux

2 Likes
BOARD_HARDWARE_PATH="/home/z/.arduino15/packages/keyboardio/hardware/avr/1.19.0" /home/z/.arduino15/packages/keyboardio/hardware/avr/1.19.0/libraries/Kaleidoscope/bin//kaleidoscope-builder flash
Building output/Model01-Firmware/Model01-Firmware (0.0.0-gv1.13-60-g8f58) ...
/home/z/.arduino15/packages/keyboardio/hardware/avr/1.19.0/libraries/KeyboardioScanner/twi.c: In function '__vector_36':
/home/z/.arduino15/packages/keyboardio/hardware/avr/1.19.0/libraries/KeyboardioScanner/twi.c:446:47: warning: this statement may fall through [-Wimplicit-fallthrough=]
     twi_masterBuffer[twi_masterBufferIndex++] = TWDR;
                                               ^
/home/z/.arduino15/packages/keyboardio/hardware/avr/1.19.0/libraries/KeyboardioScanner/twi.c:447:3: note: here
   case TW_MR_SLA_ACK:  // address sent, ack received
   ^~~~
Press ENTER when ready...

stty: 1200: No such file or directory
make: *** [/home/z/.arduino15/packages/keyboardio/hardware/avr/1.19.0/build-tools/makefiles//rules.mk:75: flash] Error 1
sh make.sh  9.54s user 1.30s system 38% cpu 28.147 total

Here’s my results…

Jesse suggested that even the few seconds I was getting the keyboard recognized over USB would be enough to flash the firmware again with avrdude. It was! I just had to get the correct port.

  1. I have Arduino IDE open while I plug in the keyboard (holding prog key).
  2. Check the ports drop down in Arduino repeatedly to find the port, which only shows for a second.
  • The port is /dev/ttyACM0
  1. Get this command ready to go in the console:
    avrdude -patmega32u4 -cavr109 -D -P /dev/ttyACM0 -b57600 -Uflash:w:atmega32u4_firmware.hex:i
  2. Plug in keyboard again (holding prog key) and run command immediately.
  3. Found programmer. Writing flash. Reading flash. Success!

Typing this on the keyboard right now! :smile:

6 Likes