Welcome! Log In Create A New Profile

Advanced

I found the reason for SDCC barfing..

Posted by bartlee45 
I found the reason for SDCC barfing..
March 21, 2007 11:24PM
In the file pic16f628.h generated by inc2h.pl the definition of PORTA_ADDR already exists as
#define PORTA_ADDR 0x0005
So what we have in pic14.h is essentially a copy of what used to be the generated part of SDCC's defines for the 16f628. I wanted to post this first but it may just take replacing the contents of the new 16f628.h in our new pic14.h (As an aside for those that don't know, as I didn't pic14 means pic16f628 and the like while pic16 means pic18fsomethingorother).
Anyways Adrian, there's the five you were looking for.
Re: I found the reason for SDCC barfing..
March 24, 2007 03:20PM
I was playing around with the source some more last night and got most of the way through the firmware build but ran into a snag at getting __sdcc_gsinit_startup linked in. Saw something about specifying something on a link line to get an empty vector table for an interrupt that was needed, so I'll keep investigating.
My big changes were getting rid of all of

BIT_AT(PORTA_ADDR, 0) PORTA0;
BIT_AT(PORTA_ADDR, 1) PORTA1;
BIT_AT(PORTA_ADDR, 2) PORTA2;
BIT_AT(PORTA_ADDR, 3) PORTA3;
BIT_AT(PORTA_ADDR, 4) PORTA4;
BIT_AT(PORTA_ADDR, 5) PORTA5;
BIT_AT(PORTA_ADDR, 6) PORTA6;
BIT_AT(PORTA_ADDR, 7) PORTA7;

BIT_AT(PORTB_ADDR, 0) PORTB0;
... elided for your reading pleasure
BIT_AT(PORTB_ADDR, 7) PORTB7;

BIT_AT(TRISA_ADDR, 0) TRISA0;
...
BIT_AT(TRISA_ADDR, 7) TRISA7;

BIT_AT(TRISB_ADDR, 0) TRISB0;
...
BIT_AT(TRISB_ADDR, 7) TRISB7;

and replacing things like PORTA0 with RA0 and PORTB1 with RB1.
Those are the new defines from pic16f628.h based on the sfr (special function register) definitions. I was replacing them in the code as I found them but thought maybe I could just put the defines from old to new in place of the old definitions, the things you think of before you drift off to sleep smiling smiley
Oh, there was a change in another file where there was the letter c in front of a call to calculate the crc. I think that was an oops. So I just commented the line and put in a new one without the extra c.
Well back to my investigations.
Re: I found the reason for SDCC barfing..
March 24, 2007 10:15PM
Here's the output from as far as I've been able to get.
I don't know how much there is to do after
error: no target memory available for section "code_idata"
but haven't been able to crack what that means yet.
Here's the output to make it look like I've been working hard.

(I typed the make, the computer did the rest)

$ make
make -C share
make[1]: Entering directory `/usr/src/reprap/firmware/share'
Makefile:11: serial1.dep: No such file or directory
Makefile:11: serial2.dep: No such file or directory
/bin/sh -ec 'gcc -MM -I/usr/src/reprap/firmware/share -I/usr/src/reprap/firmware/sdcc/share/sdcc/include -I/usr/src/reprap/firmware/sdcc-build/sdcc/device/include/pic -I/usr/src/reprap/firmware/sdcc-build/sdcc/device/include -D__16f628 serial2.c \
| sed '\''s#\(serial2\)\.o[ :]*#/usr/src/reprap/firmware/build/16f628/\1.o serial2.dep : #g'\'' > serial2.dep; \
[ -s serial2.dep ] || rm -f serial2.dep'
/bin/sh -ec 'gcc -MM -I/usr/src/reprap/firmware/share -I/usr/src/reprap/firmware/sdcc/share/sdcc/include -I/usr/src/reprap/firmware/sdcc-build/sdcc/device/include/pic -I/usr/src/reprap/firmware/sdcc-build/sdcc/device/include -D__16f628 serial1.c \
| sed '\''s#\(serial1\)\.o[ :]*#/usr/src/reprap/firmware/build/16f628/\1.o serial1.dep : #g'\'' > serial1.dep; \
[ -s serial1.dep ] || rm -f serial1.dep'
make[1]: Leaving directory `/usr/src/reprap/firmware/share'
make[1]: Entering directory `/usr/src/reprap/firmware/share'
mkdir -p /usr/src/reprap/firmware/build/16f628
cd /usr/src/reprap/firmware/build/16f628 && /usr/src/reprap/firmware/sdcc/bin/sdcc -S -mpic14 -p16f628 -o serial1.asm -I/usr/src/reprap/firmware/share -I/usr/src/reprap/firmware/sdcc/share/sdcc/include -I/usr/src/reprap/firmware/sdcc-build/sdcc/device/include/pic -I/usr/src/reprap/firmware/sdcc-build/sdcc/device/include -D__16f628 /usr/src/reprap/firmware/share/serial1.c && \
gpasm -c serial1.asm
mkdir -p /usr/src/reprap/firmware/build/16f628
cd /usr/src/reprap/firmware/build/16f628 && /usr/src/reprap/firmware/sdcc/bin/sdcc -S -mpic14 -p16f628 -o serial2.asm -I/usr/src/reprap/firmware/share -I/usr/src/reprap/firmware/sdcc/share/sdcc/include -I/usr/src/reprap/firmware/sdcc-build/sdcc/device/include/pic -I/usr/src/reprap/firmware/sdcc-build/sdcc/device/include -D__16f628 /usr/src/reprap/firmware/share/serial2.c && \
gpasm -c serial2.asm
gplib -c /usr/src/reprap/firmware/build/16f628/serial.lib /usr/src/reprap/firmware/build/16f628/serial1.o /usr/src/reprap/firmware/build/16f628/serial2.o
make[1]: Leaving directory `/usr/src/reprap/firmware/share'
make -C devices
make[1]: Entering directory `/usr/src/reprap/firmware/devices'
make -C stepmotor
make[2]: Entering directory `/usr/src/reprap/firmware/devices/stepmotor'
Makefile:14: stepmotor1.dep: No such file or directory
Makefile:14: stepmotor2.dep: No such file or directory
/bin/sh -ec 'gcc -MM -I/usr/src/reprap/firmware/share -I/usr/src/reprap/firmware/sdcc/share/sdcc/include -I/usr/src/reprap/firmware/sdcc-build/sdcc/device/include/pic -I/usr/src/reprap/firmware/sdcc-build/sdcc/device/include -D__16f628 -DPORT=2 stepmotor2.c \
| sed '\''s#\(stepmotor2\)\.o[ :]*#/usr/src/reprap/firmware/build/16f628/stepmotor/\1.o stepmotor2.dep : #g'\'' > stepmotor2.dep; \
[ -s stepmotor2.dep ] || rm -f stepmotor2.dep'
/bin/sh -ec 'gcc -MM -I/usr/src/reprap/firmware/share -I/usr/src/reprap/firmware/sdcc/share/sdcc/include -I/usr/src/reprap/firmware/sdcc-build/sdcc/device/include/pic -I/usr/src/reprap/firmware/sdcc-build/sdcc/device/include -D__16f628 -DPORT=2 stepmotor1.c \
| sed '\''s#\(stepmotor1\)\.o[ :]*#/usr/src/reprap/firmware/build/16f628/stepmotor/\1.o stepmotor1.dep : #g'\'' > stepmotor1.dep; \
[ -s stepmotor1.dep ] || rm -f stepmotor1.dep'
make[2]: Leaving directory `/usr/src/reprap/firmware/devices/stepmotor'
make[2]: Entering directory `/usr/src/reprap/firmware/devices/stepmotor'
mkdir -p /usr/src/reprap/firmware/build/16f628/stepmotor
cd /usr/src/reprap/firmware/build/16f628/stepmotor && /usr/src/reprap/firmware/sdcc/bin/sdcc -S -mpic14 -p16f628 -o stepmotor1.asm -I/usr/src/reprap/firmware/share -I/usr/src/reprap/firmware/sdcc/share/sdcc/include -I/usr/src/reprap/firmware/sdcc-build/sdcc/device/include/pic -I/usr/src/reprap/firmware/sdcc-build/sdcc/device/include -D__16f628 -DPORT=2 /usr/src/reprap/firmware/devices/stepmotor/stepmotor1.c && \
gpasm -c stepmotor1.asm
mkdir -p /usr/src/reprap/firmware/build/16f628/stepmotor
cd /usr/src/reprap/firmware/build/16f628/stepmotor && /usr/src/reprap/firmware/sdcc/bin/sdcc -S -mpic14 -p16f628 -o stepmotor2.asm -I/usr/src/reprap/firmware/share -I/usr/src/reprap/firmware/sdcc/share/sdcc/include -I/usr/src/reprap/firmware/sdcc-build/sdcc/device/include/pic -I/usr/src/reprap/firmware/sdcc-build/sdcc/device/include -D__16f628 -DPORT=2 /usr/src/reprap/firmware/devices/stepmotor/stepmotor2.c && \
gpasm -c stepmotor2.asm
sfr sfr sfr sfr cd /usr/src/reprap/firmware/build/16f628/stepmotor && gplink -m -c -o stepmotor.hex stepmotor1.o stepmotor2.o /usr/src/reprap/firmware/share/pic14.a /usr/src/reprap/firmware/build/16f628/serial.lib /usr/src/reprap/firmware/sdcc-build/sdcc/device/lib/pic/bin/libsdcc.lib /usr/src/reprap/firmware/sdcc-build/sdcc/device/lib/pic/bin/pic16f628.lib
message: using default linker script "/usr/local/share/gputils/lkr/16f628.lkr"
warning: processor mismatch in "idata.o"
warning: processor mismatch in "_gptrget1.o"
warning: processor mismatch in "_gptrget2.o"
error: no target memory available for section "code_idata"
make[2]: *** [/usr/src/reprap/firmware/build/16f628/stepmotor/stepmotor.hex] Error 1
make[2]: Leaving directory `/usr/src/reprap/firmware/devices/stepmotor'
make[1]: *** [stepmotor] Error 2
make[1]: Leaving directory `/usr/src/reprap/firmware/devices'
make: *** [devices] Error 2
Re: I found the reason for SDCC barfing..
March 28, 2007 11:38PM
Just to finish this up for now, I saw a post on the SDCC forums likely to be the same problem I was having. I think this is what Simon was referring to about running out of memory.'error: no target memory available for section "code_idata"' is indicating we've run out of memory according to the response there.
Sorry, only registered users may post in this forum.

Click here to login