The previoius sections of this guide have focused on the EFFS-FAT file system, which is a FAT32 file system used for external flash cards. The EFFS-STD file system uses the on-chip flash memory of your NetBurner device. It has a different set of libraries and functions than the EFFS-FAT file system. In most cases the differences between the EFFS-STD and EFFS-FAT are simply a change in functioncall prefix from f_
to fs_
. For example, the EFFS-FAT function call f_open()
is fs_open()
for EFFS-STD. A list of the documented functions can be found at STD File System.
When using the on-chip flash you need to be aware that the flash will be shared between your application and the file system. You will need to specify the amount of space to be used by the file system, while making sure you leave enough room for your application. The amount of flash used by your application is displayed each time you compile. You want to use the compressed number, not the uncompressed. You certainly want to leave enough additional space so your application can grow.
The flash memory chip will be divided into sectors, typically 4k or 64k bytes in size. The EFFS-STD file system requires that you allocate a number of these sectors to be used by the file system. Please review the data sheet for the flash memory used on your NetBurner device so you are familiar with the architecture. The configuration settings are dependant on the specific flash chip you are using.
Warning: Incorrect settings can erase the NetBurner boot monitor!
The following is a short reference for the different example applications that utlize EFFS-STD, and what their primary function is.
pageExamples-EFFS-Std - This program sets up HTTP access to the STD file system, and shows how web pages can be served from the file system, and override compiled in versions.
SSL Https Upload Cert - This program will demonstrate how to upload certificates and keys to support SSL/TLS web page access and store them in the EFFS-STD file system.
SSL Verify Peer EFFS-STD - This program will demonstrate how to upload CA Lists to use in support of verify peer, and store them in the EFFS-STD file system.
To create a project that uses the EFFS-STD file system, you will need to complete a few extra steps in addition to your normal project setup.
For NBEclipse users:
COMPCODEFLAGS
to match the new memory space of the application. The remaining space will be used for the file system. The format of the COMPCODEFLAGS
setting is: COMPCODEFLAGS <start address> <end address>
.<nburn_install>/platform/<platform>/original/lib/libStdFFile.a
<nburn_install>examples\_common\EFFS\STD
XTRALIB = c:/platform/SB72EX/original/lib/libStdFFile.a
include c:/examples/_common/EFFS/STD/common.mak
The flash memory on your NetBurner device is used for the Boot Monitor, System Parameter Storage, User Parameter Storage, Application, and now the EFFS-STD file system. A table of memory sizes for NetBurner platforms at the time of this writing is shown below. The example column illustrates one possible configuration. You can modify the parameters to suit your requirements. The COMPCODE flag starting address specifies the starting memory location of your application. The end address specifies the end location of the application. You should not modify the starting address! The Boot Monitor, Configuration Record and User Parameters occupy the space between the start of flash memory address and the start of the application memory address. You will only need to modify the end address to represent the amount of memory allocated for the flash file system.
Platform | Total Size in Bytes | Start Address | End Address | Configuration Definition Example |
---|---|---|---|---|
MODM7AE70 | 2MB | 0x00400000 | 0x005FFFFF | Example for 512K flash file system Application must begin at 0x0040600 COMPCODEFLAGS = 0x00406004 0x005A0000 #define FLASH_SIZE ( 2*1024*1024 ) // Total flash size#define FS_SIZE ( 256*512 ) // Size of filesystem |
The configuration section of the file SAME70Q21.h is shown below. The file system will the specified number of physical flash sectors for file storage and management.