Sign in

username or email:

password:



Not a member?
Forgot your Password?

Search rabbit-semi



Search tips

Subscribe to rabbit-semi



Discussion Groups

See Also

DSPFPGA

Discussion Groups | Rabbit-Semi | RCM6700 , VBAT & FAT

This is a group for folks designing and programming embedded systems using the Rabbit Semiconductor C-programmable microcontroller. This group is not affiliated with either Rabbit or Z-World, but is a user forum for sharing ideas, asking questions, flaunting knowledge, and other typical user group stuff. The Rabbit is a powerful uC, supported by a full-featured C-compiler.


So far in May, you have voted 0 times ou of a total of 20 votes by the community.
Please help us clean the archives from unuseful discussion threads by using the voting system! Details here.


Is this thread worth a thumbs up?

-1

RCM6700 , VBAT & FAT - akisppoli - Jul 29 16:44:18 2012

Hi all

I have a problem with RCM6700 and the fat16 filesystem.
I have 3 files, exactly :

#define FAT_BLOCK
#use "fat16.lib"
#include

FATfile data_file;
FATfile log_file;
FATfile init_file;

fat_part *first_part;

All the file operations are with fat_Xxxx (fat_Open(...) etc) commands and the filesystem is mounted with the automount USE_FEFAULTS routine.

Well, when the backup battery is mounted you leave the device unplugged from power and the files and the data are there.
If you unplug the device without a battery and after you plug it again
all the files are erased. The partition is blank.
The question is how we can tell to RCM to put the files in the flash
or if they are in flash (as I thought) the static ram holds some informations about these files ?

Thank's in advance

Akis





(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: RCM6700 , VBAT & FAT - Phil D - Jul 29 17:01:34 2012

The fat table is stored in battery backed ram, to commit it to non volitile
memory dismount and remount the file system

Phil
On Jul 29, 2012 9:44 PM, "akisppoli" wrote:
>
> Hi all
>
> I have a problem with RCM6700 and the fat16 filesystem.
> I have 3 files, exactly :
>
> #define FAT_BLOCK
> #use "fat16.lib"
> #include FATfile data_file;
> FATfile log_file;
> FATfile init_file;
>
> fat_part *first_part;
>
> All the file operations are with fat_Xxxx (fat_Open(...) etc) commands
and the filesystem is mounted with the automount USE_FEFAULTS routine.
>
> Well, when the backup battery is mounted you leave the device unplugged
from power and the files and the data are there.
> If you unplug the device without a battery and after you plug it again
> all the files are erased. The partition is blank.
> The question is how we can tell to RCM to put the files in the flash
> or if they are in flash (as I thought) the static ram holds some
informations about these files ?
>
> Thank's in advance
>
> Akis



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: RCM6700 , VBAT & FAT - Theodore Politis - Jul 29 18:40:19 2012

Thank’s Phil for your immediate answer
When I mount and dismount the file system (with automount) or when format
the device and after mounting the device the symptoms are the same.
There is a #define to tell to compiler to storte the fat table in another
location ?
Akis



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: RCM6700 , VBAT & FAT - Phil D - Jul 29 18:55:38 2012

After writing to FAT I perform;

for (i = 0; i < num_fat_devices * FAT_MAX_PARTITIONS;i +FAT_MAX_PARTITIONS) {
if (fat_part_mounted[i]) {
fat_UnmountDevice(fat_part_mounted[i]->dev);
}
} rc = sspec_automount(SSPEC_MOUNT_ANY, NULL, NULL, NULL);

to dismount and remount partitions this works for me through power cycles
without VBAT connected.

I'm using sspec_write function to write to flash i don't know if that makes
a difference

Regards

Phil
On 29 July 2012 23:40, Theodore Politis wrote:

> **
> Thank’s Phil for your immediate answer
> When I mount and dismount the file system (with automount) or when format
> the device and after mounting the device the symptoms are the same.
> There is a #define to tell to compiler to storte the fat table in another
> location ?
> Akis
>
>



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: RCM6700 , VBAT & FAT - Theodore Politis - Jul 30 2:19:22 2012

Thank's a lot Phil
 
I will try it
 
Akis


(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: RCM6700 , VBAT & FAT - Theodore Politis - Jul 30 8:12:24 2012

Hi Phil
You use the zserver lib for these functions?
Because to work with sspec_write the file argument is a (int)file hanler so i must change all the functions of open,close  etc..
(The file name must be "A/xxxxx.xxx" in order to put in in A partition ?)

Thank's
Akis


(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: RCM6700 , VBAT & FAT - Phil D - Jul 30 8:23:04 2012

I dont use zserver lib i have:

#use "fat16.lib"
#define FAT_BLOCK //
#define FAT_USE_FORWARDSLASH //
#define SSPEC_ALLOW_ANONYMOUS_WRITE
#define SSPEC_ALLOW_ANONYMOUS_WRITE
initial mount
rc = sspec_automount(SSPEC_MOUNT_ANY, NULL, NULL, NULL);

open of file
file=sspec_open("/A/labels.xml", testcontext,O_WRITE|O_CREAT, 0);
close of file
sspec_close(file);

there may be away of using the functions your already using. I
just implemented it this way after i had problems with it not working with
no VBAT

Phil

On 30 July 2012 13:12, Theodore Politis wrote:

> **
> Hi Phil
> You use the zserver lib for these functions?
> Because to work with sspec_write the file argument is a (int)file hanler
> so i must change all the functions of open,close etc..
> (The file name must be "A/xxxxx.xxx" in order to put in in A partition ?)
>
> Thank's
> Akis
>
>



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: RCM6700 , VBAT & FAT - Theodore Politis - Jul 30 9:19:10 2012

Thank's Phil

I wil try to make it like this

Akis



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: RCM6700 , VBAT & FAT - Theodore Politis - Jul 30 10:08:32 2012

Hi Phil again

When i make only the definition that you propose i have the folowing errors
//line 2371 : ERROR      : SSPEC_MOUNT_ANY is out of scope/ not declared.
//line 2371 : WARNING    : Reference to 'sspec_automount' has no corresponding prototype.

These definitions i think exist in zserver lib.
Did you have any other definitions in the environment ?
I use DC10.70

Thank's
Akis



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: RCM6700 , VBAT & FAT - Phil D - Jul 30 13:26:54 2012

Im using dc 10.64 i dont believe i have zserver defined anywhere in my code
i will check tomorow
On Jul 30, 2012 3:08 PM, "Theodore Politis" wrote:
>
> Hi Phil again
>
> When i make only the definition that you propose i have the folowing
errors
> //line 2371 : ERROR : SSPEC_MOUNT_ANY is out of scope/ not declared.
> //line 2371 : WARNING : Reference to 'sspec_automount' has no
corresponding prototype.
>
> These definitions i think exist in zserver lib.
> Did you have any other definitions in the environment ?
> I use DC10.70
>
> Thank's
> Akis



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: RCM6700 , VBAT & FAT - Theodore Politis - Jul 30 16:26:36 2012

Thank's Phil
 
I say that before because if you press ctrl+H in the ccpec_xxxxx routines, the help answer has the 'zserver lib' label.
 
Best regards
 
Akis


(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: RCM6700 , VBAT & FAT - flanderso11 - Sep 25 3:34:07 2012



--- In r..., Phil D wrote:
>
> After writing to FAT I perform;
>
> for (i = 0; i < num_fat_devices * FAT_MAX_PARTITIONS;i +> FAT_MAX_PARTITIONS) {
> if (fat_part_mounted[i]) {
> fat_UnmountDevice(fat_part_mounted[i]->dev);
> }
> } rc = sspec_automount(SSPEC_MOUNT_ANY, NULL, NULL, NULL);
>
> to dismount and remount partitions this works for me through power cycles
> without VBAT connected.
>
> I'm using sspec_write function to write to flash i don't know if that makes
> a difference
>
> Regards
>
> Phil
> On 29 July 2012 23:40, Theodore Politis wrote:
>
> > **
> >
> >
> > Thank's Phil for your immediate answer
> > When I mount and dismount the file system (with automount) or when format
> > the device and after mounting the device the symptoms are the same.
> > There is a #define to tell to compiler to storte the fat table in another
> > location ?
> > Akis
> >
> >
> >
>

Hi Phil

Dismounting and remounting the filesystem after every sspec_write() is a good solution but if I am running a FTP server simultaneously the dismounting will interrupt any ongoing file transfer. Before dismounting I would like to check if there is any file being transfered and wait with the mounting process until the transfer is complete.

Is there any way to check if there has been any activity on the FTP server during the ftp_tick() so I can safely dismount the filesystem without losing data?

BR,
Flanders





(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: RCM6700 , VBAT & FAT - Phil D - Sep 25 4:43:59 2012

There's a http_idle(void) but not sure if a similar function exists for
ftp. I don't use the ftp functions in any of my systems so not really
played with it, so i cant be much help

Sorry

Phil

On 25 September 2012 08:34, flanderso11 > wrote:

> **
> --- In r..., Phil D wrote:
> >
> > After writing to FAT I perform;
> >
> > for (i = 0; i < num_fat_devices * FAT_MAX_PARTITIONS;i +> > FAT_MAX_PARTITIONS) {
> > if (fat_part_mounted[i]) {
> > fat_UnmountDevice(fat_part_mounted[i]->dev);
> > }
> > } rc = sspec_automount(SSPEC_MOUNT_ANY, NULL, NULL, NULL);
> >
> > to dismount and remount partitions this works for me through power cycles
> > without VBAT connected.
> >
> > I'm using sspec_write function to write to flash i don't know if that
> makes
> > a difference
> >
> > Regards
> >
> > Phil
> >
> >
> > On 29 July 2012 23:40, Theodore Politis wrote:
> >
> > > **
>
> > >
> > >
> > > Thank's Phil for your immediate answer
> > > When I mount and dismount the file system (with automount) or when
> format
> > > the device and after mounting the device the symptoms are the same.
> > > There is a #define to tell to compiler to storte the fat table in
> another
> > > location ?
> > > Akis
> > >
> > >
> > >
> > >
> > Hi Phil
>
> Dismounting and remounting the filesystem after every sspec_write() is a
> good solution but if I am running a FTP server simultaneously the
> dismounting will interrupt any ongoing file transfer. Before dismounting I
> would like to check if there is any file being transfered and wait with the
> mounting process until the transfer is complete.
>
> Is there any way to check if there has been any activity on the FTP server
> during the ftp_tick() so I can safely dismount the filesystem without
> losing data?
>
> BR,
> Flanders
>
>
>



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )