Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

USB AVR Programer #1300 not working (osx mac usb issue)?

I just spent two long days trying everything I could think of to get the Pololu USB Programmer I just bought to work on my Mac with no success. It’s been a long learning curve because all this ISP and DFU programming for Arduoino/AVR chips is new to me.

I’ve got my MacBook Pro (2017 version I think) (the latest macOS Big Sur 11.5.2) connected to your older version (product 1300) USB AVR Programmer which is then connected to an Arduino Mega 2560 ISP header (trying both the m2560 main processor header and the m16u2 smaller processor header). I’ve now tested on both a “real” Arduino Mega and a real Arduino Uni, and a blue board (brand unknown) Mega and they all show the same problem.

I get tons of what seems to be communication errors like this from avrdude such as:

avrdude: ser_drain(): read error: Device not configured
avrdude: ser_send(): write error: Device not configured
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: stk500v2_ReceiveMessage(): timeout

The errors are highly inconsistent and random. At times, it seems to work for a moment, then it gets errors and will print out 100’s of lines of these errors and fail. It works a little because I managed to mess up the programming of two different Arduions in my testing.

I eventually solved all my programs by not using the Pololu programmer. I bought a new Mega and Uni, and turned the Mega into an ISP programmer, and did all my programming with the Mega as ISP to solve my original need, and fix the damage done with my testing of the Pololu programmer.

I did all this because I replaced the ATMega16u2 chip on my Arduino Mega as an SMD soldering and repair learning exercise so, with a factory fresh 16u2, it needed to be configured and reprogrammed to work in the Arduino. All that turned out great, once I stopped wasting my time with the Pololu programmer.

Now that my boards are all working, I’m returning to try and understand what’s up with the Pololu programmer and see if I can make it work.

I’m using avrdude on my mac (the one that is built into the Arduino IDE app 1.8.18), which has avrdude Version 6.3-20190619.

avrdude works fine for communicating to the Mega as an ISP which I’ve used to do multiple programming tasks. Just not with the Pololu programmer.

The typical command I use to try and talk to the Pololu programmer is:

avrdude -C /usr/local/avr/etc/avrdude.conf -p m2560 -c avrispv2 -v -P /dev/tty.usbmodem003348711

The tty port is the lower number of the two (the second ending in 13).

Typical example of avrdude output with errors:

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/usr/local/avr/etc/avrdude.conf"
         User configuration file is "/Users/curtwelch/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbmodem003348711
         Using Programmer              : avrispv2
avrdude: ser_drain(): read error: Device not configured
         AVR Part                      : ATmega2560
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
           flash         65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP V2
         Programmer Model: STK500
avrdude: ser_send(): write error: Device not configured
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Device not configured
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: Device not configured

The errors then repeat like the ones at the end for 100’s of lines as avrdude keeps trying to communicate with the programmer and is only getting errors. There are no time delays when it reports “timeout”. All these errors happen within a second.

I tried switching which USB port on the mac it was connected to. Rebooting the mac (some comments I found suggested that worked for someone else), tried using a different USB cable than the one supplied with the programmer, tried connecting it to different Arduinos, tried different baud rate settings (19200, 115200, 9600) and nothing seemed to work. I don’t have a different computer (like a Windows box) to test with.

Ah, and suddenly, one test run worked without error to read and report the status of the Mega and the fuse settings! But then trying again multiple times just now, back to the same errors???

The green light on the board comes on. The other LED is red, until I connect the ISP cable, then it will turn Yellow when there is power on the target board. That all seems to match the descriptions in your documentation.

The odd behavior however is that the tty ports will show up, but then a minute or two later, they vanish again, even though I have done nothing to the hardware. Then, without me doing anything, the tty ports return. The light stays yellow, but the programmer seems to be cycling and re-connecting to the Mac to define the tty ports, then turning off again.

And just now, while doing more testing, I got it to work again, with 19200 baud, and by unplugging the USB from the programmer, plugging it back in, then running avrdude multiple times right as it was first starting…

Does it even care about the baud rate or does it not matter because the USB never gets converted to a real serial signal anyway inside the programmer???


avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/usr/local/avr/etc/avrdude.conf"
         User configuration file is "/Users/curtwelch/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbmodem003348711
         Using Programmer              : avrispv2
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega2560
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
           flash         65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP V2
         Programmer Model: STK500
         Hardware Version: 15
         Firmware Version Master : 2.10
         Topcard         : Unknown
         Vtarget         : 4.8 V
         SCK period      : 17.4 us
         Varef           : 0.0 V
         Oscillator      : 3.686 MHz

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as FD

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK (E:FD, H:D8, L:FF)

avrdude done.  Thank you.

When trying to flash (the above was only reading), I have seen it start the flash writing, then getting the communication errors (device not configured type stuff), then bomb. That left my processor half-programmed and broken when it happened.

I can’t find others on the internet having his issue. So I’m a bit lost. There were issues back in 2010 very similar to this with Mac OSx having a compatibility issue with this Pololu programmer, but Apple seemed to have fixed that error and nothing I could find suggests the error had returned for others.

But maybe no one is using your old programmer anymore? I bought it last week without enough research to know that it was way outdated in your product line. I just knew I needed an ISP programmer and have used Pololu products in the past and was happen with them so I clicked the buy button.

Or maybe I have something odd installed in my Mac that is making the USB bug return for your product???

This feels to me to be a USB protocol issue between my Mac and your Pololu programmer. Feels like my Mac and the Pololu programmer keep losing connection which kills the link, then it gets restarted, and only if the USB device definition link stays up long enough for avrdude get a second to work before the USB device dies again.

Any suggestions as to what might be happening and how to fix it or how to chase down the issue?

Should I just bail on the old #1300 programmer and try your newest one? It would be nice to have one that works for future use.

I just placed an order for the new V2.1 programmer to see if it works ok with my Mac. I bet it will!

Looking more into the Mac I see this is most certainly a USB compatibility issue between my Mac and the Pololu Programmer. I don’t know the Mac internals enough to have an understanding of what the issue is, but checking logs, I find while the AVR programmer is connected, the mac is logging a constant stream of repeating messages about the device, repeating about once a second. It seems to be constantly re-regressing the device and then disconnecting it for some reason.

When I run the Serial app (a Mac terminal emulator), the “open port” window is constantly flashing, and removing the Pololu AVR ports which indicate they are constantly being set up, and torn down in the system.

So what seems to be happening, if is I run the avrdude command at just the right moment while the port is active, and the avrdude command finishes before the port is removed it will complete correctly. But if it takes too long, the port is removed while it’s trying to communicate killing the connection.

Nothing in the log looks like an obvious error message I could google for, but my Mac is most certainly not compatible with this device.

Is there a USB driver for this board for the Mac? I didn’t see any mention of that in the documents. Did I miss something important? Most USB devices like serial USB adaptors have built-in driver support on the Mac and don’t require third-party driver support. Guess I should re-check the Pololu documentation and make sure I didn’t miss something important here.

Opps. We have an RTFM problem here.

“If you want to use the programmer with Mac OS X 10.11 (El Capitan) or later, you will need to upgrade your firmware to version 1.08 or later by following the firmware upgrade instructions in Section 9. Firmware version 1.07 works with Mac OS X 10.7 through 10.10. However, there is a problem that causes the programmer’s virtual serial ports to frequently disappear and reappear when used on Mac OS X 10.11. This problem can be fixed by upgrading to firmware version 1.08 or later.”

I checked. My Pololu programmer came with version 1.07. I need to flash my programmer to 1.08. Seems this issue was identified and fixed in 2016. But my Pololu programmer doesn’t work with a Mac so I can’t use my Mac to flash the programmer to 1.08 over USB per the instructions. So now I need to acquire a device to allow me to flash the programmer, that I bought because I needed to flash my Arduino. Ugh. Well, at least I have a path forward now…

And now it’s all good! Used the wife’s old Windows Laptop to upgrade the firmware on the USB AVR Programmer to the latest V1.08, and now it’s working just fine on my Mac!

So this page could be improved on your web site. It’s why I failed to find the section that told me I had to upgrade the firmware!

It says:

If you are using the Pololu USB AVR Programmer and have a version of Mac OS X prior to 10.7 (Lion), you will need to install a modified version of the firmware onto your programmer.

Since I wasn’t using an old version of the Mac OS, this made me think the product shipped with the right firmware, and I could then ignore anything about firmware upgrades (so I did just that, I skipped over all the sections talking about firmware upgrades and never saw the mention of the fact that the Mac’s with the newer OS had to be sure to have the right firmware.

So maybe the intent was not to ship with the older 1.07 firmware that was on mine so that it would work correctly with all the new Macs, but I got a USB Programmer with the firmware that doesn’t work for current Macs, and I never saw any mention of the fact that was an old firmware problem. But if you don’t fix your inventory and you are still selling the old #1300 USB AVR programmer, it would be good if the quick start guide had a warning about this problem I ran into :slight_smile:

1 Like