SPINAND FLASH
1. Spinand Flash Production¶
Download SpinandPackBinTool
1.1. Basic Files¶
-
Execute SstarMakeBin
-
Initialize SPINAND.INI(spinand)
According to the actual flash datasheet, fill in nandid in SPINAND.INI,
image_directoryis the corresponding image path to be packaged:
-
The config files(
leap.def & snchk.def. Leap usesleap.defand others usesnchk.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. -
The script to configure the partition and image path:
auto_update_spinand.txtNote: The dynpart partition information under
auto_update_spinand.txtneeds to be consistent with the mtdparts under uboot.
-
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
-
Rename the sni and pni files in
SpinandPackBinTool\images\boot, changeflash_list.snitoSPINANDINFO.sni; changepartinfo.pnitoPARTINFO.pni.
Consistent file name with that in
SpinandPackBinTool\SPINAND.INI
Otherwise, the following error will be reported:

1.2. Execute SstarMakeBin_dual_env (SstarMakeBin) To Generate nand.bin¶
*SstarMakeBin and SstarMakeBin_dual_env are the same bins, but note that the versions are different
*If the version is used incorrectly, uboot may prompt ENV CRC ERROR after burning
Before executing the packaging command, you need to mask out the following line of SpinandPackBinTool\images\scripts_bin\[[set_partition.es:

-
execute
./SstarMakeBin_dual_env -n SPINAND.INI(Use after TAKOYAKI_DLS00V008 (not included)) -
or
./SstarMakeBin -n SPINAND.INI(Use before TAKOYAKI_DLS00V008 (included))

1.3. Troubleshooting¶
-
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.
-
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. -
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.
-
Check whether oob is disabled when the programmer is working.
-
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.