I’ve had one of these Freetronics Leostick devices sitting in the drawer ever since Jon Oxer included them in the conference bag at linux.conf.au (2014?). My son is taking his first steps into programming (flashing out his name in morse code, etc), and the small form factor and included piezo buzzer on the Leostick sounded worth trying.

It turns out that the original Leosticks had “v1” of the arduino bootloader and the latest arduino GUI dev environment thing needs “v2”. The official docs are on the freetronics site, but for those of you that dislike using the GUI and mucking about with unnecessarily long instructions, here’s the short version:

Solder on the 6 pin ICSP header that was helpfully included in the Leostick packaging. The pin layout is as given in the top-left of the schematic, when viewed from the top. I used a Buspirate as my external programmer, freetronics also has instructions for using another arduino instead. You’ll need to vary the avrdude command below appropriately.

wget https://github.com/freetronics/LeoStickBoardProfile/archive/master.zip
unzip master.zip
# Vary -c and -P depending on your external programmer of choice
avrdude -patmega32u4 -cbuspirate -P/dev/ttyUSB0 -Uflash:w:LeoStickBoardProfile-master/bootloaders/caterina/Caterina-LeoStick.hex:i -Ulock:w:0x2F:m

The flash upload took about a minute for me. Congratulations you now have a Leostick with V2 bootloader (the red light should “breathe” more quickly now on reset).

Your new Leostick appears as /dev/ttyACM? instead. For me, this device appeared briefly whenever I reset the Leostick (lots of evidence in dmesg), and then disappeared after a few seconds. Apparently being /dev/ttyACM? is enough to make ModemManager get all excited and start to send it AT commands, which then causes the Leostick to give up. The fix is to add something like this to udev:

# /etc/udev/rules.d/99-local.rules
ACTION=="add|change", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="26ba", ATTRS{idProduct}=="0002", ENV{ID_MM_DEVICE_IGNORE}="1"

Run udevadm control --reload-rules after modifying udev rules. Now I get /dev/ttyACM0 appearing for about 2 seconds (26ba/0002 I assume the bootloader?), followed by /dev/ttyACM1 (26ba/8002) hanging around and ready to have arduino code uploaded to it. Oh and my user ID is already in the dialout group, you might want some other USB permissions setup (in your udev rules).

If you want to run the tone generator example, the buzzer on the Leostick is pin 11, so you need to s/8/11/ in a few places from the stock arduino example.