Building Arduino 1.0.1 Bootloader for Leostick on Mac OS X

A shrunk down Leonardo-compatible board, thumb drive sized with native USB support. [Product info]
Post Reply
garyaj
Posts: 4
Joined: Fri Aug 31, 2012 1:29 am

Building Arduino 1.0.1 Bootloader for Leostick on Mac OS X

Post by garyaj » Fri Aug 31, 2012 3:31 am

My notes from attempting to follow along with adr1an's notes on Building Arduino 1.0.1 Bootloader for Leostick on a PC.

tl;dr Arduino IDE 'Burn Bootloader' using BusPirate takes almost an hour to finish (with no visible feedback). You just have to let it run (or find a more verbose way of running the burn i.e. see below).

Fractal found some minor errors in the inital posting and, somewhat cryptically, noted that he succeeded in installing the bootloader from a Mac. So I knew it was possible. I also had a BusPirate (BP) in my toolkit.

Steps:
1. Download the latest leostick.zip file from Adr1an's posting. Unzip it and move it into your local Arduino/hardware directory (/Users/gary/Documents/Arduino/hardware/ in my case). I renamed the 'leostick' folder to 'LeoStick_v2_0' so I wouldn't confuse it with the v1 folder.

2. Download the FTDI driver for Mac OS X so your Mac will recognise the BusPirate when you plug it in.

3. Follow Tayken's posting about updating programmers.txt (/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/programmers.txt on a Mac).

4. Follow Tinkerlog's Cheat Sheet for connecting the BP to the ICSP header on the LeoStick.

5. If you want to try the 'Burn Bootloader' option in Arduino 1.0.1 IDE, plug the BP into a USB port on your Mac. This should result in a new USB device appearing in the /dev directory (tty.usbserial-A400XIYW in my case). In Arduino IDE select Tools->Board->Freetronics LeoStick, select Tools->Serial Port->/dev/tty.usbserial-A400XIYW then select Tools->Burn Bootloader. All four LEDs on the BP should light up as well as the blue power LED on the LeoStick. Go find something to distract you from biting your nails for an hour.

6. I couldn't sit for an hour with no feedback. I thought the process had hung so I pulled the plug (which left my LeoStick useless) and decided to try adr1an's avrdude commands.
First I had to find avrdude. It's in /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin. From an iTerm commandline, I moved/cd'd to that directory and typed a modifed version of adr1an's first command:

Code: Select all

./avrdude -C../etc/avrdude.conf -v -v -v -v -patmega32u4 -cbuspirate -P/dev/tty.usbserial-A400XIYW -e -Ulock:w:0x3F:m -Uefuse:w:0xcb:m -Uhfuse:w:0xd8:m -Ulfuse:w:0xff:m
Lots of feedback will flow up the screen so you know it's working. This took only a few seconds to complete.
Then I typed the command to install the Caterina bootloader:

Code: Select all

./avrdude -C../etc/avrdude.conf -v -v -v -v -patmega32u4 -cbuspirate -P/dev/tty.usbserial-A400XIYW -Uflash:w:/Users/gary/Documents/Arduino/hardware/LeoStick_v2_0/bootloaders/caterina/Caterina-Leostick.hex:i -Ulock:w:0x2F:m
Lots of feedback will flow up the screen but this one takes nearly an hour. At least I knew it was working and was able to walk away and not interrupt the process. The final lines were:

Code: Select all

BusPirate is back in the text mode

avrdude done.  Thank you.
7. Disconnect BusPirate, connect LeoStick, select Tools->Serial Port->/dev/tty.usbmodemfd121 (or whatever your LeoStick appears as) and upload a sketch.

kengu
Posts: 6
Joined: Thu Sep 20, 2012 11:00 am

Re: Building Arduino 1.0.1 Bootloader for Leostick on Mac OS

Post by kengu » Thu Sep 20, 2012 11:02 am

what's BP???

cef
Freetronics Staff
Freetronics Staff
Posts: 106
Joined: Wed Nov 09, 2011 12:53 am

Re: Building Arduino 1.0.1 Bootloader for Leostick on Mac OS

Post by cef » Thu Sep 20, 2012 11:57 am

BP = BusPirate

kengu
Posts: 6
Joined: Thu Sep 20, 2012 11:00 am

Re: Building Arduino 1.0.1 Bootloader for Leostick on Mac OS

Post by kengu » Thu Sep 20, 2012 2:44 pm

When I put the leostick board insert the Mac computer usb port, and does not appear /dev/tty/usbSerialA400XI, How is it?

kengu
Posts: 6
Joined: Thu Sep 20, 2012 11:00 am

Re: Building Arduino 1.0.1 Bootloader for Leostick on Mac OS

Post by kengu » Sat Sep 22, 2012 6:32 am

Where can I get this usbpirate? Thanks.

kengu
Posts: 6
Joined: Thu Sep 20, 2012 11:00 am

Re: Building Arduino 1.0.1 Bootloader for Leostick on Mac OS

Post by kengu » Wed Oct 03, 2012 5:29 pm

I use "usbasp" via ISP already successfully burn the bootloader into leostick compatible board. :D
Have seen the red light every second flash 2 times , but I can not find "/dev/tty.usbmodem".
(MacBook Pro lion 10.8.2)
What's wrong? Thanks.

roguewave
Posts: 5
Joined: Sat Oct 13, 2012 3:01 pm

Re: Building Arduino 1.0.1 Bootloader for Leostick on Mac OS

Post by roguewave » Sat Oct 13, 2012 8:23 pm

I now have at least two reasons to purchase a Bus Pirate.

Post Reply