LeoStick Bootloader mod

A shrunk down Leonardo-compatible board, thumb drive sized with native USB support. [Product info]
Post Reply
maaad
Posts: 2
Joined: Thu Jun 13, 2013 12:22 am

LeoStick Bootloader mod

Post by maaad » Thu Jun 13, 2013 12:27 am

Hi All,

I would like to change the bootloader on my leostick so when it is inserted in a "fresh" Windows pc it is recognized as say "Maaad's Awesome Stick" rather than "Freetronics LeoStick"

Any ideas?
Cheers
Maaad

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: LeoStick Bootloader mod

Post by angusgr » Thu Jun 13, 2013 10:54 pm

Hi Maaad,

What a "maad" project. :)

The short answer is: not easily.

The long answer is: the identifier is set in 3 places that can show up at different times:

- There's a string ("LeoStick Bootloader") baked into the bootloader. This is the name that appears when the bootloader runs, if no sketch is loaded or after the reset button is pressed. If you recompile the boot loader (the source files are included in the \bootloaders directory inside the board profile) and flash it using an external programmer then you can change the bootloader string.

- There's a pair of strings ("Unknown/USB IO Board") baked into the Arduino USBCore.cpp file. LeoStick V2 uses this string, LeoStick V1 has its own copy of USBCore.cpp as part of its board profile. If you change this string (either edit in in-place or make a copy of the whole arduino core directory) then you can change the string that shows up when the sketch is running.

(As it happens I've submitted a patch to Arduino to allow these two strings to be set from the Arduino boards.txt file in v1.5 so it can give a vendor name without needing to copy the core C++ files, but this change hasn't been accepted yet.)

- There's also strings in the Freetronics .INF file. Windows will use those strings after the drivers have loaded and the LeoStick appears as a COM port. The above two strings are only shown while the device is "unknown" (I saw you mentioned a fresh PC but thought I'd explain the whole thing.)

Hope that's of some use.

- Angus

maaad
Posts: 2
Joined: Thu Jun 13, 2013 12:22 am

Re: LeoStick Bootloader mod

Post by maaad » Wed Jun 19, 2013 1:09 am

That is a fantastic reply, top shelf.

I see there is an option in the IDE to "burn bootlader", is there an easy way to recompile the bootloader and upload it like that? I would like to avoid building/buying an additioanl bit of hardware if possible.

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: LeoStick Bootloader mod

Post by angusgr » Wed Jun 19, 2013 1:13 am

maaad wrote: I see there is an option in the IDE to "burn bootlader", is there an easy way to recompile the bootloader and upload it like that? I would like to avoid building/buying an additioanl bit of hardware if possible.
Hi Maad,

Unfortunately even the IDE's "burn bootloader" feature still requires an external programmer. The bootloader can't replace itself.

Bear in mind if you have a sketch loaded on the LeoStick then the bootloader is bypassed when you first plug the stick in, it only comes up if you press the reset button. So you can skip reflashing the bootloader if you only need your custom string to show up when it's first plugged in.

- Angus

Post Reply