NetBurner 3.5.0
PDF Version |
|
The previous 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 EFFS-STD Flash 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 dependent on the specific flash chip you are using.
The HTTP example located at \nburn\examples\EFFS\Std
demonstrates HTTP access to the STD file system. Web pages can be served from the application itself, or overridden if the same file name exists in the file system.
Example are located at \nburn\examples\SSL
HttpsUploadCert - 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.
SslVerifyPeerEffs - 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 add EFFS-STD file system to your project, you will need to complete a few extra steps in addition to your normal project setup.
For NBEclipse users, there are three steps:
1) Import the source files found here into your project <nburn_install>\examples\_common\EFFS\STD
2) Add the EFFS-STD library StdFFile.a to the linker path:
3) The third step is platform specific:
The "Locate Application at Fixed Address in Flash" feature must be enabled. This will disable the background Flash erase feature, would will erase the flash file system sectors.
Modify the CompCode Flag settings that are used to reserve space in the memory map for the file system.
Modify the CompCode Flag settings that are used to reserve space in the memory map for the file system.
There are two modifications to the makefile needed:
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<br>#define FS_SIZE ( 256*512 ) // Size of filesystem
|
Please refer to the SAME70Q21.h file located at \nburn\examples\_common\EFFS\STD\src\flashChip