A little feedback for the firmware docs

Hi.

After some serious typing practice, I felt like diving into some firmware hacking because I wanted an INS key and get rid off the CMD key.

So I followed the instructions here: https://github.com/keyboardio/Model01-Firmware/blob/master/README.md

  1. After opening the Model01-Firmware.ino file in the Arduino IDE and hitting the Verify-Button, I got an error message saying that (IIRC) “Kaleidoscope.h” could not be found. Looking through the menus searching for a way to add additional include paths, I came across Tools -> Board. Choosing “keyboardio Model 01” here fixed the error.

  2. Clicking on “Verify” again, I get a scary warning message:
    Sketch uses 19600 bytes (68%) of program storage space. Maximum is 28672 bytes.
    Global variables use 1997 bytes (78%) of dynamic memory, leaving 563 bytes for local variables. Maximum is 2560 bytes.
    Low memory available, stability problems may occur.

This is scary enough for me to just stop right now.

  1. Trying “make flash” on the shell, I instead get this:

    Yikes. ModemManager wants to pwn your keyboard at /home/manni/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/bin/find-device-port-linux-udev line 25.
    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/manni/Arduino/hardware/keyboardio/avr/build-tools/makefiles//rules.mk:72: recipe for target ‘flash’ failed

I did all of the above on a Linux Mint 18.3 system. Any advice on what I should read or do?

1 Like

Try the wiki instructions here: https://github.com/keyboardio/Kaleidoscope/wiki/Install-Arduino-support-on-Linux

1 Like

I have no help to add, unfortunately, but I want to say thanks: I’d been having the same problem with building in the Arduino app on my Mac, and your suggestion at step 1 took care of it for me. Thanks! (I’ve been able to run make flash at the command line without trouble, though.)

Did you follow all the instructions on setting the correct rights for your user/group on the wiki to be able to have full access to the serial port. Also, did you hold down the “Prog” key at the right time (when you have to press enter)?

This is normal, don’t worry about the warning.

If you’re at all concerned, it’s ok to remove factory test mode by deleting the line

&TestMode,

This will get you down to:

Building output/Model01-Firmware/Model01-Firmware (0.0.0-gv1.22-3-gb745-dirty) ...
- Size: firmware/Model01-Firmware/Model01-Firmware-0.0.0-gv1.22-3-gb745-dirty.elf
  - Program:   18394 bytes (64.2% Full)
  - Data:       1713 bytes (66.9% Full)
1 Like

I did. But that didn’t help. I suspect that I had some (very) old Arduino config files in my home dir and those messed things up a bit?

Very nice! I will have to try whether the shell-way now works for me as well or whether that one needs a different fix.

Yes and yes. I really do think that I followed all the instructions.

Thank you! This is exactly what I wanted to hear. Of course, the warning is quite worrying and the last thing I want to do is brick my brand new keyboard.

Thank you, Jesse. Meanwhile I’ve got rid off a few other things that I don’t care about (e.g. the mouse emulation stuff) and was able to safe a satisfying amount of memory. Somehow I enjoy and environment where memory actually does matter. Just like in the old days :wink:

1 Like

It’s very, very hard to brick the keyboard by flashing a bad firmware. It is possible to flash a firmware that crashes immediately, or sends lots of input with nothing pressed (or just the prog key pressed), which can make it tricky to flash a working version, but as long as the bootloader doesn’t get clobbered (for which you need to connect an external (hardware) programmer), it is recoverable.

I’ve flashed many, many non-functional sketches to my keyboard, and this procedure always works, using a second keyboard:

  • unplug the Model01
  • run make flash, and wait for the prompt to hit enter
  • plug in the Model01 while holding the prog key
  • quickly hit enter on the other keyboard

Whatever bad firmware was on the Model01 will never even start running if you follow this procedure. You have a few seconds to press enter; I’ve only missed the window a few times.

1 Like

I should write that procedure up on the wiki, unless someone else wants to do it first.

Done.

4 Likes

Awesome and just in the kind of tone I was hoping for. Thank you, Merlin!

2 Likes