RCM5700 Data Logging

I am trying to use part of the 1 MB of flash for logging some data. I have tried using the FAT file system, but there is a compilation error stating the board doesn’t support FAT. It also states it needs the macro _DRIVER_CUSTOM. Doing a #use on the macro throws a slew of errors and warnings. Does the RCM5700 not support FAT at all? If not, what is the best method of using part of the flash for storage?

I have the same need and I guess file system is not supported by the onboard flash memory. Did you get any advice on the possibility to use part of the flash memory to store data? I couldn’t find a way from the documentation…

OK,
We got it working for RCM5750 board which has 8mbit serial flash. I am confident that same would work with any custom configuration as well.
In case if somebody still looking for an answer on how to hook up serial flash to a FAT file system here is the steps we made to achieve it:

  1. Locate and open \Lib\Rabbit4000\FileSystem\FAT_CONFIG.LIB;
  2. Find FAT memory type definition and your particular configuration. In our case we added:

#elif (RCM5750)
	#define _DRIVER_0		"SFLASH_FAT.LIB"
   #define _DRIVER_0_INIT  { "SF", sf_InitDriver, _DRIVER_CALLBACK, },
   #define _DEVICE_0 { sf_InitDriver, _DEVICE_CALLBACK, 0, 0, \
   								FDDF_MOUNT_PART_ALL|FDDF_MOUNT_DEV_0, "SFLASH-1", },

Save modified file.

3.Locate and open \Lib\Rabbit4000\BOARDTYPES.LIB
4.Find serial flash size definition __BT__FAT_MAXBUFS
Add your memory size. For example:


#elif (RCM5750)
   #define __BT__FAT_MAXBUFS  8 

Save modified file.
5. This step is optional and required only if physical connection to SF chip for your board type. Locate and open \Lib\Rabbit4000\SerialFlash\SFLASH.LIB. Modify pin and port definition for your serial flash chip connection. In our case it’s already been defined.


#elif _BOARD_TYPE_ == RCM5750 || _BOARD_TYPE_ == RCM5650W
		// RCM5750/60, RCM5650W
		// define Serial Flash on serial port B, chip select on PD6
		#define SF_SPI_CSPORT		PDDR
		#define SF_SPI_CSPIN			6
		#define SF_SERPORT			SBDR
		// serial port RXB and TXB are both hosted on parallel port D
		#define SERB_TXPORT			PDDR
		#define SERB_RXPORT			PDDR

Save modified file.
6. Run \Samples\FileSystem\FAT\fmt_Device.C example and partition your SF chip for use with file system. Follow steps on STDIO interface.

SF chip now ready to be mounted for any FAT file examples

P.S. I just got an answer from Digi on the same question. Please see attached files for modified samples. This way you can specify custom FAT driver without modifying the library. Hope it helps

Apparently, this is not possible. I was told by Rabbit that they might add onboard NAND flash in the future, but for now, I guess we are out of luck.

Dont give up hope just yet guys. You can still try this if your going to use an SD card for data logging.

here are some clips of some e-mails i was talking with rabbit about a very simular issue.

If it is a question of a sample that uses flash, take a look at the FLASH_XML.C program in the C:\DCRABBIT_XX.XX\Samples\OP7200\TCPIP directory. It demonstrates how to use flash and you should be able to base your code on that.

also…

We have the SSI2_FAT.C example program that demonstrates how to do this in the C:\DCRABBIT_XX.XX\Samples\TCPIP\HTTP directory.

You can serve the pages from the FAT filesystem, but they will need to be placed on the storage device first.
The advantage of our #ximport keyword is that allows you to place the web page on the Rabbit at compile time.

Remember that FAT16 will not support long file names so your file names will need to adhere to the 8.3 standard like these:

    Filename.txt
    Mywebpge.htm
    12345678.123
    Index.htm

The following names will not work with FAT16:

    Myverylong_Filename.textfile
    Mywebpge.html
    My file name with spaces
    123456789.123
    12345678.1234

Also…

I have worked with two different customers who added an SD card interface to a Rabbit and both worked just fine.

Take a look at the RCM4300 schematic and just copy the circuit shown there.

RCM4300 documentation:
http://www.rabbit.com/products/rcm4300/docs.shtml
(See the schematic on page 3 on the right-hand side.)

So if you want to pop on a SD socket it looks like your all ready to give this a try.

Good Luck

I am attaching a sample program. this works on an RCM5750 if the directions in the comments at the beginning are followed. FAT is not supported on the RCM5700.

Can the U7 serial flash be populated and used for FAT storage? It is a Serial Dataflash device. Can the U8 SRAM also be populated and used for storage (battery backed)?

Yes, it’s possible to use the U7 dataflash as storage device. I guess the same could be true for the SRAM, but I don’t know if the filesystem could be used.
Anyway I’ve been advised by Rabbit support that mounting a chip on the core module voids its warranty.
By now we chose the solution of an external mounted serial flash, plus we plan to use an sD card with similar circuitry as 4300 module.
As Alan already wrote, Rabbit is planning to give FAT support regarding the onboard flash, but they schedule the release around may-june.

Hi, i just read this post and you said that the FAT16 system cannot support long file names, but i want to use rabbitweb and ( .zhtml ) script. How can i do for this?

Thanks.

This is the steps that i’m using for accessing the flash:

Reset banks, you can’t write to a flash memory if the memory were you want to write is not reset (flashed), the problem that it goes in banks & you have to reset the all bank:

void DB_Reset(char bank)
{
unsigned long addr;

addr = lcBaseAdrress + bank*0x10000;

_EraseFlashRange(addr, addr);
}

banks are in the size of 0x10000.

I use: lcBaseAdrress = 0x80000;

which is way above my program, but below the system staff.

All data in this bank is erased, so you need to rewrite whatever is lost.

Now to write into the memory is done by:

_ProgramFlashBlock(, , < size of what you want to write in bytes>);

You have no problem to write randomly & in any size to the flash as long that you don’t write to bytes in flash that are already been written into.

To read from flash use:

xmem2root(, , );

I think you have about 100000 times to write into one byte of flash memory.

I hope that it helped.:cool:

Hello Jetoled,

THANK YOU for your help !

It’s really what i need to finish my project !
I will try tomorrow.

thanks again.

Powerbook.

You are welcome!
One more caveat.
Write/erase cycle for AT45 chips takes as much as 50mS. Apparently to speed up access time all writes to this chip are cashed. Make sure to have stable power during write/erase cycles to FAT system, otherwise files will be corrupted.
I’ve been advised by Digi team to use functions fat_SyncFile or fat_SyncPartition to force the fat cache to file.