Pumpkin, Inc.

Pumpkin User Forums

pdata (xdata) space?

For issues specific to the 8051 family, including compilers (e.g. Keil C51) and IDEs (e.g. uVision2).

pdata (xdata) space?

Postby Unregistered User » Fri May 03, 2002 8:33 am

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.
Unregistered User
Posts: 36
Joined: Thu Aug 09, 2001 11:00 pm

Re: pdata (xdata) space?

Postby aek » Fri May 03, 2002 8:36 am

(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

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

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

if ( *(char *)msgP == CODE_C ) {

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.



Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Return to 8051 family

Who is online

Users browsing this forum: No registered users and 1 guest