Trouble flashing the Model 01 from Ubuntu

Hello, I’ve just received my Model01, and I was trying to update the firmware as explained here https://github.com/keyboardio/Model01-Firmware/blob/master/README.md

I installed the arduino ide, cloned all the repositories, added myself to the dialout group, but when i run “make flash”, i get the following errors:

albx@garak:~/Arduino/Model01-Firmware$ make flash
ls: cannot access '/home/albx/.arduino15/packages/keyboardio/hardware/avr/*': No such file or directory
BOARD_HARDWARE_PATH="/home/albx/Arduino/hardware" /home/albx/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/bin//kaleidoscope-builder flash
Building output/Model01-Firmware/Model01-Firmware (0.0.0-gv1.13-55-g8ab1) ...
Press ENTER when ready...

avrdude: ser_open(): can't open device "/dev/ttyACM0": No such file or directory
Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding

avrdude: butterfly_recv(): programmer is not responding

then make is just stuck there, until i hit ctrl-C.

the “missing” file is actually present, and i even made it world-writable just in case:

$ ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Oct 20 18:02 /dev/ttyACM0

any ideas?

thanks

1 Like

A few things to check:

  • Are you holding the PROG key when hitting Enter?
  • Is there anything interesting in dmesg output, by any chance?
  • Are you holding down the ‘Prog’ key when you “make flash”?
  • Have you logged in and out (which you may need to get the new group membership picked up)?
  • Is ModemManager installed on your system? If so, it may be trying to take over the serial port.

that was is! it was ModemManager. I removed it, and I was able to flash
the keyboard without problems!

thanks

Alberto

1 Like

Since I have pretty much given up trying to flash it on Windows, I installed the latest Ubuntu on Virtual Box and followed the linux guide to install and flash the firmware.

aaaaaa@aaaaaa-VirtualBox:~/Arduino/Model01-Firmware$ make flash
ls: cannot access ‘/home/aaaaaa/.arduino15/packages/keyboardio/hardware/avr/*’: No such file or directory
BOARD_HARDWARE_PATH="/home/aaaaaa/Arduino/hardware" /home/aaaaaa/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/bin//kaleidoscope-builder flash
Building output/Model01-Firmware/Model01-Firmware (0.0.0-gv1.13-55-g8ab1) …
Press ENTER when ready…

avrdude: ser_open(): can’t open device “-b57600”: No such file or directory
avrdude: ser_open(): can’t open device “-b57600”: No such file or directory
/home/aaaaaa/Arduino/hardware/keyboardio/avr/build-tools/makefiles//rules.mk:75: recipe for target ‘flash’ failed
make: *** [flash] Error 1

Why would it interpret the baud rate as the device lol

Trying to flash the firmware on virtualbox ubuntu using the arduino ide this time with the modemmanager being removed:

Sketch uses 18152 bytes (63%) of program storage space. Maximum is 28672 bytes.
Global variables use 1659 bytes (64%) of dynamic memory, leaving 901 bytes for local variables. Maximum is 2560 bytes.
Forcing reset using 1200bps open/close on port /dev/ttyACM0
PORTS {/dev/ttyACM0, } / {/dev/ttyACM0, } => {}
PORTS {/dev/ttyACM0, } / {/dev/ttyACM0, } => {}
PORTS {/dev/ttyACM0, } / {/dev/ttyACM0, } => {}
PORTS {/dev/ttyACM0, } / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {/dev/ttyACM0, } => {/dev/ttyACM0, }
Found upload port: /dev/ttyACM0
/usr/local/arduino/hardware/tools/avr/bin/avrdude -C/usr/local/arduino/hardware/tools/avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D -Uflash:w:/tmp/arduino_build_488698/Model01-Firmware.ino.hex:i

avrdude: Version 6.3, compiled on Jan 17 2017 at 11:00:16
Copyright © 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright © 2007-2014 Joerg Wunsch

    System wide configuration file is "/usr/local/arduino/hardware/tools/avr/etc/avrdude.conf"
     User configuration file is "/home/aaaaaa/.avrduderc"
     User configuration file does not exist or is not a regular file, skipping

     Using Port                    : /dev/ttyACM0
     Using Programmer              : avr109
     Overriding Baud Rate          : 57600
     AVR Part                      : ATmega32U4
     Chip Erase delay              : 9000 us
     PAGEL                         : PD7
     BS2                           : PA0
     RESET disposition             : dedicated
     RETRY pulse                   : SCK
     serial program mode           : yes
     parallel program mode         : yes
     Timeout                       : 200
     StabDelay                     : 100
     CmdexeDelay                   : 25
     SyncLoops                     : 32
     ByteDelay                     : 0
     PollIndex                     : 3
     PollValue                     : 0x53
     Memory Detail                 :

                              Block Poll               Page                       Polled
      Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom        65    20     4    0 no       1024    4      0  9000  9000 0x00 0x00
       flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
       lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
    Programmer Type : butterfly
     Description     : Atmel AppNote AVR109 Boot Loader

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 = “”; type =
Software Version = . ; Hardware Version = .
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

Thats frustrating.
And yes I’m holding down the prog key. If only it was so easy.

Do I have to “Upload using the programmer”? Not that it helps, I tried it and it failed. The docs say to use “the upload button for your sketch (or something)” in the Arduino IDE, which refers to the normal Upload I guess. When I do the normal upload, it says “avrdude: butterfly_recv(): programmer is not responding”. So maybe it should be uploaded using the programmer after all? But then again, you can select different programmers in the Tools->Programmer menu. None of which work anyway.

I don’t believe that flashing from within VirtualBox is going to go well, especially if the issue you’re running into is that the serial port isn’t going to show up. The way that VirtualBox, VMWare, etc work is that they end up ‘proxying’ for the hardware.

What you saw in the first message is that it couldn’t find the tty device.

The second one on Ubuntu …looks more correct, but I suspect that what you’re seeing is Windows re-grabbing the keyboard when it reboots into the bootloader.

You don’t want to upload using a programmer. That’s for using another hardware device (a programmer) to reflash the device over the pin headers hidden inside.

I suspect we’re going to be better off figuring out your Windows 7 issues.

1 Like

So I managed to successfully flash the Model01 from Ubuntu in a VM on Windows 8 (because I too found the driver issues with windows painful) and figured out what needed to happen.

In virtualbox, I added the keyboard to the USB device filter list. I then unplugged in and plugged it back in again while holding prog (starting it in bootloader mode), and very quickly added that Model01 to the usb device filter list as well. Windows seems to recognize them as two distinct devices, once virtualbox knows to grab both of them, the flash succeeded.

My USB filter list looked like this: https://i.imgur.com/BlT4gZx.png

The one under 0100 was the keyboard, 0001 was the device in bootloader mode.

Worth noting that this model01 was running the very first version of firmware they shipped with, and the USB filter list no longer recognized it after the flash, but repeating the process above again seems to allow me to make other changes to the firmware, flash, and have it still be recognized. I’m uncertain what changed between the two firmware versions, but I would wager this would work indefinitely for 99% of firmware modifications people would want to make.

@rumpel, for posterity.

2 Likes