EmbeddedRelated.com
Forums

RCM3200, FS2_RAM_PHYS and battery backed ram

Started by Robert Horton October 10, 2006
I'm in the middle of porting a project from the RCM2250 to the
RCM3200. I don't use the rabbit file system, however, I store data
located at FS2_RAM_PHYS in the area reserved by FS2_RAM_RESERVE. This
has worked fine with the RCM2250. Data has been preserved when the
power has been turned off since the SRAM is all battery backed.

Now when I come to use the RCM3200 (code and BIOS in flash) it looks
like FS2_RAM_PHYS is located in the non battery backed 512k program
execution SRAM. When the power is cycled the data is lost.

How can I relocate FS2_RAM_PHYS to the 256k (battery backed) program
data SRAM?

If that can't be done then I guess I need to _xalloc some memory and
abandon the use of FS2_RAM_PHYS.

If so, how does the FS2 system work since it's data will also be lost
in a power cycle?

Thanks for any advice.
The simplest way to use the battery backed ram is using xalloc
function. Try this:

void main()
{
unsigned long physaddr,flow_rd;
char aux[10];

physaddr = xalloc(65535); // 64K bytes for user data storage
memset(aux,'\0',sizeof(aux));
strcpy(aux,"RAM TEST\0");
flow_rd = physaddr;
root2xmem(flow_rd, aux, sizeof(aux)-1); //Saving aux to RAM
memset(aux,'\0',sizeof(aux));
printf("AUX Contents Before: %s\n\r",aux); // Printing nothing
xmem2root(aux, flow_rd, sizeof(aux)-1); //Recovering data from RAM
printf("AUX Contents After: %s\n\r",aux); //Printing recovered data
}

Best regards

--- In r..., "Robert Horton"
wrote:
>
> I'm in the middle of porting a project from the RCM2250 to the
> RCM3200. I don't use the rabbit file system, however, I store data
> located at FS2_RAM_PHYS in the area reserved by FS2_RAM_RESERVE.
This
> has worked fine with the RCM2250. Data has been preserved when the
> power has been turned off since the SRAM is all battery backed.
>
> Now when I come to use the RCM3200 (code and BIOS in flash) it
looks
> like FS2_RAM_PHYS is located in the non battery backed 512k program
> execution SRAM. When the power is cycled the data is lost.
>
> How can I relocate FS2_RAM_PHYS to the 256k (battery backed)
program
> data SRAM?
>
> If that can't be done then I guess I need to _xalloc some memory
and
> abandon the use of FS2_RAM_PHYS.
>
> If so, how does the FS2 system work since it's data will also be
lost
> in a power cycle?
>
> Thanks for any advice.
>
What value to you read in FS2_RAM_PHYS?

If you use 'Compile to Flash, run in RAM' on the RCM3200, the
FS2_RAM_PHYS value should be higher then 0x80000 = in bb-sram.

Check STACK.LIB: it calculates FS2_RAM_PHYS.

Do not use 'Compile to RAM' or 'Compile to Flash' with a RCM3200 !!

Rudi
www.x-graph.be the next generation Rabbit SBC with (Color TFT) LCD

--- In r..., "Robert Horton" wrote:
>
> I'm in the middle of porting a project from the RCM2250 to the
> RCM3200. I don't use the rabbit file system, however, I store data
> located at FS2_RAM_PHYS in the area reserved by FS2_RAM_RESERVE. This
> has worked fine with the RCM2250. Data has been preserved when the
> power has been turned off since the SRAM is all battery backed.
>
> Now when I come to use the RCM3200 (code and BIOS in flash) it looks
> like FS2_RAM_PHYS is located in the non battery backed 512k program
> execution SRAM. When the power is cycled the data is lost.
>
> How can I relocate FS2_RAM_PHYS to the 256k (battery backed) program
> data SRAM?
>
> If that can't be done then I guess I need to _xalloc some memory and
> abandon the use of FS2_RAM_PHYS.
>
> If so, how does the FS2 system work since it's data will also be lost
> in a power cycle?
>
> Thanks for any advice.
>
Using xalloc with an RCM3200 won't guarantee you get battery backed ram
as on segments of the xmem are battery backed. Use _xalloc because you
can specify whether you want battery backed or not...

Nathan

-----Original Message-----
From: r... [mailto:r...]
On Behalf Of alekremer
Sent: Tuesday, 10 October 2006 10:27 PM
To: r...
Subject: [rabbit-semi] Re: RCM3200, FS2_RAM_PHYS and battery backed ram

The simplest way to use the battery backed ram is using xalloc
function. Try this:

void main()
{
unsigned long physaddr,flow_rd;
char aux[10];

physaddr = xalloc(65535); // 64K bytes for user data storage
memset(aux,'\0',sizeof(aux));
strcpy(aux,"RAM TEST\0");
flow_rd = physaddr;
root2xmem(flow_rd, aux, sizeof(aux)-1); //Saving aux to RAM
memset(aux,'\0',sizeof(aux));
printf("AUX Contents Before: %s\n\r",aux); // Printing nothing
xmem2root(aux, flow_rd, sizeof(aux)-1); //Recovering data from RAM
printf("AUX Contents After: %s\n\r",aux); //Printing recovered data
}

Best regards

--- In r...
, "Robert Horton"

wrote:
>
> I'm in the middle of porting a project from the RCM2250 to the
> RCM3200. I don't use the rabbit file system, however, I store data
> located at FS2_RAM_PHYS in the area reserved by FS2_RAM_RESERVE.
This
> has worked fine with the RCM2250. Data has been preserved when the
> power has been turned off since the SRAM is all battery backed.
>
> Now when I come to use the RCM3200 (code and BIOS in flash) it
looks
> like FS2_RAM_PHYS is located in the non battery backed 512k program
> execution SRAM. When the power is cycled the data is lost.
>
> How can I relocate FS2_RAM_PHYS to the 256k (battery backed)
program
> data SRAM?
>
> If that can't be done then I guess I need to _xalloc some memory
and
> abandon the use of FS2_RAM_PHYS.
>
> If so, how does the FS2 system work since it's data will also be
lost
> in a power cycle?
>
> Thanks for any advice.
>