GSG: DM365 DVEVM Additional Procedures

From Texas Instruments Wiki
Jump to: navigation, search

Changing the Video Input/Output Methods

U-Boot reads the J1 jumper setting on boot-up and stores the results in the videostd environment variable. As long as your U-Boot bootcmd sets the video output using the videostd variable (as the example bootcmds in Alternate Boot Methods do), you can switch between NTSC and PAL by simply changing the SW5 switch setting as shown in Setting Up the Hardware.

To automatically update the bootargs based on the SW5 switch setting, please use the following options:

EVM # setenv bootargs 'mem=76M console=ttyS0,115200n8
root=/dev/mtdblock3 rw rootfstype=yaffs2 ip=dhcp video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=4’
EVM # setenv bootcmd 'setenv setboot setenv bootargs \$(bootargs) davinci_enc_mngr.ch0_mode=\$(videostd);run setboot;nboot 0x80700000 0 0x400000;bootm’

If you do not want to use the videostd variable in your bootcmd, use the following options within your bootargs setting. The difference between the NTSC and PAL settings is shown in bold.

NTSC

video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=4 davinci_enc_mngr.ch0_mode=ntsc

PAL

video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=4 davinci_enc_mngr.ch0_mode=pal

Putting Demo Applications in the Third-Party Menu

You can add your own demos to the Third-Party Menu by following the steps in this section. Only four demos can be shown at once in the user-interface. If you add more than four demos, the first four in alphabetical order are shown.

1) Create the following files for your demo:

  • logo.jpg. This is the logo of the third party company which will be showed next to the demo description. The picture needs to be in JPEG format and of size 50x50.
  • readme.txt. This is a text file. The first 40 characters of the file should briefly describe the demo. The demo interface displays up to 40 characters, but stops if it encounters a new line character. For example, the file might contain "Video Phone demo" or "Network Audio demo".
  • app.sh. This is an executable that launches your demo. It can either be the demo executable itself or a shell script that executes the executable. (If this is a shell script, make sure its executable bit is set for all). A script could look something like:
#!/bin/sh
exec ./mydemoname
  • other files. If app.sh is a shell script, your demo executable will have some other name. You may also need to include data files or other files used by the executable.

Note: The demo application must use relative paths to access any files it needs at runtime. This because the archive is extracted to another location from which the demo is executed.

2) Create a gzipped tar file (ends with .tar.gz) that archives all the files in the previous list. For example, if your files are logo.jpg, readme.txt, and app.sh, you could use the following command:

tar cvzf ti_videophone.tar.gz logo.jpg readme.txt app.sh

Name the tar file using <company>_<demoname>.tar.gz (with no spaces in the file name) as the convention. For example, a video phone demo created by Texas Instruments would be named ti_videophone.tar.gz. The name must be unique since all demos are installed in the same directory.

The three required files must be in the top-level directory of the archive. Other files may be in subdirectories, so long as the demo uses relative references to access them. For example, the following directory structure might be used in the archive:

|-- app.sh
|-- data
|    |-- datafile1
|    `-- datafile2
|-- logo.jpg
`-- readme.txt

To check the format of the file you create, execute the following command in Linux. The result should say "gzip compressed data".

file <filename>.tar.gz 

3) Put your archive in the "thirdpartydemos" subdirectory of the target installation directory. This is where the DVEVM software was installed on the target file system. The default target installation directory is /opt/dvsdk/dm365, so the default location for demo archives is /opt/dvsdk/dm365/thirdpartydemos. Do not extract the contents of the archive in this location. Extraction is performed behind-the-scenes each time the demo is run.

Alternate Boot Methods

The default configuration for the EVM is to boot from flash with the file system on the board's NAND flash. The following are alternate ways you may want to boot the board:

  • TFTP boot with NAND flash file system
  • Flash boot with NFS file system
  • TFTP boot with NFS file system

The subsections that follow show the environment variable settings used to enable each boot method.

To boot in one of these modes, follow these steps:

1) Power on the EVM board, and abort the automatic boot sequence by pressing a key in the console window (Described here).

2) Set the environment variables indicated in the following subsections for the boot mode you want to use. (Note that the setenv bootargs command should be typed on a single line.)

3) If you want to use these settings as the default in the future, save the environment:

EVM # saveenv

4) Boot the board using the settings you have made:

EVM # boot

For more additional reading and details on U-Boot and other options please see the U-Boot Manual.

Booting from Flash Using Board's NAND Flash File System

This is the default, out-of-the-box boot configuration.

To boot in this mode, set the following parameters after you abort the automatic boot sequence:

EVM # setenv bootcmd 'nboot 0x80700000 0 0x400000;bootm'
EVM # setenv bootargs 'console=ttyS0,115200n8 ip=dhcp root=/dev/mtdblock3 rw rootfstype=yaffs2 mem=76M  video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=4'
EVM # boot

When you boot, look for the following line that confirms the boot mode:

## Booting image at 80700000 ... 

Booting via TFTP Using Board's NAND Flash File System

To boot in this mode, set the following parameters after you abort the automatic boot sequence:

EVM # setenv bootcmd ’dhcp;bootm’
EVM # setenv bootargs ’console=ttyS0,115200n8 ip=dhcp root=/dev/mtdblock3 rw rootfstype=yaffs2 mem=76M  video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=4'
EVM # setenv serverip <tftp server ip address>
EVM # setenv bootfile <kernel image>
EVM # boot

When you boot, look for the following lines that confirm the boot mode:

TFTP from server 192.168.160.71; our IP address is 192.168.161.186
Filename ’library/davinci/0.4.2/uImage’.
...## Booting image at 80700000 ... 

Booting from Flash Using NFS File System

To boot in this mode, set the following parameters after you abort the automatic boot sequence:

EVM # setenv bootcmd 'nboot 0x80700000 0 0x400000;bootm'
EVM # setenv nfshost <ip addr of nfs host>
EVM # setenv rootpath <directory to mount*>
EVM # setenv bootargs 'console=ttyS0,115200n8 noinitrd rw ip=dhcp root=/dev/nfs nfsroot=$(nfshost):$(rootpath),nolock mem=76M video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=4'
EVM # boot

*For example, <directory to mount> might be /home/<useracct>/workdir/filesys.

When you boot, look for the following lines that confirm the boot mode:

## Booting image at 80700000 ...
...
Starting kernel ...
...
VFS: Mounted root (nfs filesystem).

Booting via TFTP Using NFS File System

To boot in this mode, set the following parameters after you abort the automatic boot sequence:

EVM # setenv bootcmd 'dhcp;bootm’
EVM # setenv serverip <ip addr of tftp server>
EVM # setenv bootfile <name of kernel image>
EVM # setenv rootpath <root directory to mount>
EVM # setenv nfshost <ip addr of nfs host>
EVM # setenv bootargs 'console=ttyS0,115200n8 noinitrd rw ip=dhcp root=/dev/nfs nfsroot=$(nfshost):$(rootpath),nolock  mem=76M video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=4'
EVM # boot

The <root directory to mount> must match the filesystem that you set up on your workstation. For example, /home/<useracct>/workdir/filesys.

When you boot, look for the following lines that confirm the boot mode:

TFTP from server 192.168.160.71; our IP address is
192.168.161.186
Filename 'library/davinci/0.4.2/uImage'.
...
Starting kernel ...
...
VFS: Mounted root (nfs filesystem).

Booting from SD card

See DM3xx SD card boot and flashing program

Restoring the NAND Flash

You can restore the contents of the DVSDK NAND flash memory on the EVM board via NFS or via RAM Disk and an SD card. These contents include the Linux kernel and filesystem and the demo application software. However, you must first update the kernel on the NAND flash as described in Updating the Kernel.

The DVSDK NAND image is included on the DVSDK (disk #2) restore directory (or the http://www.ti.com/myregisteredsoftware extranet) and is called "dm365_flash_image_#_#_#_#.tar", where #_#_#_# is the version.

For information about restoring the kernel and bootloaders, see the LSP 2.0 DaVinci Linux EVM Installation User's Guide (SPRUG94).

Updating the Kernel

The Linux kernel (uImage) can be loaded to the NAND flash via TFTP. This step is required before you restore the NAND flash, whether you plan to do that via NFS or via RAM Disk and an SD card.

To load the kernel, the file name of the kernel image that is in the server's tftp directory (usually /tftpboot) and the destination address need to be specified. Execute the following commands to download the kernel image and write to the NAND partition.

1) Copy the uImage-dm365 file to /tftpboot/uImage to rename the file as required by the following steps.

2) Assign an IP address to the EVM board using one of these methods:

  • If you are on a standalone network or using a network cross cable to your workstation, you can assign a static IP address to the EVM as follows:
EVM # setenv ipaddr <static IP address>
EVM # setenv serverip <tftp server IP address>
EVM # tftp 0x80700000 uImage
  • To assign a dynamic address, use the following commands:
EVM # setenv bootfile uImage
EVM # setenv serverip <tftp server IP address>
EVM # dhcp

3) Download the kernel image and write to the NAND flash as follows:

EVM # nand erase 0x400000 0x200000
EVM # nand write 0x80700000 0x400000 0x200000

Restoring the NAND Flash Using NFS

Once you have loaded the kernel binary to the corresponding NAND partition as described in Updating the Kernel, you can use NFS to populate the YAFFS2 image (dm365_flash_image_#_#_#_#.tar) to the NAND partition. The YAFFS2 image should reside on the NFS Server root directory. Follow these steps:

1) Copy the dm365_flash_image_#_#_#_#.tar file from the DVSDK disk to the NFS mounted root directory. For example, /home/<useracct>/workdir/filesys.

2) Set the bootcmd environment variable to boot to kernel and mount to NFS. (Alternatively use the ’dhcp’ command for the EVM IP Address.)

EVM # setenv rootpath <root directory to mount>
EVM # setenv nfshost <ip addr of nfs host>
EVM # setenv bootcmd 'nboot 0x80700000 0 0x400000; bootm'
EVM # setenv bootargs console=ttyS0,115200n8 noinitrd ip=dhcp root=/dev/nfs rw nfsroot=$(nfshost):$(rootpath) mem=76M video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=4

Note: These variables need not be saved, because NFS is just a temporary filesystem.

3) Execute the 'boot’ command to boot the Linux kernel.

4) Login to the EVM as root and execute the following set of U-Boot commands to mount the NAND partition and populate the YAFFS2 image:

EVM # mkdir /mnt/nand
EVM # flash_eraseall /dev/mtd3
EVM # mount -t yaffs2 /dev/mtdblock3 /mnt/nand/
EVM # cd /mnt/nand
EVM # tar xf /dm365_flash_image_#_#_#_#.tar
EVM # cd
EVM # umount /mnt/nand
EVM # reboot

5) When the EVM comes up after rebooting from the previous steps, press Esc to get back to U-Boot prompt. You can now restore the out-of-the-box U-Boot environment variables as described in Booting from Flash Using the Board's NAND Flash File System.

Restoring the NAND Flash Using RAM Disk and a 2 GB SD Card

This procedure assumes the TFTP setup in Section A.3 has been performed.

Once you have loaded the kernel binary to the corresponding NAND partition as described in Updating the Kernel, you can load the Ramdisk image (ramdisk.gz) to the DDR memory via TFTP. The YAFFS2 image resides on the 2 GB SD card. An MMC/SD card reader should be used to copy the YAFFS2 image on the 2 GB SD card. Follow these steps:

1) Find the RAM disk image at /home/<useracct>/dvsdk_#_#/PSP_#_#/bin and copy it to the host's /tftpboot directory.

2) After aborting the boot sequence, download the RAM disk image to the RAM as follows:

EVM # tftp 0x82000000 ramdisk.gz

3) Set the following environment variables to boot to Kernel and mount to the RAM disk.

EVM # setenv bootcmd 'nboot 0x80700000 0 0x400000; bootm’
EVM # setenv bootargs mem=76M console=ttyS0,115200n8 root=/dev/ram0 rw initrd=0x82000000,4M ip=off video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=4

Note: These variables need not be saved to the NAND flash, as the RAM disk is just a temporary filesystem.

4) Plug the 2GB SD Card into the MMC/SD slot on the DM365 EVM.

Note: If the card is not plugged in when the kernel boots the kernel will lock-up when the card is hot-plugged later.

5) Execute the following command to boot to Kernel:

EVM # boot

6) Login to the EVM using the root username. Note that "root" does not have a password.

7) Execute the following commands to mount the MMC/SD and NAND partitions and populate the YAFFS2 image:

EVM # mkdir /mnt/mmc
EVM # mkdir /mnt/nand
EVM # mount -t vfat /dev/mmcblk0 /mnt/mmc/
EVM # flash_eraseall /dev/mtd3
EVM # mount -t yaffs2 /dev/mtdblock3 /mnt/nand/
EVM # cd /mnt/nand
EVM # tar xf /mnt/mmc/dm365_flash_image_#_#_#_#.tar
EVM # cd
EVM # umount /mnt/nand
EVM # reboot

The first mount command assumes you have a VFAT partition. The tar command will take about a minute to run.

The filename of the dm365_flash_image_#_#_#_#.tar image will be in DOS 8.3 format if you are using a vfat filesystem. That is, dm365_fl.tar.

8) When the EVM comes up after rebooting from the previous steps, press Esc to get back to U-Boot prompt. You can now restore the out-of-the-box U-Boot environment variables as described here.

To continue with the EVM setup please continue with the Getting Started Guide.

Flashing UBL, u-boot, kernel and system on empty NAND flash from SD card

See DM3xx SD card boot and flashing program