Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The result should be rounded up.

Anchor
FS_NAND_CFG_RSVD_AVAIL_BLK_CNT
FS_NAND_CFG_RSVD_AVAIL_BLK_CNT

FS_NAND_CFG_RSVD_AVAIL_BLK_CNT

...

Note that the FS_NAND_DfltCfg constant should be used to initialize the FS_NAND_CFG structure to default values. This will ensure all fields will automatically be set to sane default values.

Code Block
languagecpp
titleListing

...

-

...

NAND translation layer configuration structure

...

linenumberstrue
typedef  struct  fs_nand_cfg {
    void                *BSPPtr;                     (1)
    FS_NAND_CTRLR_API   *CtrlrPtr;                   (2)
    void                *CtrlrCfgPtr;                (3)
    FS_NAND_PART_API    *PartPtr;                    (4)
    void                *PartCfgPtr;                 (5)
    FS_SEC_SIZE          SecSize;                    (6)
    FS_NAND_BLK_QTY      BlkCnt;                     (7)
    FS_NAND_BLK_QTY      BlkIxFirst;                 (8)
    FS_NAND_UB_QTY       UB_CntMax;                  (9)
    CPU_INT08U           RUB_MaxAssoc;              (10)
    CPU_INT08U           AvailBlkTblEntryCntMax;    (11)
} FS_NAND_CFG;


Panel

(1) This field must be set to a pointer to the controller-specific BSP layer implementation’s API you want the controller layer to use (

...

see Board Support Package

...

). If you use a different controller layer implementation, that field might not be needed.

...

(2) This field must be set to a pointer to the controller layer implementation’s API you wish to use (

...

see Controller Layer).

...

(3) This field must be set to a pointer to the configuration structure for the specified controller layer implementation.

...

(4) This field must be set to a pointer to the part layer implementation’s API you wish to use (

...

see API structure type for generic controller

...

extension)

...

(5) This field must be set to a pointer to the configuration structure specific to the chosen part layer implementation.

...

(6) This field must contain the sector size for the device (care must be taken when choosing sector size:

...

see Performance Considerations). The

...

value FS_NAND_CFG_DEFAULT

...

 instructs the translation layer to use the page size reported by the part layer as its sector size.

...

(7) This field must contain the number of blocks you want µC/FS to use. This can be useful if you want to reserve blocks for data to be used outside the file system (by a bootloader, for example). The

...

value FS_NAND_CFG_DEFAULT

...

 instructs the translation layer to use the number of blocks reported by the part layer.

...

(8) This field must contain the index of the first block you want µC/FS to use. This can be useful if you want to reserve blocks for data to be used outside the file system (by a bootloader, for example).

...

(9) This field must be set to the maximum number of update blocks you want the NAND translation layer to use. A greater number can improve performance but will also reduce available space on the device and consume RAM. You are encouraged to experiment with different values to evaluate which one suits your application best.

...

(10) This field must be set to the maximum associativity of the random update blocks (RUB). The update blocks temporarily contain sectors from data blocks until they are merged (copied to respective data blocks). The associativity specifies the number of data blocks from which a single RUB can contain sectors. A high setting will usually lead to better overall write and read speeds and will reduce wear. However, a low setting will lower the time of execution of the worst-case write operation.

...

(11) This field must be set to the size of the available blocks table. Available blocks are ready to be erased and used as update or data blocks. The table must, at least, be large enough to contain the reserved available blocks (

...

see FS_NAND_CFG_RSVD_AVAIL_BLK_

...

CNT) and a few more for general operations. The

...

value FS_NAND_CFG_

...

DEFAULT instructs the translation layer to use 10 or (1 + FS_NAND_CFG_RSVD_AVAIL_BLK_CNT) entries, whichever is larger.