makestuff / libfpgalink

LIB:Library for interacting with an FPGA over USB
https://github.com/makestuff/libfpgalink/wiki/FPGALink
GNU Lesser General Public License v3.0
82 stars 25 forks source link

Converting keywords to new sdcc form. #26

Closed mithro closed 9 years ago

mithro commented 9 years ago

Fixed some of the issues in https://github.com/makestuff/libfpgalink/issues/25

However now doesn't compile with;

$ make clean
rm -f *.iic *.asm *.hex *.lnk *.lst *.map *.mem *.rel *.rst *.sym *.lk firmware.c progOffsets.h date.inc
tansell@tansell-x1c-l:~/foss/makestuff/libs/libfpgalink/firmware/fx2$ make FLAGS="-DDEBUG"
echo DATE=0x20141222 > date.inc
echo VID=0x1D50 >> date.inc
echo PID=0x602B >> date.inc
echo DID=0x0002 >> date.inc
sdcc -DDATE=0x20141222 -mmcs51 --code-size 0x1e00 --xram-loc 0xe000 --xram-size 0x0200 -Wl"-b DSCR_AREA=0x1e00" -Wl"-b INT2JT=0x1f00" -DDEBUG -c --disable-warning 85 -I sdcc -I../../../../3rd/fx2lib/include -I../../../../common prog.c
cat prog.lst | ./lstParse.py > progOffsets.h
sdcc -DDATE=0x20141222 -mmcs51 --code-size 0x1e00 --xram-loc 0xe000 --xram-size 0x0200 -Wl"-b DSCR_AREA=0x1e00" -Wl"-b INT2JT=0x1f00" -DDEBUG -c --disable-warning 85 -I sdcc -I../../../../3rd/fx2lib/include -I../../../../common app.c
sdcc -DDATE=0x20141222 -mmcs51 --code-size 0x1e00 --xram-loc 0xe000 --xram-size 0x0200 -Wl"-b DSCR_AREA=0x1e00" -Wl"-b INT2JT=0x1f00" -DDEBUG -c --disable-warning 85 -I sdcc -I../../../../3rd/fx2lib/include -I../../../../common debug.c
sdcc -DDATE=0x20141222 -mmcs51 --code-size 0x1e00 --xram-loc 0xe000 --xram-size 0x0200 -Wl"-b DSCR_AREA=0x1e00" -Wl"-b INT2JT=0x1f00" -DDEBUG -c --disable-warning 85 -I sdcc -I../../../../3rd/fx2lib/include -I../../../../common infra.c
sdcc -DDATE=0x20141222 -mmcs51 --code-size 0x1e00 --xram-loc 0xe000 --xram-size 0x0200 -Wl"-b DSCR_AREA=0x1e00" -Wl"-b INT2JT=0x1f00" -DDEBUG -c --disable-warning 85 -I sdcc -I../../../../3rd/fx2lib/include -I../../../../common livePatch.c
sdcc -DDATE=0x20141222 -mmcs51 --code-size 0x1e00 --xram-loc 0xe000 --xram-size 0x0200 -Wl"-b DSCR_AREA=0x1e00" -Wl"-b INT2JT=0x1f00" -DDEBUG -c --disable-warning 85 -I sdcc -I../../../../3rd/fx2lib/include -I../../../../common prom.c
sdas8051 -logs descriptors.a51
cp ../../../../3rd/fx2lib/fw/fw.c firmware.c
sdcc -DDATE=0x20141222 -mmcs51 --code-size 0x1e00 --xram-loc 0xe000 --xram-size 0x0200 -Wl"-b DSCR_AREA=0x1e00" -Wl"-b INT2JT=0x1f00" -DDEBUG -c --disable-warning 85 -I sdcc -I../../../../3rd/fx2lib/include -I../../../../common firmware.c
sdcc -DDATE=0x20141222 -mmcs51 --code-size 0x1e00 --xram-loc 0xe000 --xram-size 0x0200 -Wl"-b DSCR_AREA=0x1e00" -Wl"-b INT2JT=0x1f00" -DDEBUG -o firmware.hex app.rel debug.rel infra.rel livePatch.rel prog.rel prom.rel descriptors.rel firmware.rel -L../../../../3rd/fx2lib/lib fx2.lib

?ASlink-Error-Insufficient ROM/EPROM/FLASH memory.
make: *** [firmware.hex] Error 1
makestuff commented 9 years ago

Our commits crossed, so the merge did nothing. I also added a USE_16K config variable to the Makefile, to avoid the "insufficient memory" error. You can build the firmware with a modern SDCC with debug enabled like this:

make AS8051=sdas8051 FLAGS="-DDEBUG" USE_16K=1

Lastly, FYI the debug info appears on whatever pin you configure "USART" to, and by default it's 115200,8,N,1. You'll need a MAX232 or similar to drive RS-232 levels.