Re: Non volatile memory problems

"petermcs" <petermcs-/[email protected]>
Newsgroups gmane.comp.hardware.rabbit-semiconductor
Message-ID <[email protected]>
The first question to ask is have you got a battery connected to the battery voltage pins on the RCM5600W?

Second question is why not use the bbram qualifier on the variable definitions to position the data in BBRAM? This makes life much simpler. 

Looking at the .org file for the RCM5600 build of my BACnet stack demo, the RCM5600 by default has 20K of the 32K BBRAM allocated for a special buffer for FAT file operation and 12K allocated in extended memory. As far as I can recall you can actually recover the 20K for your own use if you are not using any of the FAT libraries but off the top of by head I'm not sure exactly what you have to do.

Regards,
Peter

--- In [email protected], "dynamic_c@..." <dynamic_c@...> wrote:
>
> I'm used rcm5600w with DC 10.56. I try to store data in nonvolatile memory with the following code, the problem arise when I tried unplugging the power supply for a few minutes and turn on the power supply to read the data I stored, I lost the data. Is there any wrong with this program? Thanks.
> 
> #use "rcm56xxw.lib"
> 
> #define dataADDR 0x1B28BUL // physical address of nonvolatile memory
> #define dataLength 12
> 
> char *const data = "this is data";
> char *temp;
> 
> void main(){
> 
>     brdInit();
> 
>    // close this line and remove power supply 
>    //  for testing nonvolatile memory
>    // write data to nonvolatile memory
>    //root2xmem(dataADDR, &data, dataLength);
> 
>    // read data from nonvolatile memory and store to temp array
>    xmem2root(&temp, dataADDR, dataLength);
> 
>    if(memcmp(&temp, &data, dataLength)==0){
>        printf("data is equal with temp\n");
>    }
>    else {
>        printf("data isn't equal with temp\n");
>        printf("%s\n", temp);
>    }
> }
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.