Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.

Using SD card as redundant Storage device

From Texas Instruments Wiki
Jump to: navigation, search

On some platforms where NAND flash is used to store the Linux Kernel and file system images, with repeated usage bad blocks will appear. In such cases, Linux Kernel and file system images can be stored on SD card and then flashed to different offsets on a NAND flash. Steps to do this are as below:

  • Create 2 partitions on SD card. Partitions can be either FAT or EXT2 based.
  • Copy the Kernel Image to the first partition and the JFFS2 file system to second partition.
  • Boot the EVM. Erase the NAND offset where the Kernel and file system image will be written, using 'nand erase' command from u-boot.
U-Boot > nand erase 0x200000 0x400000
  • Execute 'mmcinfo' command to initialize the SD card.
U-Boot > mmcinfo
Device: davinci
Manufacturer ID: 3
OEM: 5344
Name: SD16G
Tran Speed: 25000000
Rd Block Len: 512
SD version 2.0
High Capacity: Yes
Capacity: 15931539456
Bus Width: 4-bit
  • Use either 'fatload' or 'ext2load' command (depending on the file system on SD card) to read Kernel Image and JFFS2 file system image to memory.
U-Boot > fatload mmc 0:1 0xc0700000 uImage

The above command will read uImage stored in the first FAT partition of SD card. Use the below command to read the file system from the 2nd EXT2 partition:

U-Boot > ext2load mmc 0:2 0xc1000000 file_system.jffs2
  • Flash Kernel and file system image onto NAND using 'nand write' command.
U-Boot > nand write 0xc0700000 0x200000 0x400000
  • Assuming that bootcmd and bootargs are set to boot from NAND, EVM will boot the newly flashed kernel image and file system.


NOTE

  • The above steps will work in PSP releases post DaVinci PSP 03.20.00.13 as MMC/SD support in u-boot was added in this release.
  • Addresses used in the above steps are for example purpose only. Actual offsets depends on the use case.