SPINAND FLASH

version 1.2


1. Spinand Flash Production

Download SpinandPackBinTool

V001 update description:

V011 enables the dual ENV backup function by default. In this case, the SstarMakeBin used to make the master is different from before.

-SstarMakeBin: used for non-dual ENV version

-SstarMakeBin_dual_env: used for dual ENV version


1.1. Basic Files

  1. Execute SstarMakeBin

  2. Initialize SPINAND.INI(spinand)

    According to the actual flash datasheet, fill in nandid in SPINAND.INI, image_directory is the corresponding image path to be packaged:

  3. The config files(leap.def & snchk.def. Leap uses leap.def and others use snchk.def) of programmer are use to produce image file of master slice and corresponded program script, which are located in images folder:

    images folder is copied from project\image\output\images.

  4. The script to configure the partition and image path: auto_update_spinand.txt

    Note: The dynpart partition information under auto_update_spinand.txt needs to be consistent with the mtdparts under uboot.

  5. The ubi file format requires extra space to store ubi information, so the ubi partition cannot be used up completely, and the following space needs to be reserved:

    The reserved amount of common 1G bit, 2G bit, 4G bit NAND is 9MB, 17MB, 34MB.

    If it is not reserved, an error will be reported when making the master slice: no enough peb

    Eg: spinand 128M flash of public version, the total size of the ubi partition is 903 blocks, the size that needs to be reserved >= 903*2*4k + 4*4k.

    In project\image\configs\p3\spinand.ubifs.partition.dispcam.config, total size of ubi partition ≤ 0X070E0000 - 903*2*4k + 4*4k

  6. Rename the sni and pni files in SpinandPackBinTool\images\boot, change flash_list.sni to SPINANDINFO.sni; change partinfo.pni to PARTINFO.pni.

    Consistent file name with that in SpinandPackBinTool\SPINAND.INI

    Otherwise, the following error will be reported:


1.2. Execute SstarMakeBin

Execute SstarMakeBin to generate nand.bin.

Note: Change some files of SpinandPackBinTool\images\scripts_bin before executing the packaging command, the details are as follows.

V011: Change scripts to scripts_bin.

  1. Comment the following in [[cis.es.

  2. Comment the following in [[set_partition.es.

    Then execute ./SstarMakeBin -n SPINAND.INI in linux to generate nand.bin, this is the burning program, and finally use the burner to burn.


1.3. Troubleshooting

  1. If there is an error when executing the bin generation, first check whether the executed command is not supported. For example, the sd upgrade script needs to be changed to the tftp script form.

  2. The save command was executed and the partition information was re-saved, which caused the partition information to be inconsistent with the partition specified in auto_update_spinand.txt.

  3. If it is burned to the board and cannot run, first check whether the file information at the offset address corresponding to the generated bin file is correct according to the partition information. For example, if the partition offset of the IPL is 0x140000, then check whether the file content at the generated bin file address 0x140000 is the content of the IPL file.

  4. Check whether oob is disabled when the programmer is working.

  5. Use the flash tool to dump the flash start, IPL partition offset, IPL_CUST partition offset, UBOOT partition offset, and kernel partition offset on the board respectively, and compare whether they are consistent with the burned bin file.


2. Supported Flash List

Refer to flash_list.xlsx for details.


3. Programmer Reference Config

Programmer Reference Configs are as follows.(Different programmer configs may be different)

GD5F1GQ4UBYIG configs are as follows:

GD5F2GQ4UB9IG configs are as follows:


4. Spinand Flash Production Config


4.1. Product Info

CPU brand /model System
Sigmastar Linux

4.2. Program Data File (Image File)

NO. File name File sizebytes Chip Addr/Block Num
1
2
3
  • Does the image file contain Spare (OOB) data:

    ☐ Y: ________bytes

    √ N

  • Bad block management mode (whether partitioned)

    ☐ Skip method: Skip IB

    √ Partition method: Multiple Partitions (with skip IB)

    *** Need to provide partition table

  • Whether to use On-chip ECC (only Flash with on-chip ECC function)

    ☐ N

    Maximum allowable error bit parameters: _____(bits) / (bytes)

    *** The image file must contain Spare (OOB) data

    √ Y

  • Bad block mark

    Mark location (address): 800h

    Bad block mark data: 00h

Refer to snchk.def for partition information config. Open this file in binary format as follows:

Every line is a partition, and every four bytes is a piece of data. 1~4 bytes represent startblock, 5~8 represent lastblock, and 9~12 represent usedblock.

Note: The def format is big-endian storage.