4. Nand Flash Partition

4.1. About mtd

Memory Technology Device (MTD) is a category of device file system in the Linux system, mainly used for flash applications, and is a Flash Translation Layer (FTL). The main purpose of creating the MTD subsystem is to provide an abstraction layer between flash hardware drivers and high-level applications.

4.2. How to Modify Nand Partition Size

  1. cd build/boards/default/partition/

  2. Revise the size of partitions in partition_spinand.xml, and recompile the bsp (It is recommended to remove the “size_in_kb” attribute for the last partition in partition_spinand.xml. Doing so will automatically allocate the remaining space to the last sector based on the size of the NAND.)

Note: Partition sizes should be aligned with the erase size of the NAND flash, which can be found in the NAND flash specification manual. The current erase sizes are 128/256k. If you cannot obtain the erase size of the NAND flash, you can default to aligning with a 256k size.