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.

Basic Electronics » make file errors on initialload.c

July 17, 2011
by codenamejupiterx
codenamejupiterx's Avatar

Rick_S assisted me with my former make file issue, he gave me good advice and i followed it but now I am getting a new error:

              avrdude -c avr109 -p m168 -b 115200 -P /dev/ttyUSB0 -U flash:w:initialload.hex:a
              avrdude: ser_open(): can't open device "/dev/ttyUSB0": No such file or directory
              make: *** [initialload-upload] Error 1

What a I doing wrong now??????

July 17, 2011
by codenamejupiterx
codenamejupiterx's Avatar

This is a continuation from my last thread.....

July 17, 2011
by Rick_S
Rick_S's Avatar

Windows, Linux, or Mac? You need to edit the makefile to point it to where your USB/Serial cable is located. See page 42 Step 10b - Prepare for Programming. It will explain what you need to edit.

The guide is there to answer these questions, it's always recommended for the person new to this to really read the guide... not just glance through it as many tend to do. The NK crew put a lot of time into making the guide a very helpful document. However it will only help you if you utilize it.

Rick

July 17, 2011
by codenamejupiterx
codenamejupiterx's Avatar

Thanks for the quick response Rick_S. However i did read the entire document from cover to cover before i tried anything. Somethings are confusing to me, like i am using a mac and I cant seem to find my /dev folder. Looked in my home folder and did a search.

July 17, 2011
by Ralphxyz
Ralphxyz's Avatar

codenamejupiterx, in OS X /dev is one of the "hidden" folders!

From Terminal enter ls /dev you will something like this:

miniMac:~ Me$ ls /dev
auditpipe       ptyt8           ttyr0
autofs          ptyt9           ttyr1
autofs_control      ptyta           ttyr2
autofs_nowait       ptytb           ttyr3
bpf0            ptytc           ttyr4
bpf1            ptytd           ttyr5
bpf2            ptyte           ttyr6
bpf3            ptytf           ttyr7
console         ptyu0           ttyr8
cu.Bluetooth-Modem  ptyu1           ttyr9
cu.Bluetooth-PDA-Sync   ptyu2           ttyra
cu.PL2303-0000101D  ptyu3           ttyrb
disk0           ptyu4           ttyrc

My USB cable is at cu.PL2303-0000101D

My (Nerdkit) Initialload Makefile looks like this:

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/ttyUSB0

AVRDUDEFLAGS=-c avr109 -p m168 -F -b 115200 -P /dev/cu.PL2303-0000101D LINKOBJECTS=../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o

ProgramName = initialload all: $(ProgramName)-upload

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

$(ProgramName).ass: $(ProgramName).hex avr-objdump -S -d $(ProgramName).o > $(ProgramName).ass

$(ProgramName)-upload: $(ProgramName).hex avrdude ${AVRDUDEFLAGS} -U flash:w:$(ProgramName).hex:a

July 17, 2011
by Ralphxyz
Ralphxyz's Avatar

Oops sorry I hit post to soon:

My (Nerdkits) initialload Makefie looks like this:

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/ttyUSB0
AVRDUDEFLAGS=-c avr109 -p m168 -F -b 115200 -P /dev/cu.PL2303-0000101D
LINKOBJECTS=../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o

ProgramName = initialload
all:    $(ProgramName)-upload

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

$(ProgramName).ass: $(ProgramName).hex
    avr-objdump -S -d $(ProgramName).o > $(ProgramName).ass

$(ProgramName)-upload:  $(ProgramName).hex
    avrdude ${AVRDUDEFLAGS} -U flash:w:$(ProgramName).hex:a

The ProgramName is something you will eventually get around to using, you do not need to use it.

Ralph

Post a Reply

Please log in to post a reply.

Did you know that Pulse Width Modulation (PWM) can be used to control the speed of a motor digitally? Learn more...