LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-02-2006, 04:58 AM   #1
hazeposse
LQ Newbie
 
Registered: Dec 2005
Posts: 7

Rep: Reputation: 0
problems with /dev/usb/lp0


can someone help me with this problem, everything works normal with the lp0, but when i use the usb-port it won't work:
i think the problem is in here (the first part i used for the parport and that worked):
# mknod /dev/parport0 c 99 0
#AVRDUDE_PORT=/dev/parport0

AVRDUDE_PORT=/dev/usb/lp0

this is the Makefile:

AVRLIB=/export/usr/local/avrlib


TRG = lcdtest



#assembler flags
#ASFLAGS = -Wa, -gstabs

#compiler flags
#CPFLAGS = -g -Os -Wall -Wstrict-prototypes -I$(AVRLIB) -Wa,-ahlms=$(<:.c=.lst)

#linker flags
#LDFLAGS = -Wl,-Map=$(TRG).map,--cref





##### Customize the values as indicated below and :
##### make
##### make disasm
##### make stats
##### make hex
##### make writeflash
##### make gdbinit
##### or make clean
#####
##### See the http://electrons.psychogenic.com/
##### website for detailed instructions


####################################################
##### #####
##### Configuration #####
##### #####
##### Customize the values in this section for #####
##### your project. MCU, PROJECTNAME and #####
##### PRJSRC must be setup for all projects, #####
##### the remaining variables are only #####
##### relevant to those needing additional #####
##### include dirs or libraries and those #####
##### who wish to use the avrdude programmer #####
##### #####
##### See http://electrons.psychogenic.com/ #####
##### for further details. #####
##### #####
####################################################


##### Target Specific Details #####
##### Customize these for your project #####

# Name of target controller
# (e.g. 'at90s8515, atmega8', see the available avr-gcc mmcu
# options for possible values)
#MCU=at90s8515
#MCU=at90s8535
#MCU=atmega32
MCU=atmega8535

# id to use with programmer
# default: PROGRAMMER_MCU=$(MCU)
# In case the programer used, e.g avrdude, doesn't
# accept the same MCU name as avr-gcc (for example
# for ATmega8s, avr-gcc expects 'atmega8' and
# avrdude requires 'm8')
#PROGRAMMER_MCU=m32
#PROGRAMMER_MCU=8535
PROGRAMMER_MCU=m8535

# Name of our project
# (use a single word, e.g. 'myproject')
PROJECTNAME=lcdtest

# Source files
# List C/C++/Assembly source files:
# (list all files to compile, e.g. 'a.c b.cpp as.S'):
# Use .cc, .cpp or .C suffix for C++ files, use .S
# (NOT .s !!!) for assembly source code files.
PRJSRC=a2d.c timer.c buffer.c uart.c rprintf.c lcd.c lcdtest.c

# additional includes (e.g. -I/path/to/mydir)
#INC=-I/path/to/include

# libraries to link in (e.g. -lmylib)
LIBS=

# Optimization level,
# use s (size opt), 1, 2, 3 or 0 (off)
OPTLEVEL=s


##### AVR Dude 'writeflash' options #####
##### If you are using the avrdude program
##### (http://www.bsdhome.com/avrdude/) to write
##### to the MCU, you can set the following config
##### options and use 'make writeflash' to program
##### the device.


# programmer id--check the avrdude for complete list
# of available opts. These should include stk500,
# avr910, avrisp, bsd, pony and more. Set this to
# one of the valid "-c PROGRAMMER-ID" values
# described in the avrdude info page.
#
AVRDUDE_PROGRAMMERID=stk200

# port--serial or parallel port to which your
# hardware programmer is attached
#
# mknod /dev/parport0 c 99 0
#AVRDUDE_PORT=/dev/parport0

AVRDUDE_PORT=/dev/usb/lp0


####################################################
##### Config Done #####
##### #####
##### You shouldn't need to edit anything #####
##### below to use the makefile but may wish #####
##### to override a few of the flags #####
##### nonetheless #####
##### #####
####################################################


##### Flags ####

# HEXFORMAT -- format for .hex file output
HEXFORMAT=ihex

# compiler
CFLAGS=-I. $(INC) -g -mmcu=$(MCU) -O$(OPTLEVEL) \
-fpack-struct -fshort-enums \
-funsigned-bitfields -funsigned-char \
-I$(AVRLIB) \
-Wall -Wstrict-prototypes \
-Wa,-ahlms=$(firstword \
$(filter %.lst, $(<:.c=.lst)))

# c++ specific flags
CPPFLAGS=-fno-exceptions \
-Wa,-ahlms=$(firstword \
$(filter %.lst, $(<:.cpp=.lst))\
$(filter %.lst, $(<:.cc=.lst)) \
$(filter %.lst, $(<:.C=.lst)))

# assembler
ASMFLAGS =-I. $(INC) -mmcu=$(MCU) \
-x assembler-with-cpp \
-Wa,-gstabs,-ahlms=$(firstword \
$(<:.S=.lst) $(<.s=.lst))


# linker
LDFLAGS=-Wl,-Map,$(TRG).map -mmcu=$(MCU) \
-lm $(LIBS)

##### executables ####
CC=avr-gcc
OBJCOPY=avr-objcopy
OBJDUMP=avr-objdump
SIZE=avr-size
AVRDUDE=avrdude
REMOVE=rm -f

##### automatic target names ####
TRG=$(PROJECTNAME).out
DUMPTRG=$(PROJECTNAME).s

HEXROMTRG=$(PROJECTNAME).hex
HEXTRG=$(HEXROMTRG) $(PROJECTNAME).ee.hex
GDBINITFILE=gdbinit-$(PROJECTNAME)

# Define all object files.

# Start by splitting source files by type
# C++
CPPFILES=$(filter %.cpp, $(PRJSRC))
CCFILES=$(filter %.cc, $(PRJSRC))
BIGCFILES=$(filter %.C, $(PRJSRC))
# C
CFILES=$(filter %.c, $(PRJSRC))
# Assembly
ASMFILES=$(filter %.S, $(PRJSRC))


# List all object files we need to create
OBJDEPS=$(CFILES:.c=.o) \
$(CPPFILES:.cpp=.o)\
$(BIGCFILES:.C=.o) \
$(CCFILES:.cc=.o) \
$(ASMFILES:.S=.o)

# Define all lst files.
LST=$(filter %.lst, $(OBJDEPS:.o=.lst))

# All the possible generated assembly
# files (.s files)
GENASMFILES=$(filter %.s, $(OBJDEPS:.o=.s))


.SUFFIXES : .c .cc .cpp .C .o .out .s .S \
.hex .ee.hex .h .hh .hpp


.PHONY: writeflash clean stats gdbinit stats

# Make targets:
# all, disasm, stats, hex, writeflash/install, clean
all: $(TRG)

disasm: $(DUMPTRG) stats

stats: $(TRG)
$(OBJDUMP) -h $(TRG)
$(SIZE) $(TRG)

hex: $(HEXTRG)


writeflash: hex
$(AVRDUDE) -c $(AVRDUDE_PROGRAMMERID) \
-p $(PROGRAMMER_MCU) -P $(AVRDUDE_PORT) -e \
-v -U flash:w:$(HEXROMTRG)

install: writeflash

$(DUMPTRG): $(TRG)
$(OBJDUMP) -S $< > $@


$(TRG): $(OBJDEPS)
$(CC) $(LDFLAGS) -o $(TRG) $(OBJDEPS)


#### Generating assembly ####
# asm from C
%.s: %.c
$(CC) -S $(CFLAGS) $< -o $@

# asm from (hand coded) asm
%.s: %.S
$(CC) -S $(ASMFLAGS) $< > $@


# asm from C++
.cpp.s .cc.s .C.s :
$(CC) -S $(CFLAGS) $(CPPFLAGS) $< -o $@



#### Generating object files ####
# object from C
.c.o:
$(CC) $(CFLAGS) -c $< -o $@


# object from C++ (.cc, .cpp, .C files)
.cc.o .cpp.o .C.o :
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@

# object from asm
.S.o :
$(CC) $(ASMFLAGS) -c $< -o $@


#### Generating hex files ####
# hex files from elf
##### Generating a gdb initialisation file #####
.out.hex:
$(OBJCOPY) -j .text \
-j .data \
-O $(HEXFORMAT) $< $@

.out.ee.hex:
$(OBJCOPY) -j .eeprom \
--change-section-lma .eeprom=0 \
-O $(HEXFORMAT) $< $@


##### Generating a gdb initialisation file #####
##### Use by launching simulavr and avr-gdb: #####
##### avr-gdb -x gdbinit-myproject #####
gdbinit: $(GDBINITFILE)

$(GDBINITFILE): $(TRG)
@echo "file $(TRG)" > $(GDBINITFILE)

@echo "target remote localhost:1212" \
>> $(GDBINITFILE)

@echo "load" >> $(GDBINITFILE)
@echo "break main" >> $(GDBINITFILE)
@echo "continue" >> $(GDBINITFILE)
@echo
@echo "Use 'avr-gdb -x $(GDBINITFILE)'"


#### Cleanup ####
clean:
$(REMOVE) $(TRG) $(TRG).map $(DUMPTRG)
$(REMOVE) $(OBJDEPS)
$(REMOVE) $(LST) $(GDBINITFILE)
$(REMOVE) $(GENASMFILES)
$(REMOVE) $(HEXTRG)


###### dependecies, add any dependencies you need here ###################

buffer.o : buffer.c buffer.h
uart.o : uart.c uart.h global.h
uart2.o : uart2.c uart2.h global.h
rprintf.o : rprintf.c rprintf.h
a2d.o : a2d.c a2d.h
timer.o : timer.c timer.h global.h
pulse.o : pulse.c pulse.h timer.h global.h
lcd.o : lcd.c lcd.h global.h lcdconf.h
i2c.o : i2c.c i2c.h global.h
spi.o : spi.c spi.h global.h
swpwm.o : swpwm.c swpwm.h global.h
servo.o : servo.c servo.h global.h
swuart.o : swuart.c swuart.h global.h
tsip.o : tsip.c tsip.h global.h
nmea.o : nmea.c nmea.h global.h
vt100.o : vt100.c vt100.h global.h
gps.o : gps.c gps.h global.h
$(TRG).o : $(TRG).c global.h
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/dev/usb/lp0 doesn't exist Luc484 Linux - Hardware 2 01-22-2006 04:44 PM
/dev/usb/lp0 permissions problem Seth Kinast Linux - Hardware 3 10-27-2004 03:36 PM
HP Deskjet (USB) & CUPS & Slackware 9.1: Unable to open USB device "usb:/dev/usb/lp0&qu arnostienen Slackware 2 01-29-2004 03:22 PM
Printer problem: Couldn't open /dev/usb/lp0 deepika Linux - General 2 09-08-2003 10:25 AM
Why is the /dev/usb/lp0 not recognized ... zikfreak Linux - General 6 11-25-2001 11:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration