Programming to LS1021A-TWR NOR flash & updating ram disk image with flashcp?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Programming to LS1021A-TWR NOR flash & updating ram disk image with flashcp?

Jump to solution
1,009 Views
datho
Contributor III

I'm looking for a way to store big amounts of data onto the NOR flash (~214 Mb). I'm not familiar the process for programming the NOR flash through a Linux application as a root user. I'm also looking for a way to update a ram disk image with a Linux script command like flashcp, or programmatically through a Linux application. I am already familiar with the process for programming the ram disk image through u-boot.

I get the ramdisk image onto my board with tftp as root. According to /proc/mtd, mtd3 is the NOR Ramdisk Root File System Image so I believe that's the mtd I should be overwritting.

<flashcp -v fsl-image-core-ls1021atwr.ext2.gz.u-boot /dev/mtd3> is the command I'm running to program the yocto generated ramdisk image, but u-boot says the ramdisk image doesn't have a valid checksum.

Is there a way to program a ramdisk image to flash with a valid checksum through a Linux application? How do I place data onto the NOR flash of the LS1021A-TWR?

Tags (1)
0 Kudos
1 Solution
780 Views
Pavel
NXP Employee
NXP Employee

See recommended steps for adding new files to the P2020 root file system.

  1. 0. sudo apt-get install u-boot-tools

Following are the steps for adding files into rootfilesystem:

  1. 1. dd if=fsl_image_minimal_p2020ds.rootfs.ext2.gz.uboot of=fsl_image_minimal_p2020ds.rootfs.ext2.gz bs=64 skip=1
  2. 2. gunzip fsl_image_minimal_p2020ds.rootfs.ext2.gz
  3. 3. mkdir ./mnt
  4. 4. mount -o loop fsl_image_minimal_p2020ds.rootfs.ext2 ./mnt
  5. 5. Now, one can copy files into appropriate location under “./mnt” directory.
  6. 6. umount ./mnt
  7. 7. gzip -9 fsl_image_minimal_p2020ds.rootfs.ext2
  8. 8. mkimage -A ppc -O linux -T ramdisk -C gzip -n 'fsl_image_minimal_p2020ds.rootfs.ext2.gz.uboot' -d fsl_image_minimal_p2020ds.rootfs.ext2.gz rootfs_full.ext2.gz.uboot

+++++++++++++++++++++++

Here are the steps for re-tailoring jffs2 based rootfs

  1. 1. Follow steps 1-4 as mentioned above
  2. 2. Execute the following command

mkfs.jffs2 -b -n -e 0x20000 --pad=0x800 -r mount1/ -o rfs.jffs2

  1. rfs.jffs2 will be the jffs2 based file system containing the custom changes made through steps 1-4

As of now, we don't have any plans to switch to ubifs based file system

Please note that mkfs.jffs2 binary should be present on the host machine (x86, etc)


Have a great day,
Pavel

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

3 Replies
781 Views
Pavel
NXP Employee
NXP Employee

See recommended steps for adding new files to the P2020 root file system.

  1. 0. sudo apt-get install u-boot-tools

Following are the steps for adding files into rootfilesystem:

  1. 1. dd if=fsl_image_minimal_p2020ds.rootfs.ext2.gz.uboot of=fsl_image_minimal_p2020ds.rootfs.ext2.gz bs=64 skip=1
  2. 2. gunzip fsl_image_minimal_p2020ds.rootfs.ext2.gz
  3. 3. mkdir ./mnt
  4. 4. mount -o loop fsl_image_minimal_p2020ds.rootfs.ext2 ./mnt
  5. 5. Now, one can copy files into appropriate location under “./mnt” directory.
  6. 6. umount ./mnt
  7. 7. gzip -9 fsl_image_minimal_p2020ds.rootfs.ext2
  8. 8. mkimage -A ppc -O linux -T ramdisk -C gzip -n 'fsl_image_minimal_p2020ds.rootfs.ext2.gz.uboot' -d fsl_image_minimal_p2020ds.rootfs.ext2.gz rootfs_full.ext2.gz.uboot

+++++++++++++++++++++++

Here are the steps for re-tailoring jffs2 based rootfs

  1. 1. Follow steps 1-4 as mentioned above
  2. 2. Execute the following command

mkfs.jffs2 -b -n -e 0x20000 --pad=0x800 -r mount1/ -o rfs.jffs2

  1. rfs.jffs2 will be the jffs2 based file system containing the custom changes made through steps 1-4

As of now, we don't have any plans to switch to ubifs based file system

Please note that mkfs.jffs2 binary should be present on the host machine (x86, etc)


Have a great day,
Pavel

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

780 Views
datho
Contributor III

As it turns out, I just needed to change the architecture type to arm in mkimage. After that, I was able to program the board using flashcp with the rootfs_full.ext2.gz.u-boot. Thank you so much for your help.

0 Kudos
780 Views
datho
Contributor III

Thank you for replying Pavel, sorry I wasn't able to respond sooner. I tried to do what you were doing, except with LS1021A-TWR ramdisk images. I had to make my own custom ramdisk images to include mkimage but I was able to get the command onto the board. However after step 8 I don't see any of the files I added to the /run/mnt directory in the new root file system. I also tried programming the rootfs_full.ext2.gz.u-boot into mtd3 with flashcp, but then the u-boot loader says that the ramdisk image is invalid.

0 Kudos