NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Support Forum » Unresponsive at "/dev/cu.usbserial -U flash:w:initialload.hex"

June 14, 2013
by zechdc
zechdc's Avatar

I navigate to the "initialload" code folder and run the "make" command in mac terminal. Below is the output I get. Terminal hangs on that last line indefinitely. It worked the first time I run it. What am I doing wrong?

make -C ../libnerdkits
make[1]: Nothing to be done for `all'.
avr-gcc -g -Os -Wall -mmcu=atmega168  -Wl,-u,vfprintf -lprintf_flt -Wl,-u,vfscanf -lscanf_flt -lm -o initialload.o initialload.c ../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o
avr-objcopy -j .text -O ihex initialload.o initialload.hex
avrdude -c avr109 -p m168 -b 115200 -P /dev/cu.usbserial -U flash:w:initialload.hex:a
June 15, 2013
by pcbolt
pcbolt's Avatar

Hi zechdc -

I'm not a Mac guy but I've seen something like this with Windows. It happened when I was moving the 3 USB/Serial cable wires around and I think 2 of them may have touched and the PC automatically disabled the virtual serial port. The hardware manager said everything was fine, but I had to disable the serial port then re-enable. I don't know how to do that with a Mac, but what also worked was re-booting the PC. Just a thought.

June 15, 2013
by zechdc
zechdc's Avatar

I rebooted and it worked... once. The first time after reboot it worked fine. The second time I ran "make" it gave me the message below:

avrdude -c avr109 -p m168 -b 115200 -P /dev/cu.usbserial -U flash:w:initialload.hex:a

Connecting to programmer: .
Found programmer: Id = "FDL v02"; type = S
    Software Version = 0.2; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x35

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9406
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "initialload.hex"
avrdude: input file initialload.hex auto detected as Intel Hex
avrdude: writing flash (8104 bytes):

Writing |                                                    | 0% 0.00savrdude: butterfly_recv(): programmer is not responding
make: *** [initialload-upload] Error 1

The third time I ran "make" it gave me:

avrdude -c avr109 -p m168 -b 115200 -P /dev/cu.usbserial -U flash:w:initialload.hex:a

Is it an issue with the driver? I am running Mountain Lion (10.8.4).

June 15, 2013
by zechdc
zechdc's Avatar

Figured out the problem. First off, the website download section should include the latest drivers. I had to get the latest driver so the devices would show up when I ran 'ls /dev' in the terminal. Also, it doesn't show up as cu.PL2303-0000211A. WIth the new driver it shows up as cu.usbserial.

Here is the latest MacOSX Driver http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=229&pcid=41

Then, I had to change the Makefile from:

initialload-upload: initialload.hex
    avrdude ${AVRDUDEFLAGS} -U flash:w:initialload.hex:a

to:

initialload-upload: initialload.hex
    avrdude ${AVRDUDEFLAGS} -e
    sleep 0.1
    avrdude ${AVRDUDEFLAGS} -D -U flash:w:initialload.hex:a

I got this solution from another forum post. Here is their description: This separates the chip erase from the flash programming on the command line. (The "-D" flag stops avrdude from erasing again on its second run.) (The 0.1 period should be adjustable, although I'm not sure whether the OS X "sleep" implementation supports fractions of a second.)

Make sure to tab in your lines like shown above. Now the 'make' command works every time. Source: http://www.nerdkits.com/forum/thread/68/

June 15, 2013
by Ralphxyz
Ralphxyz's Avatar

Gee, this would make a nice update in the Library.

Ralph

June 15, 2013
by pcbolt
pcbolt's Avatar

zechdc

Thanks for the update. Although I use Windoze your post will help a lot of folks using Macs. There have been quite a few questions about this recently so now we have a post to refer them too.

June 16, 2013
by zechdc
zechdc's Avatar

Ralph, I cannot access the Library. It gives me a page of errors. Anyone else have that issue?

June 17, 2013
by Ralphxyz
Ralphxyz's Avatar

Sorry zechdc, I was being facetious when I made the Library comment.

I do not believe it will ever be restored!

But it is good to occasionally hit it in case anyone is monitoring hits on the Nerdkits website to see that there is still interest in the Library.

Ralph

Post a Reply

Please log in to post a reply.

Did you know that SPDT stands for "Single Pole, Double Throw"? Learn more...