NetBurner 3.1
SSL/HttpsUploadCert/src/flashChip/SST39VF040.h
1 /*NB_REVISION*/
2 
3 /*NB_COPYRIGHT*/
4 
5 
6 /*------------------------------------------------------------------------------
7  * EFFS-STD configuration file for SST39V040 flash memory chip. This file is part
8  * of an example that allocates 64KB of flash space to the file system, and the
9  * rest to the application.
10  *
11  * To modify the amount of space allocated to the file system:
12  *
13  * 1. Change the definition in this file: #define FS_SIZE ( 64 * 1024 )
14  * 2. Change the compcode memory address range for the application in your
15  * NBEclipse project settings so that the end of the application space does
16  * not exceed the start of the file system space. See the EFFS Programmer's
17  * Guide for details, and the header comments in main.cpp of this example
18  * on how to make the changes in the NBEclipse project.
19  * 3. Be sure to add the /nburn/platform/<platform>/original/lib/libStdFFile.a library
20  * to your NBEclipse project C/C++ build linker library options. See the header
21  * comments in main.cpp for this example on how to add the library in the
22  * NBEclipse project.
23  *----------------------------------------------------------------------------*
24 
25 #ifndef _ONCHIPFLASH_H_
26 #define _ONCHIPFLASH_H_
27 
28 #include "basictypes.h"
29 #include "hal.h"
30 #include "file/fsf.h"
31 
32 
36 extern int fs_phy_OnChipFlash( FS_FLASH *flash );
37 
38 
39 #define FLASH_NAME "SST39VF040"
40 
41 
45 #define FS_FLASHBASE ( 0xFFC00000 )
46 
47 
104 #define BLOCKSIZE ( 4 * 1024 ) // Use only the 64k sectors
105 #define SECTORSIZE ( 512 ) // 8 sectors per block
106 #define SECTORPERBLOCK ( BLOCKSIZE / SECTORSIZE )
107 
108 
109 /*
110  * Specify the total amount of flash memory in the system, and the amount
111  * allocated to be used by the file system (the rest is used by the
112  * application).
113  */
114 #define FLASH_SIZE ( 512 * 1024 ) // Size of total flash in the
115  // system, 512kB
116 #define FS_SIZE ( 64 * 1024 ) // Amount allocated to file
117  // system, 64kB
118 #define FIRST_ADDR ( FLASH_SIZE - FS_SIZE ) // First file system address to
119  // use in the flash
120 #define BLOCKSTART ( 2 ) // First block where file system
121  // data starts (first 2
122  // blocks are DESCRIPTORS)
123 
124 
125 /*
126  * Descriptor Blocks:
127  * These blocks contain critical information about the file system, block
128  * allocation, wear information, and file/directory information. At least two
129  * descriptor blocks must be included in the system, which can be erased
130  * independently. An optional descriptor write cache may be configured which
131  * improves the performance of the file system. Please refer to the EFFS-STD
132  * implementation guide for additional information.
133  */
134 #define DESCSIZE ( 4 * 1024 ) // Size of one descriptor
135 #define DESCBLOCKSTART ( 0 ) // Position of first descriptor
136 #define DESCBLOCKEND ( 1 ) // Position of last descriptor
137 #define DESCCACHE ( 1024 )
138 
139 
140 #endif /* _ONCHIPFLASH_H_ */