Adafruit #570 in Inc 5000 & #11 in manufacturing - fastest-growing private companies in America - INC 5000 - Read more!

[SOLVED] ATmega32u4 AVR109 bootloader on Mac OSX problems

by jirish on Mon Jun 25, 2012 2:05 pm

Hello,

I am new to avr programming, my experience with avr-gcc and avrdude is limited to compiling code and programming attiny13 uCs with the USBtinyISP. I decided to move up to the atmega32u4 to begin work with USB and take advantage of the convenience of a bootloader, however I cannot get the AVR 109 bootloader to work with avrdude.

Here is what happens:

When I plug in the breakout board, my mac recognizes the board as a "network interface". I read other threads concerning this message but found only references to using Teensyduino, which I'm hoping to avoid, as I'm learning to use the avr-gcc toolchain.

I have downloaded the latest version of the Mac CrossPack, however when running the test command in the tutorial

avrdude -p m32u4 -P COM3 -c avr109

I get an error message: avrdude: ser_open(): can't open device "unknown": No such file or directory

Also, a second line appears after a few seconds: Eavrdude: butterfly_recv(): programmer is not responding

Is this bootloader also used on the AVR butterfly? Does this provide a clue as to where I have gone wrong?

I'm not sure what the source of this error is, or why the board is recognized as a network interface. The green LED breathes upon connecting the board, so the bootloader appears to be working.

avrdude version is 2-17-2012

Any help to get me up and running would be great thanks!

-Jon
Last edited by jirish on Mon Jun 25, 2012 4:46 pm, edited 1 time in total.
jirish
 
Posts: 2
Joined: Mon Jun 25, 2012 1:49 pm

Re: ATmega32u4 AVR109 bootloader on Mac OSX problems

by adafruit_support_rick on Mon Jun 25, 2012 2:38 pm

It's normal for the Mac to show serial devices as network interfaces. It assumes they are modems.
"COM3" is not likely to be the name of a valid Mac serial port. Look in /dev for something along the lines of "tty.usbmodemnnnnnn"
If you've got the Arduino IDE installed, just open it and look in the Tools:SerialPort menu and you should see it.
User avatar
adafruit_support_rick
 
Posts: 11396
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: [SOLVED] ATmega32u4 AVR109 bootloader on Mac OSX problems

by jirish on Mon Jun 25, 2012 4:52 pm

Thank you driverblock, that was exactly the solution I needed. If this might help anyone else (I'm not sure if the serial port name is specific to my 2011 macbook pro or even my particular unit?), here is the port name that worked for me:

/dev/tty.usbmodemfd121

Once I used the above as the port name in the avrdude command listed in the product tutorial, I was good to go.

Thanks again!

-Jon
jirish
 
Posts: 2
Joined: Mon Jun 25, 2012 1:49 pm

Re: [SOLVED] ATmega32u4 AVR109 bootloader on Mac OSX problems

by adafruit_support_rick on Mon Jun 25, 2012 5:06 pm

I think the Mac starts with /dev/tty.usbmodemfd121, and then has some algorithm for generating a unique ID for subsequent devices. I've got three Arduino UNOs showing up in the Network prefs panel (even though I only have one actual UNO - don't know why it does that). The current name for mine in /dev is tty.usbmodemfd13131
User avatar
adafruit_support_rick
 
Posts: 11396
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: [SOLVED] ATmega32u4 AVR109 bootloader on Mac OSX problems

by loopmasta on Thu Jan 17, 2013 3:49 pm

Just in case you are still looking for a simple way to find the portname of the conneccted atmega32u4.
I use
Code: Select all | TOGGLE FULL SIZE
ls /dev/tty.*
and get
Code: Select all | TOGGLE FULL SIZE
/dev/tty.Bluetooth-Modem /dev/tty.Bluetooth-PDA-Sync /dev/tty.usbmodem142131
where
Code: Select all | TOGGLE FULL SIZE
/dev/tty.usbmodem142131
is my connected atmega32u4. Then i can use
Code: Select all | TOGGLE FULL SIZE
avrdude -p m32u4 -P /dev/tty.usbmodem142131 -c avr109
to connect to the AVR.
User avatar
loopmasta
 
Posts: 10
Joined: Sat Aug 14, 2010 5:25 am
Location: Cologne