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_TBL
FS_NAND_CFG_RSVD_AVAIL_BLK_TBL

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.

Listing 15-3 NAND translation layer configuration structure

L15-3(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 section 15-5 “Board Support Package - Generic Controller”). If you use a different controller layer implementation, that field might not be needed.

L15-3(2) This field must be set to a pointer to the controller layer implementation’s API you wish to use (see section 15-4 “Controller Layer”).

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

L15-3(4) This field must be set to a pointer to the part layer implementation’s API you wish to use (see section Listing 15-10 “API structure type for generic controller extension”)

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

L15-3(6) This field must contain the sector size for the device (care must be taken when choosing sector size: see section 15-7 “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.

L15-3(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.

L15-3(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).

L15-3(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.

L15-3(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.

L15-3(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 section “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.