This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to build custom ubifs for XTCIEVMK2X EVM2.0 board?

Hi,

I am trying to build file system that can be burnt on the NAND flash.

I want to include my own run level scripts, my own utilities in the file system and then generate a ubifs image that can be programmed on the flash and then boot with this fs.

Could anyone point me to the steps involved in building a custom ubifs image for XTCIEVMK2X EVM2.0 board?

The MCSDK user guide doesn't contain much information on this.

Thanks

Kg

  • Hi, Kg,

    Does the UBI/UBIFS section in the User's Guide help? Take a look at the ubinize.cfg file as mentioned in the document. You should be able to put your scripts, or utilities in the file system and ru-run ubinize command. That is expand the file system cpio file, copy your stuffs to the fs, and re-generate the cpio file. Then run the ubinize command.

    Rex

  • Hi Rex,

    Thanks for the reply.

    I know the procedure to generate the ubifs image but I donot know which base file system I have to use to build my custom fs.

    Is it the one available through oe-layersetup-mcsdk.git download (Yocto project)? or the one available in mcsdk_linux_devkit installed by running arago-2013.04-armv7a-linux-gnueabi-mcsdk-sdk-i686.sh?

    And also what are the right git tags for MCSDK3.0.3.15 to checkout?

    Please reply.

    Thanks

    kg.

  • Hi, Kg,

    It would be from the Yocto build, but that basically is the tisdk-rootfs.cpio.gz unless you want to change the recipes. If you have the scripts and utilities built already (cross-compiled), you can expand tisdk-rootfs.cpio.gz, copy your files into the file system, and regenerate cpio file using "find . | cpio -H newc -o -O <path of new cpio file>" command. I am not sure how you can plug in your files to the Yocto build recipes if you decide to build the file system using Yocto build.

    The tag can be found in mcsdk_bios_xx.xx.xx/docs/MCSDK_Release_Notes.pdf of MCSDK3.0.3.

    Rex

  • Hi Rex,

    I used tisdk-rootfs.cpio.gz to build ubifs image. I extracted it to rootfs_evm dir and ran below commands to create ubi image.

    #mkfs.ubifs -r rootfs_evm/ -o ubifs_evm.img -m 2048 -e 126976 -c 3909

    #ubinize -o ubifs_evm.ubi -m 2048 -p 128KiB -s 2048 -O 2048 ubinize.cfg

    Then, I booted u-boot from NAND flash. On this u-boot prompt, I set all the mtd related env variables and then burnt above ubi image. When I tried to boot with this fs, I am getting below error -

    TCI6638 EVM # boot
    Creating 1 MTD partitions on "nand0":
    0x000000180000-0x0000038e0000 : "mtd=2"
    UBI: attaching mtd1 to ubi0
    UBI: physical eraseblock size: 131072 bytes (128 KiB)
    UBI: logical eraseblock size: 126976 bytes
    UBI: smallest flash I/O unit: 2048
    UBI: VID header offset: 2048 (aligned 2048)
    UBI: data offset: 4096
    UBI error: vtbl_check: volume table check failed: record 0, error 9
    UBI error: ubi_init: cannot attach mtd1
    UBI error: ubi_init: UBI error: cannot initialize UBI, error -22
    UBI init error 22
    UBIFS error (pid 0): ubifs_get_sb: cannot open "ubi:boot", error -19
    UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume 'ubi:boot' errno=-19!

    ubifsmount - mount UBIFS volume

    Usage:
    ubifsmount <volume-name>
    - mount 'volume-name' volume
    TCI6638 EVM #

    ATTACHED IS THE LOG.

    Please have and look and comment.

    Thanks

    kg

  • Hi Rex,

    Could you please comment on the above post?

    Thanks in advance.

    Regards

    kg

  • Hi, Kg,

    When you ubinize the file, I don't see boot file included. Could you take a look at the ubinize.cfg in the release pacakge as document descibed. the cfg file includes boot file, and file system. It appears to me that yours has only file system.

    Rex

  • Hi Rex,

    Thanks for the info. I missed putting boot files. Now its booting with my customized roofs.

    Regards

    Kg

  • Hi Rex,

    I have these below questions.

    1. Do I need to format the entire NAND flash before programming ubifs? I mean, do I have to program u-boot and then ubifs on NAND every time when I want to boot with my modified kernel and file system? Isn't it enough to erase only ubifs partition and program my new ubifs image?

    Because, for the first time when I formatted NAND and burnt u-boot & ubifs, board came up well. But when I reprogrammed only ubifs for the second time, the board didnot come up. 

    2. When I formatted and programmed my images(u-boot, ubifs) to NAND multiple times(say 5-10 times), I see some errors messages during kernel boot up.  There are related to UBI reads. Attached doc has these error messages. Kernel is coming up properly but I see these error messages. Are these because of bad blocks on NAND or because of wearing out of NAND due to frequent formating-programming?

    Please reply.

    Thanks

    kg


  • Hi Rex,

    Could you please comment on the above question?

    Thanks

    kg

  • Hi, Kg,

    I don't think you need to format the NAND every time. I never did, but in some occasion we saw customer had an issue with NAND, we'll ask them to format it to see if the problem goes away.  You don't have to reburn ubi every time. Please read through the section on how to update boot volume to update kernel only, http://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Exploring#Updating_Boot_volume_images_from_Linux_kernel

    During development period, will it be easier if you use NFS mounted file system for debugging?

    Rex