NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

EZSDK Fast Boot Streaming Video

From Texas Instruments Wiki
Jump to: navigation, search

Introduction[edit]

This document guides how to get the video demo streaming on DM816x as quick as possible. This document would guide you to get the filesystem on NAND using ubifs and data on SD card. Throughout this document there will be commands spelled out to execute. Some are to be executed on the Linux development host, some on the Linux target and some on the u-boot (bootloader) prompt. They are distinguished by different command prompts as follows:

host $ <this command is to be executed on the host>
target # <this command is to be executed on the target>
u-boot :> <this command is to be executed on the u-boot prompt>

Note! It is assumed that the SD card is created with the default filesystem.

Note! These instructions are for DM816X. To use the same steps for DM814X, kindly make the changes as required.

Reducing Autoboot time[edit]

By default the u-boot autoboot time for booting from SD card is set to 3 seconds. To reduce the time, please ensure that NAND switch SW4 on DM816x is switched ON. Boot the board and press any key to stop the u-boot autoboot to get the u-boot prompt. You can reduce the autoboot time by by executing the command:

u-boot :> setenv bootdelay 1
u-boot :> saveenv

Rebuilding the Linux Kernel[edit]

For this experiment, we are removing as well as adding some support drivers and filesystems from the default linux kernel image (size around 2.3 MB) to reduce the size to around 2 MB.

Note! The settings for linux kernel could vary according to the environment that you need.

To configure the default linux kernel configuration, execute the commands in the linux kernel directory in $EZSDK/board-support folder:

host $ make CROSS_COMPILE=path-to-Code-Sourcey-toolchain/arm-none-linux-gnueabi- ARCH=arm distclean
host $ make CROSS_COMPILE=path-to-Code-Sourcey-toolchain/arm-none-linux-gnueabi- ARCH=arm ti8168_evm_defconfig
host $ make CROSS_COMPILE=path-to-Code-Sourcey-toolchain/arm-none-linux-gnueabi- ARCH=arm menuconfig
 

Disable the following in the default linux kernel configuration:

* Bus Support
    * PCI support
* Device Drivers
    * Memory Technology Device (MTD) Support
         * NAND Device support
              * Verify Nand page writes
    * Block Devices
    * SCSI Disk Support
         * legacy /proc/scsi/ support
         * SCSI disk support
    * Serial ATA and Parallel ATA drivers
    * SPI support
    * USB support
* Filesystems
    * Second extended fs support
    * CD-ROM/DVD filesystems
         * ISO 9660 CDROM file system support
    * DOS/FAT/NT Filesystems
         * MSDOS fs support
         * VFAT (Windows 95) fs support
    * Miscellaneous filesystems
         * Journalling Flash File System v2 (JFFS2) support

Enable some of the features also, this is mainly for adding support for UBIFS:

* Device Drivers
    * Memory Technology Device (MTD) Support
         * Enable UBI - Unsorted Block Images
* Filesystems
    * Miscellaneous Filesystems
         * UBIFS file system support
             * Extended attributes support
             * Advanced compression options
                  * LZO compression support
                  * ZLIB compression support

Once the changes to the configuration have been made, make the linux kernel image and modules by executing the commands:

host $ make CROSS_COMPILE=path-to-Code-Sourcey-toolchain/arm-none-linux-gnueabi- ARCH=arm uImage
host $ make CROSS_COMPILE=path-to-Code-Sourcey-toolchain/arm-none-linux-gnueabi- ARCH=arm modules      

Copy the kernel image board-support/linux_x.x.xx-xxxxx/arch/arm/boot to /tftpboot for flashing it to NAND. Then make some of the modules with the new kernel image in the $EZSDK directory that are required in the new file system.

host $ make syslink
host $ make media-controller-utils
host $ make cmem
host $ make osal
host $ make omx

Creating the file system[edit]

For this experiment, the arago-base filesystem will be used which is present in the $EZSDK/filesystem.

Firstly, please extract the filesystem to a folder (say $HOME/targetfs)

host $ sudo tar -zxf $EZSDK/filesystem/arago-base-tisdk-image-dm816x-evm.tar.gz -C $HOME/targetfs

For the video demo to work, add the init script for loading the hd-firmware i.e load-hd-firmware.sh to the filesystem. The script can be copied from the $EZSDK/board-support/media-controller-utils_x_xx_xx_xx/src/linux/ti816x/

host $ sudo cp $EZSDK/board-support/media-controller-utils_x_xx_xx_xx/src/linux/ti816x/load-hd-firmware.sh $HOME/targetfs/etc/init.d/

To run the decode display demo at the boot time, a script is required. The script name is assumed to be "runDecodeDisplayHDMI" in the /etc/init.d folder and the contents of the script are as shown here:

#!/bin/sh

# 
# Call this function to setup and execute the demo 
# 
execute_demo()
{
    mount -t ext3 /dev/mmcblk0p2 /mnt/
    cd /usr/share/ti/ti-omx
    ./decode_display_a8host_debug.xv5T -w 1920 -h 1080 -f 60 -i /mnt/usr/share/ti/data/videos/dm816x_1080p_demo.264 -g 0 -d 0 -c h264 &
}

case "$1" in
    start)
     execute_demo
    ;;
  *)
    ;;
esac

exit 0

Note! Create a file named media-controller-utils.conf in the /etc/modprobe.d directory in the filesystem with the contents:

blacklist vpss
blacklist ti81xxfb
blacklist sii9022a
blacklist ti81xxhdmi

Once the filesystem is ready, add the modules to the folder by:

host $ sudo make linux_install syslink_install media-controller-utils_install omx_install EXEC_DIR=$HOME/targetfs

Creating the UBI Image[edit]

To create the ubifs image, mtd-utils is required on the host to create the ubifs image. Execute the following command:

host $ sudo mkfs.ubifs -r [path_to_input_filesystem] -m [minimum_I/O_size] -e [LEB_size] -c [eraseblocks_count] -o [path_to_output_ubifs.img]

LEB= Logical Erase Block Size.

eg:

host $ sudo mkfs.ubifs -r $HOME/targetfs -m 2048 -e 126976 -c 1601 -o rootfs.ubifs

This creates a ubifs image named rootfs.ubifs which will then be used by ubinize tool to generate the ubi.img.

To prepare the ubi image, tools like ubinize or ubiupdatevol can be used. In this experiment, the ubinize tool is being used. For this, a cfg config file is needed which carries some parameters for the ubinize command. Lets say the cfg file is named as ubinize.cfg and place it in the same folder as rootfs.ubifs. The contents of the configuration file looks like:

  [ubifs]               <== Section header
  mode=ubi              <== Volume mode (other option is static)
  image=rootfs.ubifs    <== Source image
  vol_id=0              <== Volume ID in UBI image
  vol_size=160MiB       <== Volume size
  vol_type=dynamic      <== Allow for dynamic resize
  vol_name=rootfs       <== Volume name
  vol_flags=autoresize  <== Autoresize volume at first mount

Note! vol_size is assumed to be 160 MiB. Depending on the partition for filesystem this may vary.

After creating the configuration file, execute the command:

host $ sudo ubinize -o [output_image] -m [min_io_size] -p [PEB_size]KiB [configuration_file]

PEB: Physical Erase Block

eg -

host $ sudo ubinize -o ubi.img -m 2048 -p 128KiB -s 2048 ubinize.cfg

This creates a ubi image with the name ubi.img. Copy this image to your filesystem $HOME/targetfs. For attaching the image to NAND, boot the board once with NFS with the target file system as $HOME/targetfs.

Flashing the u-boot to NAND[edit]

To flash the NAND with uboot, please follow the instructions at EZSDK Flashing NAND. Ensure that the boot mode is set to NAND.

Flashing the uImage to NAND[edit]

To flash the uImage to NAND, make sure the new kernel image is present in the /tftpboot folder in your host. Flash the kernel image by executing:

u-boot :> mw.b 0x81000000 0xFF 0x440000
u-boot :> tftp 0x81000000 uImage
u-boot :> nand erase 0x00280000 0x00440000
u-boot :> nand write 0x81000000 0x00280000 <kernel-size>

Note! kernel_size must be upward aligned to NAND page size.

Setting the boot parameters[edit]

After power cycling the board, change the boot parameters as shown here:

Note! Lets suppose kernel-size is 0x1f9000

u-boot :> setenv bootcmd 'nand read 0x81000000 0x00280000 0x1f9000; bootm 0x81000000'
u-boot :> setenv bootargs console=ttyO2,115200n8 rootwait rw mem=256M earlyprintk notifyk.vpssm3_sva=0xBF900000 vram=50M 
ti816xfb.vram=0:16M,1:16M,2:6M root=/dev/nfs nfsroot=$serverip:/path_to_targetfs ip=dhcp'
u-boot :> saveenv

Attaching the ubi Image[edit]

After booting, erase the partition that will be used for the filesystem and format the partition with ubiformat. Go to the folder where the ubi.img is kept on the filesystem and execute the following commands:

target # flash_eraseall /dev/mtd4
target # ubiformat /dev/mtd3 -s 2048 -f ubi.img 

Booting with the ubi filesystem[edit]

Boot the board again to use the filesystem from the nand partition. For this, set the bootargs on u-boot prompt as shown here:

u-boot :> setenv bootargs console=ttyO2,115200n8 rootwait rw mem=256M earlyprintk notifyk.vpssm3_sva=0xBF900000 vram=50M 
ti816xfb.vram=0:16M,1:16M,2:6M ubi.mtd=3,2048 root=ubi0:rootfs rw rootfstype=ubifs
u-boot :> saveenv

Once you have booted with the new file system, some tweaking of priority of scripts is required for the video demo to run as quich as possible at boot time. Execute the following commands:

target # update-rc.d load-hd-firmware.sh start 01 S .
target # update-rc.d runDecodeDisplayHDMI start 02 S .
target # update-rc.d -f psplash remove
target # update-rc.d -f udev remove
target # update-rc.d -f udev-cache remove
target # update-rc.d -f ramdisk remove
target # update-rc.d -f networking remove
target # update-rc.d -f mountnfs remove
target # update-rc.d -f mountall remove
target # depmod -a

After rebooting the board, the video demo could be seen at the boot time.

Additional References[edit]

For more information on UBI

For more information on UBIFS

FAQ on UBI

FAQ on UBIFS

Download the Latest EZSDK[edit]

The latest EZSDK is available for download from http://software-dl.ti.com/dsps/dsps_public_sw/ezsdk/latest/index_FDS.html.

The current version is 5.05.02.00. The supported platforms are DM816x and DM814x.

EZSDK Support
E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article EZSDK Fast Boot Streaming Video here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article EZSDK Fast Boot Streaming Video here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article EZSDK Fast Boot Streaming Video here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article EZSDK Fast Boot Streaming Video here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article EZSDK Fast Boot Streaming Video here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article EZSDK Fast Boot Streaming Video here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article EZSDK Fast Boot Streaming Video here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article EZSDK Fast Boot Streaming Video here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article EZSDK Fast Boot Streaming Video here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity