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 » can't flash led_blink OSLION

October 08, 2011
by swragg
swragg's Avatar

I get the following response in terminal

"

unknown-10-9a-dd-9f-14-1d:led_blink simonwragg$ make avrdude -c avr109 -p m168 -b 115200 -P /dev/cu.usbserial -e

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: erasing chip

avrdude done. Thank you.

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

Connecting to programmer: . avrdude: butterfly_recv(): programmer is not responding make: *** [led_blink-upload] Error 1 unknown-10-9a-dd-9f-14-1d:led_blink simonwragg$ "

Prior to running make I changed makefile as follows

" GCCFLAGS=-g -Os -Wall -mmcu=atmega168 LINKFLAGS=-Wl,-u,vfprintf -lprintf_flt -Wl,-u,vfscanf -lscanf_flt -lm AVRDUDEFLAGS=-c avr109 -p m168 -b 115200 -P /dev/cu.usbserial LINKOBJECTS=../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o

all: led_blink-upload

led_blink.hex: led_blink.c make -C ../libnerdkits avr-gcc ${GCCFLAGS} ${LINKFLAGS} -o led_blink.o led_blink.c ${LINKOBJECTS} avr-objcopy -j .text -O ihex led_blink.o led_blink.hex

led_blink.ass: led_blink.hex avr-objdump -S -d led_blink.o > led_blink.ass

led_blink-upload: led_blink.hex avrdude ${AVRDUDEFLAGS} -e sleep 0.5 avrdude ${AVRDUDEFLAGS} -U flash:w:led_blink.hex:a "

thinking it may be a current supply problem I tried three sources of power

a) regulated 5 volts from a mains power supply I built years ago the last time i tried to learn some digital electronics

b) 13v unregulated supply (From same power supply) via nerd kit v regulator set up and finally

c) nerd kit set up from 9 volt battery (response shown above - the same with all three supplies)

I don't know the current characteristic for the supply I built years ago. However it did read 5 volts across regulated terminals thru out.

Not sure what to do next

Simon

October 09, 2011
by swragg
swragg's Avatar

The power supply i built was from "Practical Computer Experiments" by E A PARR published 1980

![Power Supply](http://i.imgur.com/3LCJD.jpg)
October 09, 2011
by swragg
swragg's Avatar

Sorted!

forgot avr-gcc-select 4

Works with my power supply!

October 12, 2011
by swragg
swragg's Avatar

I changed my .c file and was unable to flash led_blink I changed .c file back to original still unable to flash

tried various combos of rebooting mac, unplugging /reconecting usb, removing .o & hex files no joy

my last terminal episode as follows

" unknown-10-9a-dd-9f-14-1d:led_blink simonwragg$ avr-gcc-select 4 Current default compiler: gcc 4 on console unknown-10-9a-dd-9f-14-1d:led_blink simonwragg$ make 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 led_blink.o led_blink.c ../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o avr-objcopy -j .text -O ihex led_blink.o led_blink.hex avrdude -c avr109 -p m168 -b 115200 -P /dev/cu.usbserial -e

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: erasing chip

avrdude done. Thank you.

sleep 0.5 avrdude -c avr109 -p m168 -b 115200 -P /dev/cu.usbserial -U flash:w:led_blink.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 "led_blink.hex" avrdude: input file led_blink.hex auto detected as Intel Hex avrdude: writing flash (7714 bytes):

Writing | | 0% 0.00savrdude: butterfly_recv(): programmer is not responding make: *** [led_blink-upload] Error 1 unknown-10-9a-dd-9f-14-1d:led_blink simonwragg$ make avrdude -c avr109 -p m168 -b 115200 -P /dev/cu.usbserial -e

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: erasing chip

avrdude done. Thank you.

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

Connecting to programmer: . avrdude: butterfly_recv(): programmer is not responding make: *** [led_blink-upload] Error 1 unknown-10-9a-dd-9f-14-1d:led_blink simonwragg$ make avrdude -c avr109 -p m168 -b 115200 -P /dev/cu.usbserial -e

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: erasing chip

avrdude done. Thank you.

sleep 0.5 avrdude -c avr109 -p m168 -b 115200 -P /dev/cu.usbserial -U flash:w:led_blink.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 "led_blink.hex" avrdude: input file led_blink.hex auto detected as Intel Hex avrdude: writing flash (7714 bytes):

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

"

Would appreciate some help

Simon

October 13, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

Hi swarg,

Could I take a look at your makefile, I am concerned that you are doing two read cycles for every write cycle attempt. Also are you still using the power supply, or are you using a 9V battery?

Humberto

October 13, 2011
by swragg
swragg's Avatar

Hi Humberto

I am using my power supply - in fact the unregulated 13 v thru nerdkit 5v supply chip. I checked circuit with voltmeter and found 5V where I would expect it.

I have to confess that I tried so many combos that I lost the logic of the plot!

However at one point I successfully downloaded initial load again - don't think I erased O & hex file from folder - I am not sure.

my make file is as follows;-

"

GCCFLAGS=-g -Os -Wall -mmcu=atmega168 LINKFLAGS=-Wl,-u,vfprintf -lprintf_flt -Wl,-u,vfscanf -lscanf_flt -lm AVRDUDEFLAGS=-c avr109 -p m168 -b 115200 -P /dev/cu.usbserial LINKOBJECTS=../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o

all: led_blink-upload

led_blink.hex: led_blink.c make -C ../libnerdkits avr-gcc ${GCCFLAGS} ${LINKFLAGS} -o led_blink.o led_blink.c ${LINKOBJECTS} avr-objcopy -j .text -O ihex led_blink.o led_blink.hex

led_blink.ass: led_blink.hex avr-objdump -S -d led_blink.o > led_blink.ass

led_blink-upload: led_blink.hex avrdude ${AVRDUDEFLAGS} -e sleep 0.5 avrdude ${AVRDUDEFLAGS} -U flash:w:led_blink.hex:a

"

October 14, 2011
by swragg
swragg's Avatar

Humberto an update

I have since tried again . I fused my power supply - I suspect a 5v short circuit problem.

Obviously worried that I may have damaged components.

I found 9v dc supply and successfully downloaded "initial load" to device.

I tried again to download led blink * 2 (second attempt after deleting o & hex files)

following is my terminal log

"

unknown-10-9a-dd-9f-14-1d:initialload simonwragg$ make avrdude -c avr109 -p m168 -b 115200 -P /dev/cu.usbserial -e

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: erasing chip

avrdude done. Thank you.

sleep 0.1 avrdude -c avr109 -p m168 -b 115200 -P /dev/cu.usbserial -D -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: reading input file "initialload.hex" avrdude: input file initialload.hex auto detected as Intel Hex avrdude: writing flash (7838 bytes):

Writing | ################################################## | 100% 1.01s

avrdude: 7838 bytes of flash written avrdude: verifying flash memory against initialload.hex: avrdude: load data flash data from input file initialload.hex: avrdude: input file initialload.hex auto detected as Intel Hex avrdude: input file initialload.hex contains 7838 bytes avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.72s

avrdude: verifying ... avrdude: 7838 bytes of flash verified

avrdude done. Thank you.

unknown-10-9a-dd-9f-14-1d:initialload simonwragg$ cd unknown-10-9a-dd-9f-14-1d:~ simonwragg$ cd Downloads/Code/led_blink unknown-10-9a-dd-9f-14-1d:led_blink simonwragg$ make avrdude -c avr109 -p m168 -b 115200 -P /dev/cu.usbserial -e

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: erasing chip

avrdude done. Thank you.

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

Connecting to programmer: . avrdude: butterfly_recv(): programmer is not responding make: *** [led_blink-upload] Error 1 unknown-10-9a-dd-9f-14-1d:led_blink simonwragg$ make 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 led_blink.o led_blink.c ../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o avr-objcopy -j .text -O ihex led_blink.o led_blink.hex avrdude -c avr109 -p m168 -b 115200 -P /dev/cu.usbserial -e

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: erasing chip

avrdude done. Thank you.

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

Connecting to programmer: . avrdude: butterfly_recv(): programmer is not responding make: *** [led_blink-upload] Error 1 unknown-10-9a-dd-9f-14-1d:led_blink simonwragg$

"

I have not changed makefile from one in thread

Simon

October 14, 2011
by Ralphxyz
Ralphxyz's Avatar

Simon, lets see you makefile.

Use the "Indent Selection as Code Block" button.

Just copy and paste your makefile to the forum post window highlight it and click the button.

Or put four spaces before each line.

That way we can copy and paste your makefile for testing?

It looks like you are running make twice and getting different results or is that just because of the messy posting?

Anyway give us a fresh clean look at your makefile.

Ralph

October 14, 2011
by swragg
swragg's Avatar
GCCFLAGS=-g -Os -Wall -mmcu=atmega168 
LINKFLAGS=-Wl,-u,vfprintf -lprintf_flt -Wl,-u,vfscanf -lscanf_flt -lm
AVRDUDEFLAGS=-c avr109 -p m168 -b 115200 -P /dev/cu.usbserial
LINKOBJECTS=../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o

all:    led_blink-upload

led_blink.hex:  led_blink.c
    make -C ../libnerdkits
    avr-gcc ${GCCFLAGS} ${LINKFLAGS} -o led_blink.o led_blink.c ${LINKOBJECTS}
    avr-objcopy -j .text -O ihex led_blink.o led_blink.hex

led_blink.ass:  led_blink.hex
    avr-objdump -S -d led_blink.o > led_blink.ass

led_blink-upload:   led_blink.hex
    avrdude ${AVRDUDEFLAGS} -e
    sleep 0.5
    avrdude ${AVRDUDEFLAGS} -U flash:w:led_blink.hex:a
October 14, 2011
by Ralphxyz
Ralphxyz's Avatar

have you tried:

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

From Mike's post

The "-D" flag stops avrdude from erasing again on its second run.

I'd also try again without the delay, just to see.

Ralph

October 14, 2011
by swragg
swragg's Avatar

Thanks Ralph result with delay-

Current default compiler: gcc 4 unknown-10-9a-dd-9f-14-1d:led_blink simonwragg$ make avrdude -c avr109 -p m168 -b 115200 -P /dev/cu.usbserial -e

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: erasing chip

avrdude done.  Thank you.

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

Connecting to programmer: .
avrdude: butterfly_recv(): programmer is not responding
make: *** [led_blink-upload] Error 1
unknown-10-9a-dd-9f-14-1d:led_blink simonwragg$

result without delay

unknown-10-9a-dd-9f-14-1d:led_blink simonwragg$ 
Last login: Fri Oct 14 21:53:36 on ttys000
unknown-10-9a-dd-9f-14-1d:led_blink simonwragg$ make
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 led_blink.o led_blink.c ../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o
avr-objcopy -j .text -O ihex led_blink.o led_blink.hex
avrdude -c avr109 -p m168 -b 115200 -P /dev/cu.usbserial -e

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: erasing chip

avrdude done.  Thank you.

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

Connecting to programmer: .
avrdude: butterfly_recv(): programmer is not responding
make: *** [led_blink-upload] Error 1
unknown-10-9a-dd-9f-14-1d:led_blink simonwragg$

Could this be problem with C file I have read various threads suggesting need to reboot mac between attempts to flash

Not sure what to do next

Simon

October 14, 2011
by Ralphxyz
Ralphxyz's Avatar

Well it never hurts to try rebooting, but that is a pain. I have had to do that with OS X 10.6, certainly is a pain but try it.

Now:

Could this be problem with C file I have read various threads suggesting need to reboot mac between attempts to flash

You are jumbling your thoughts.

First thing:

Could this be problem with C file

Well try a different project. What project are you working on?

Then:

I have read various threads suggesting need to reboot mac between attempts to flash

Well you certainly should not have to reboot with each compile, but as I said try it.

I have had lots of different problems with OS X, I have gone days where I could not compile/load a project and then the next day everything would just work.

I used to have to pull the USB cable after each compile.

I wish I could run LION then I could be more helpful. Actually I am glad I can not run LION I've gone through enough problems.

Ralph

October 16, 2011
by swragg
swragg's Avatar

Update

after restarting computer, unplugging and plugging usb cable

successful download of led_blink

Please Please would somebody hazard a guess as to what this process might be doing to allow the chip to be programmed

Simon

October 17, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

Hi swragg,

At this point it migth be a dying battery that is affecting the stability of your programming. Flashing a new program takes lots of current from the battery (relative to reading the flash).

Humberto

Post a Reply

Please log in to post a reply.

Did you know that interrupts can cause problems if you're not careful about timing and memory access? Learn more...