|
| 1 | +/* |
| 2 | +********************************************************************************************************* |
| 3 | +* EXAMPLE CODE |
| 4 | +* |
| 5 | +* This file is provided as an example on how to use Micrium products. |
| 6 | +* |
| 7 | +* Please feel free to use any application code labeled as 'EXAMPLE CODE' in |
| 8 | +* your application products. Example code may be used as is, in whole or in |
| 9 | +* part, or may be used as a reference only. This file can be modified as |
| 10 | +* required to meet the end-product requirements. |
| 11 | +* |
| 12 | +********************************************************************************************************* |
| 13 | +*/ |
| 14 | + |
| 15 | +/* |
| 16 | +********************************************************************************************************* |
| 17 | +* |
| 18 | +* APPLICATION CONFIGURATION TEMPLATE |
| 19 | +* |
| 20 | +* |
| 21 | +* Filename : fs_app_cfg.h |
| 22 | +* Version : V4.08.00 |
| 23 | +* Note(s) : This is an example application configuration template when using the initialization code |
| 24 | +* provided in fs_app.c. The relevant preprocessor definitions should be included in the project global |
| 25 | +* app_cfg.h. Note that the values are demonstrative only and should be configured correctly for the |
| 26 | +* targetted hardware. |
| 27 | +********************************************************************************************************* |
| 28 | +*/ |
| 29 | + |
| 30 | +#error "This file should NOT be included. Instead, the macro definitions should be copied in app_cfg.h" |
| 31 | + |
| 32 | + |
| 33 | +/* |
| 34 | +********************************************************************************************************* |
| 35 | +* MODULE ENABLE / DISABLE |
| 36 | +********************************************************************************************************* |
| 37 | +*/ |
| 38 | + |
| 39 | +#define APP_CFG_FS_EN DEF_ENABLED /* Enable/disable the file system initialization code. */ |
| 40 | + |
| 41 | + |
| 42 | +/* |
| 43 | +********************************************************************************************************* |
| 44 | +* FS CONFIGURATION |
| 45 | +* |
| 46 | +* Note(s) : This section define various prerprocessor constant used by the example initialization code |
| 47 | +* located in fs_app.c to configure the file system. |
| 48 | +********************************************************************************************************* |
| 49 | +*/ |
| 50 | + |
| 51 | +#define APP_CFG_FS_DEV_CNT 3 /* Maximum number of opened devices. */ |
| 52 | +#define APP_CFG_FS_VOL_CNT 3 /* Maximum number of opened volumes. */ |
| 53 | +#define APP_CFG_FS_FILE_CNT 5 /* Maximum number of opened files. */ |
| 54 | +#define APP_CFG_FS_DIR_CNT 5 /* Maximum number of opened directories. */ |
| 55 | +#define APP_CFG_FS_BUF_CNT (4 * APP_CFG_FS_VOL_CNT) /* Internal buffer count. */ |
| 56 | +#define APP_CFG_FS_DEV_DRV_CNT 3 /* Maximum number of different device drivers. */ |
| 57 | +#define APP_CFG_FS_WORKING_DIR_CNT 5 /* Maximum number of active working directories. */ |
| 58 | +#define APP_CFG_FS_MAX_SEC_SIZE 512 /* Maximum sector size supported. */ |
| 59 | + |
| 60 | +#define APP_CFG_FS_IDE_EN DEF_DISABLED /* Enable/disable the IDE\CF initialization. */ |
| 61 | +#define APP_CFG_FS_MSC_EN DEF_DISABLED /* Enable/disable the MSC initialization. */ |
| 62 | +#define APP_CFG_FS_NAND_EN DEF_DISABLED /* Enable/disable the NAND initialization. */ |
| 63 | +#define APP_CFG_FS_NOR_EN DEF_DISABLED /* Enable/disable the NOR initialization. */ |
| 64 | +#define APP_CFG_FS_RAM_EN DEF_ENABLED /* Enable/disable the RAMDisk initialization. */ |
| 65 | +#define APP_CFG_FS_SD_EN DEF_DISABLED /* Enable/disable the SD (SPI) initialization. */ |
| 66 | +#define APP_CFG_FS_SD_CARD_EN DEF_DISABLED /* Enable/disable the SD (Card) initialization. */ |
| 67 | + |
| 68 | + |
| 69 | +/* |
| 70 | +********************************************************************************************************* |
| 71 | +* RAMDISK DRIVER CONFIGURATION |
| 72 | +********************************************************************************************************* |
| 73 | +*/ |
| 74 | + |
| 75 | +#define APP_CFG_FS_RAM_NBR_SECS 1024 /* RAMDisk size in sectors. */ |
| 76 | +#define APP_CFG_FS_RAM_SEC_SIZE 512 /* RAMDisk sector size in byte. */ |
| 77 | + |
| 78 | + |
| 79 | +/* |
| 80 | +********************************************************************************************************* |
| 81 | +* NOR DRIVER CONFIGURATION |
| 82 | +********************************************************************************************************* |
| 83 | +*/ |
| 84 | + |
| 85 | +#define APP_CFG_FS_NOR_ADDR_BASE 0x64000000u /* Base address of flash. */ |
| 86 | +#define APP_CFG_FS_NOR_REGION_NBR 0u /* Block region within flash. */ |
| 87 | +#define APP_CFG_FS_NOR_ADDR_START 0x64000000u /* Start address of block region within NOR. */ |
| 88 | +#define APP_CFG_FS_NOR_DEV_SIZE 0x01000000u /* Device size in bytes. */ |
| 89 | +#define APP_CFG_FS_NOR_SEC_SIZE 512u /* Sector size. */ |
| 90 | +#define APP_CFG_FS_NOR_PCT_RSVD 10u /* Reserved area in percent. */ |
| 91 | +#define APP_CFG_FS_NOR_ERASE_CNT_DIFF_TH 40u /* Erase count difference threshold. */ |
| 92 | +#define APP_CFG_FS_NOR_PHY_PTR &FSDev_NOR_AMD_1x16 /* PHY pointer. */ |
| 93 | +#define APP_CFG_FS_NOR_BUS_WIDTH 16u /* Bus width. */ |
| 94 | +#define APP_CFG_FS_NOR_BUS_WIDTH_MAX 16u /* Maximum bus width. */ |
| 95 | +#define APP_CFG_FS_NOR_PHY_DEV_CNT 1u /* Number of interleaved devices. */ |
| 96 | +#define APP_CFG_FS_NOR_MAX_CLK_FREQ 0u /* Maximum clock frequency for serial flash. */ |
| 97 | + |
| 98 | +/* |
| 99 | +********************************************************************************************************* |
| 100 | +* NAND DRIVER CONFIGURATION |
| 101 | +* |
| 102 | +* Note(s) : Only include one of either the ONFI or Static configuration. |
| 103 | +********************************************************************************************************* |
| 104 | +*/ |
| 105 | + |
| 106 | + /* ----------------------- ONFI ---------------------- */ |
| 107 | +#define APP_CFG_FS_NAND_CTRLR_IMPL CTRLR_GEN /* Controller implementation. */ |
| 108 | +#define APP_CFG_FS_NAND_PART_TYPE ONFI /* Part type. */ |
| 109 | + |
| 110 | +#define APP_CFG_FS_NAND_BSP FS_NAND_BSP_XXX /* NAND BSP. */ |
| 111 | +#define APP_CFG_FS_NAND_FREE_SPARE_START 1u /* Start of available free spare area. */ |
| 112 | +#define APP_CFG_FS_NAND_FREE_SPARE_LEN 63u /* Length of available free spare area. */ |
| 113 | + |
| 114 | + |
| 115 | + /* ---------------------- STATIC --------------------- */ |
| 116 | +#define APP_CFG_FS_NAND_CTRLR_IMPL CTRLR_GEN /* Controller implementation. */ |
| 117 | +#define APP_CFG_FS_NAND_PART_TYPE STATIC /* Part type. */ |
| 118 | + |
| 119 | +#define APP_CFG_FS_NAND_BSP FS_NAND_BSP_XXX /* NAND BSP. */ |
| 120 | + |
| 121 | +#define APP_CFG_FS_NAND_BLK_CNT 2048u /* Total block count. */ |
| 122 | +#define APP_CFG_FS_NAND_BUS_WIDTH 8u /* Bus width. */ |
| 123 | +#define APP_CFG_FS_NAND_DEFECT_MARK_TYPE DEFECT_PG_L_1_OR_N_PG_1_OR_2 /* Manufacturer defect mark type. */ |
| 124 | +#define APP_CFG_FS_NAND_ECC_CODEWORD_SIZE 528u /* Size of ECC codewords. */ |
| 125 | +#define APP_CFG_FS_NAND_ECC_NBR_CORR_BITS 1u /* Maximum number of correctable bits. */ |
| 126 | +#define APP_CFG_FS_NAND_FREE_SPARE_START 1u /* Start of available free spare area. */ |
| 127 | +#define APP_CFG_FS_NAND_FREE_SPARE_LEN 63u /* Length of available free spare area. */ |
| 128 | +#define APP_CFG_FS_NAND_MAX_BAD_BLK_CNT 40u /* Maximum number of bad blocks. */ |
| 129 | +#define APP_CFG_FS_NAND_PG_PER_BLK 4u /* Pages per block. */ |
| 130 | +#define APP_CFG_FS_NAND_PG_SIZE 2048u /* Page size not including the spare area. */ |
| 131 | +#define APP_CFG_FS_NAND_SPARE_SIZE 64u /* Total size of the spare area. */ |
| 132 | + |
| 133 | + |
| 134 | + |
| 135 | +/* |
| 136 | +********************************************************************************************************* |
| 137 | +* SD CARD DRIVER CONFIGURATION |
| 138 | +* |
| 139 | +* Note(s) : No configuration is required for this driver. |
| 140 | +********************************************************************************************************* |
| 141 | +*/ |
| 142 | + |
| 143 | +/* |
| 144 | +********************************************************************************************************* |
| 145 | +* SD SPI DRIVER CONFIGURATION |
| 146 | +* |
| 147 | +* Note(s) : No configuration is required for this driver. |
| 148 | +********************************************************************************************************* |
| 149 | +*/ |
| 150 | + |
| 151 | +/* |
| 152 | +********************************************************************************************************* |
| 153 | +* MSC DRIVER CONFIGURATION |
| 154 | +* |
| 155 | +* Note(s) : No configuration is required for this driver. |
| 156 | +********************************************************************************************************* |
| 157 | +*/ |
| 158 | + |
| 159 | +/* |
| 160 | +********************************************************************************************************* |
| 161 | +* IDE/CF DRIVER CONFIGURATION |
| 162 | +* |
| 163 | +* Note(s) : No configuration is required for this driver. |
| 164 | +********************************************************************************************************* |
| 165 | +*/ |
0 commit comments