Closed mithro closed 9 years ago
It seems the correct format is;
#ifdef DEBUG
__sbit __at (0xB7) USART; // Port D7
However, then sdcc doesn't like the ASM from what I can see?
$ make FLAGS="-DDEBUG"
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
debug.c:17: syntax error: token -> 'mov' ; column 5
debug.c:28: syntax error: token -> 'bit' ; column 13
debug.c:35: syntax error: token -> 'uint8' ; column 12
debug.c:36: error 20: Undefined identifier 'ch'
debug.c:37: error 20: Undefined identifier 'ch'
debug.c:37: error 20: Undefined identifier 'ch'
debug.c:37: error 20: Undefined identifier 'ch'
debug.c:38: error 20: Undefined identifier 'ch'
debug.c:38: error 20: Undefined identifier 'ch'
debug.c:39: error 20: Undefined identifier 'ch'
debug.c:40: error 20: Undefined identifier 'ch'
debug.c:40: error 20: Undefined identifier 'ch'
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
Note the explicit specification of the assembler to use.
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.
Pulled your updated and it compiled fine! Was able to load the firmware onto the FX2 board and successfully able to see MakeStuff FPGALink/FX2 20141222
appear on the serial port (/dev/ttyUSB0).
I'm using one of these -> http://tronixlabs.com/retired/ttl-uart-to-usb-cable-serial-usb-debug-cable/ connected to the following board -> http://www.ebay.com.au/itm/Logic-Analyzer-EEPROM-CY7C68013A-56-EZ-USB-FX2LP-USB2-0-Develope-Board-Module-/380778239854 currently.
My eventual goal is described in https://github.com/makestuff/libfpgalink/issues/30 but wanted to get debug statements working before attempting anything serious :)
The error is listed below;
The error seems to be the line;
I'm using sdcc which ships with Ubuntu 14.04;
The version of debug.c I have is below;