Hi,
I recently found myself running out of space on my FX2 firmware so I did a bit
of remapping things to squeeze out some more room.
One thing I did was to put the descriptors at 0xe000 and this worked, however I
found that string descriptors didn't work.
After bashing my head against the desk for a bit I realised it was because they
are declared as __code rather than __xdata. The device descriptor still works
because (I think) it uses SUDPTRH/L.
I have the following diff..
Index: lib/setupdat.c
===================================================================
RCS file: /usr/local/Genesis/cvs/micro/lib/fx2lib/lib/setupdat.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 setupdat.c
--- lib/setupdat.c 26 Feb 2011 06:40:02 -0000 1.1.1.1
+++ lib/setupdat.c 16 Sep 2011 08:15:34 -0000
@@ -271,11 +271,14 @@ BOOL handle_set_feature() {
/* these are devined in dscr.asm
and need to be customized then
linked in by the firmware manually */
-extern __code WORD dev_dscr;
-extern __code WORD dev_qual_dscr;
-extern __code WORD highspd_dscr;
-extern __code WORD fullspd_dscr;
-extern __code WORD dev_strings;
+#ifndef DSCR_ADDRSPACE
+#define DSCR_ADDRSPACE __code
+#endif
+extern DSCR_ADDRSPACE WORD dev_dscr;
+extern DSCR_ADDRSPACE WORD dev_qual_dscr;
+extern DSCR_ADDRSPACE WORD highspd_dscr;
+extern DSCR_ADDRSPACE WORD fullspd_dscr;
+extern DSCR_ADDRSPACE WORD dev_strings;
WORD pDevConfig = (WORD)&fullspd_dscr;
WORD pOtherConfig = (WORD)&highspd_dscr;
To go with this I have a local only diff to modify SDCCFLAGS in lib/Makefile to
set it.
My earlier changes where to build code with..
CFLAGS= -mmcs51 --code-size 0x3e00 --xram-size 0x0100 --xram-loc 0x3e00
--stack-auto
LDFLAGS= -Wl"-b DSCR_AREA=0xe000" -Wl"-b INT2JT=0x3f00"
ie I cut RAM in half after checking the SDCC report.
Also it seems that the 'default' (i.e. what's in the examples) --xram-loc is
conservative.
--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
Fx2lib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fx2lib-devel