Page 1 of 1

pdata (xdata) space?

PostPosted: Fri May 03, 2002 8:33 am
by Unregistered User
I was not able to successfully re-configure Salvo to use its variables in pdata (xdata) space, so I'm either doing something wrong, or perhaps the freeware version does not allow this ? As you suggested, I edited salvocfg.h to set OSLIBRARY_GLOBALS to OSX instead of OSD, but it made no difference.

Re: pdata (xdata) space?

PostPosted: Fri May 03, 2002 8:36 am
by aek
(For a Salvo LE user, with library builds)

In tu6lib.Uv2:

1) Replace sfc51sdab.lib with sfcx51cxab.lib in the project's Salvo Standard Libraries group.

2) In salvocfg.h, change OSLIBRARY_GLOBALS from OSD to OSX.

3) Target > Select Devices for Target 'Target 1' > CPU > Use Extended Linker (LX51) instead of BL51.

4) Target > Options for Target 'Target 1' > Memory Model > COMPACT: variables in PDATA.

5) In salvo ut u6main.c, change

code:
char CODE_B = 'B'; 
char CODE_C = 'C':

to
code:
char xdata CODE_B = 'B'; 
char xdata CODE_C = 'C':

and
code:
if ( *(char *)msgP == CODE_C ) {

to
code:
if ( *(char xdata *)msgP == CODE_C ) {


In v7.00, my build results are:

Program Size: data=17.0 xdata=56 const=0 code=2177

and it runs fine in the simulator.

So, above, what you're doing is 1) choosing a library for the COMPACT model with Salvo's vars located in the xdata area, 2) configuring salvocfg.h to properly use the specified library, 3) choosing LX51, 4) choosing the COMPACT model, and 5) putting your message objects in xdata space and correctly dereferencing them.

Regards,

------------------