NetBurner 3.5.0
PDF Version
 
EFFS-STD File System with On-chip Flash

Using the EFFS-STD File System with On-chip Flash

EFFS-FAT vs. EFFS-STD

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.

Overview

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.

Examples

EFFS STD Examples

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.

EFFS STD With NetBurner's Security Library

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.

Adding EFFS-STD Functionality to an Existing NBEclipse Project

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:

  • Right click on your project.
  • Navigate to C/C++ Build > Settings > GNC C/C++ Linker > Libraries.
  • In the Libraries section, add "StdFFile". Note there is no .a extension.


3) The third step is platform specific:

MODM7AE70, SBE70LC Platforms

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.

  • Right-click on the project and select "Properties"
  • Navigate to C/C++ Build > Settings > NB Flashpack > General
  • Check the checkbox for "Locate Application at Fixed Address in Flash"

NANO54415, SB800EX Platforms

Modify the CompCode Flag settings that are used to reserve space in the memory map for the file system.

  • Right click on your project.
  • Navigate to C/C++ Build > Settings > NBCompCode > General
  • Modify the memory address range field from:
    COMPCODEFLAGS = 0x04000 0x800000 // Original
    to
    COMPCODEFLAGS = 0x04000 0x700000 // Reserve space for file system
  • Note: The first address parameter is the start of application space, and the second is the start of file system space

MOD54415, MOD54417 Platforms

Modify the CompCode Flag settings that are used to reserve space in the memory map for the file system.

  • Right click on your project.
  • Navigate to C/C++ Build > Settings > NBCompCode > General
  • Modify the memory address range field from:
    COMPCODEFLAGS = 0xC0040000 0xC2000000 // Original
    to
    COMPCODEFLAGS = 0xC0040000 0xC1F00000 // Reserve space for file system
  • Note: The first address parameter is the start of application space, and the second is the start of file system space

Adding EFFS-STD Functionality to a Makefile for Use With Command Line Tools:

There are two modifications to the makefile needed:

  1. Add the EFFS-STD Library with the following additions to the makefile:
    XTRALIB = $(NNDK_ROOT)/platform/$(PLATFORM)/original/lib/libStdFFile.a
    DBXTRALIB = $(NNDK_ROOT)/platform/$(PLATFORM)/original/lib/libStdFFile.a
  2. Add the compcode flags (SB800EX, NANO54415, MOD5441x) or enable application fixed address (MODM7AE70, SBE70LC). The platform specfic modifications are as follows:

MODM7AE70, SBE70LC Platforms

  • Enable "Locate Application at Fixed Address in Flash" with:
    EXTRAPACKARGS += -cflag C:3

NANO54415, SB800EX Platforms

  • Modify the memory address range field from:
    COMPCODEFLAGS = 0x04000 0x800000 // Original
    to
    COMPCODEFLAGS = 0x04000 0x700000 // Reserve space for file system

MOD54415, MOD54417 Platforms

  • Modify the memory address range field from:
    COMPCODEFLAGS = 0xC0040000 0xC2000000 // Original
    to
    COMPCODEFLAGS = 0xC0040000 0xC1F00000 // Reserve space for file system

Flash Memory Addresses

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



Configuration File for SAME70Q21

Please refer to the SAME70Q21.h file located at \nburn\examples\_common\EFFS\STD\src\flashChip