Re: PIC not executing using any power supply other than the computer USB port
I have only read the GNU make manual up to section 4.5, but I think I have read enough of the manual to realize that the tab character is required between all commands. So I have fixed that, but have received the following error the first time through:
[Makefile script]
# change this to your program name
PROG_NAME = LED_toggle.hex
# list your object files
OBJS = main.o
DEBUG = #-DUSB_USE_UART #-DDEBUG_UART -DDEBUG -DDEBUG_PRINT
PIC_TYPE = PIC18F2620
sdcc_PIC_TYPE = 18f2620
lkr_PIC_TYPE = 18f2620
TOOLSDIR = /usr/local/
CC = $(TOOLSDIR)/bin/sdcc
CFLAGS = -mpic16 -V -p$(sdcc_PIC_TYPE) $(DEBUG) --denable-peeps --opt-code-size --optimize-cmp --optimize-df --fstack
LNK = $(TOOLSDIR)/bin/sdcc
INC = -I.
LDFLAGS = -L/usr/local/share/sdcc/lib/pic16/
CRT = --use-crt=crt0.o -V
#DEBUG = --denable-peeps --obanksel=9 --opt-code-size --optimize-cmp --optimize-df --fstack
all: $(PROG_NAME)
.c.o:
$(CC) $(CFLAGS) $(INC) -c $<
#rule to link the final executable
$(PROG_NAME): $(OBJS)
$(LNK) $(DEBUG) $(LDFLAGS) $(CRT) -Wl-s$(lkr_PIC_TYPE).lkr,-m -mpic16 -p$(sdcc_PIC_TYPE) $+ -o $( <at> ) -llibio$(sdcc_PIC_TYPE).lib -
llibc18f.lib
#
#prog: $(PROG_NAME)
# piklab-prog --programmer=direct --port=/dev/parport0 --device=$(sdcc_PIC_TYPE) --command=program $(PROG_NAME)
clean:
rm -f *.o *.rel *.lst *.cod *.hex *.map *.asm# change this to your program name
[end of Makefile script]
[error message]
prak <at> prak-laptop:/media/sda5/Dairy Cow Research/datalogging scale/software/LED_toggle$ make
/usr/local//bin/sdcc -L/usr/local/share/sdcc/lib/pic16/ --use-crt=crt0.o
-V -Wl-s18f2620.lkr,-m -mpic16 -p18f2620 main.o -o LED_toggle.hex -llibio18f2620.lib -llibc18f.lib
+ "/usr/local//bin/gplink" -I"/usr/local//bin/../share/sdcc/lib/pic16" -I"/usr/local/share/sdcc/lib/pic16" -I"/usr/local/share/sdcc/lib/pic16/" -
s18f2620.lkr -m -w -r -o LED_toggle.hex main.o crt0.o libio18f2620.lib libc18f.lib pic18f2620.lib libsdcc.lib
18f2620.lkr: No such file or directory
make: *** [LED_toggle.hex] Error 1
[end of error message]
I have inferred that the linker path LNK is in the wrong directory. So I changed to LNK = $(TOOLSDIR)/share/gputils/lkr/ for the microcontroller linker path b/c the linker file is found in that respective path, but instead got a permission error message.
[error message]
prak <at> prak-laptop:/media/sda5/Dairy Cow Research/datalogging scale/software/LED_toggle$ make
/usr/local//share/gputils/lkr/ -L/usr/local/share/sdcc/lib/pic16/ --use-crt=crt0.o -V -Wl-s18f2620.lkr
,-m -mpic16 -p18f2620 main.o -o LED_toggle.hex -llibio18f2620.lib -llibc18f.lib
make: execvp: /usr/local//share/gputils/lkr/: Permission denied
make: *** [LED_toggle.hex] Error 127
[end of error message]
Does anyone have any idea on how to get around that? I have a feeling that it has something to do with
18f2620.lkr file.
Thanks,
Stanley
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user