Getting Started Guide for DM8168 EVM: Difference between revisions

From RidgeRun Developer Wiki
mNo edit summary
 
(127 intermediate revisions by 9 users not shown)
Line 1: Line 1:
<span style="color:red ">'''Page Under Construction'''</span> <br>
<seo title="Guide for DM8168 EVM | Developer SDK Guide | RidgeRun Developer" titlemode="replace" metakeywords="GStreamer, Linux SDK, Linux BSP,  Embedded Linux, Device Drivers, Nvidia, Xilinx, TI, NXP, Freescale, Embedded Linux driver development, Linux Software development, Embedded Linux SDK, Embedded Linux Application development, GStreamer Multimedia Framework." metadescription=" Check out our Getting Started Guide for DM8168 EVM in our Developer Connection. Our team of developers guides you through our DM8168 Professional SDK."></seo>
= Introduction =
On this page you are going to find all the necessary information to start from scratch to use the RidgeRun SDK on your DM8168 evaluation module (EVM). In the following sections we assume that you have already downloaded the [http://software-dl.ti.com/dsps/dsps_public_sw/ezsdk/5_02_02_60/index_FDS.html EZSDK] version 5.02.02.60 and that you have installed the toolchain [https://www.ridgerun.com/developer/wiki/index.php/Code_Sourcery_ARM_toolchain_2009q1-203  toolchain 2009q1-203] from [http://www.codesourcery.com/sgpp/lite/arm/portal/package4573/public/arm-none-linux-gnueabi/arm-2009q1-203-arm-none-linux-gnueabi.bin codesourcery].


The first section of this guide shows you how to install the EZSDK for DM8168 on your computer and how to configure a TFTP and NFS server. Subsequently, the second section contains instructions about how to configure the RidgeRun's SDK to create a SD with all software components (uboot, kernel and filesystem) needed to boot to Linux Shell in your EVM. Using this SD in the third and fourth section of this guide, you will be able to install on NAND images created by the SDK for kernel, uboot as well as your filesystem (JFFS2, UBI, NFS are available). Using the SD created on the second section to flash the SDK in your EVM is just an option because you could try to use the installer of the RidgeRun's SDK with the uboot version that is running by default in a new EVM, however, we cannot guaranty that it will work as we expect, hence, we recommend to use the SD instead. Finally, how to run opemax demos to encode and decode 1080p/h264 videos and some pipelines using gstreamer + openMax are shown.


On the rest of this document, we refer as $(DEVDIR) to the path where the RidgeRun SDK for DM8168 is installed
= Introduction  =
 
On this page you are going to find all the necessary information to start from scratch to use the RidgeRun SDK on your DM8168 evaluation module (EVM). In the following sections we assume that you have already downloaded the [http://software-dl.ti.com/dsps/dsps_public_sw/ezsdk/5_05_02_00/index_FDS.html EZSDK] version 5.05.02.00 and that you have installed the [https://developer.ridgerun.com/wiki/index.php/Code_Sourcery_ARM_toolchain_2009q1-203 toolchain 2009q1-203] from [http://www.codesourcery.com/sgpp/lite/arm/portal/package4573/public/arm-none-linux-gnueabi/arm-2009q1-203-arm-none-linux-gnueabi.bin codesourcery].
 
The first section of this guide shows you how to install the EZSDK for DM8168 on your computer and how to configure a TFTP and NFS server. Subsequently, the second section contains instructions about how to configure the RidgeRun's SDK to create a SD card with all software components (uboot, kernel and filesystem) needed to boot to Linux Shell in your EVM. Using this SD card in the third and fourth section of this guide, you will be able to install on NAND images created by the SDK for kernel, uboot as well as your filesystem (JFFS2, UBI, NFS are available). Using the SD card created on the second section to flash the SDK in your EVM is just an option because you could try to use the installer of the RidgeRun's SDK with the uboot version that is running by default in a new EVM, however, we cannot guaranty that it will work as we expect, hence, we recommend to use the SD card instead. Furthermore we describe how to enable the Graphics SDK support on the Professional SDK. Finally, how to run opemax demos to encode and decode 1080p/h264 videos and some pipelines using gstreamer + openMax are shown.


= Basic preliminary work =
= Basic preliminary work =
== Installing the EZSDK ==
'''Please skip below two steps (2.1 and 2.2) and jump to 2.3 if you purchased a Professional SDK.'''
1. Set the ezsdk binary as executable and set correct permissions
== Getting the RidgeRun's EVAL SDK Irazu  ==
 
If you want to get the RidgeRun's EVAL SDK Irazu you need to go to our [http://www.ridgerun.com/download-evaluation-sdk Evaluation SDK Download Link] and select the Evaluation SDK you need. You will be asked for your email address and some information. Once you have submitted the required information you will receive an email with the following information:
 
Sequence of evaluation sdk download events: <br>
 
You have to follow the steps below : <br>
 
When you select and click on the name of evaluation sdk you want to download, shopping cart page will display with the price $0.00 (for eval sdk's)
<br>
-> click on 'Go to Checkout'. It will display 'Your Shopping Bag' page
<br>
-> click on 'Checkout'. You will get a form to enter your email id and other info
<br>
-> click on 'Continue'. It will display a 'Place Order' page
<br>
-> click on 'Place Order'. And then Please check your email with a link to download the '''tar''' file for the evaluation SDK you have selected.
<br>
 
== Installing the EVAL SDK version  ==
 
RidgeRun delivers the SDK in either two ways: a tar file for x86 platforms, or for customers with a established development relationship through a custom SCM (typically GIT) repository. If you are using a shared SCM repository, please contact RidgeRun for a detailed instructions.
 
=== System Requirements  ===
 
Listed below are the minimum recommended requirements for installing and using the RidgeRun SDK:
 
*A host computer with a 686 or better family processor
*1 GB free hard disk space
*A Linux distribution configured on the host computer.  
*Target hardware for the SDK
*Optional: a network card installed and configured on the host computer
*Optional: Internet connection for SDK updates
 
Once you have downloaded the tar file of the evaluation SDK you can untar it by running the following command:
 
<pre style="background:#d6e4f1">
<pre style="background:#d6e4f1">
sudo chmod 777 ezsdk_dm816x-evm_5_02_02_60_setuplinux
tar -xvzf <name of the tar file downloaded>.tar.gz
</pre>
</pre>
2. Install EZSDK. For ubuntu versions different than Ubuntu 10.04 LTS 32-bit you will need to add the --force-host argument to install it:
 
You may find it convenient to untar the evaluation SDK more than once. For example, you might want one version to be unmodified and another version to be your working development directory. RidgeRun suggests you untar the SDK development directories in your '''$HOME/work/''' directory. When you have more than one development directory installed, just remember to have the '''DEVDIR''' shell variable set properly. To set the '''DEVDIR''' shell variable use the '''`make env`''' command specified at [http://developer.ridgerun.com/wiki/index.php?title=RidgeRun_Irazu_SDK_User_Guide#Build_SDK RidgeRun_Irazu_SDK_User_Guide#Build_SDK]
 
On the rest of this document, we refer as $DEVDIR to the path where the RidgeRun Eval SDK for DM8168 EVM is installed.
 
== Installing the Professional SDK version ==
 
When all the purchase process is done, RidgeRun will provide you a GitHub repository access. For that, the GitHub user ID and other information might be requested. Once you provide that information,
you must clone the given repository URL, using the next command:
 
<pre style="background:#d6e4f1">
<pre style="background:#d6e4f1">
./ezsdk_dm816x-evm_5_02_02_60_setuplinux --force-host
git clone git@github.com:RidgeRun/<customer>.git
</pre>
</pre>
'''note:''' During the EZSDK installation process you will be asked for the toolchain's path, assuming that you installed it on /opt, the path that you need to provide is /opt/codesourcery/arm-2009q1/bin/


==Setting up serial access to the Linux console==
This would have the proper '''<customer>''' space modified. With this, you will have the SDK installed on the directory you were when executed the clone command.
You use the serial port to control u-boot and Linux. The picocom terminal emulator work well for this purpose.
 
RidgeRun suggests you install the SDK development directories in your '''$HOME/work/''' directory. When you have more than one development directory installed, just remember to have the '''DEVDIR''' shell variable set properly. To set the '''DEVDIR''' shell variable use the '''`make env`''' command specified at [http://developer.ridgerun.com/wiki/index.php?title=RidgeRun_Irazu_SDK_User_Guide#Build_SDK RidgeRun_Irazu_SDK_User_Guide#Build_SDK]
 
On the rest of this document, we refer as $DEVDIR to the path where the RidgeRun Professional SDK for DM8168 EVM is installed.
 
== Installing the EZSDK  ==
 
1. Set the ezsdk binary as executable and set correct permissions
<pre style="background:#d6e4f1"> sudo chmod 777 ezsdk_dm816x-evm_5_05_02_00_setuplinux
</pre>
2. Install EZSDK. For ubuntu versions different than Ubuntu 10.04 LTS 32-bit you will need to add the --forcehost argument to install it:
<pre style="background:#d6e4f1"> ./ezsdk_dm816x-evm_5_05_02_00_setuplinux --forcehost
</pre>
'''note:''' During the EZSDK installation process you will be asked for the toolchain's path, assuming that you installed it on /opt, the path that you need to provide is /opt/codesourcery/arm-2009q1/bin/
 
== Configuring the bsp/mach symbolic link for Eval-SDK  ==
 
The evaluation SDK for DM8168 supports Z3 and EVM platforms into the same SDK, so for choose one of them is necessary to run the next lines.
<pre> # For an totally clean SDK #
    make config
    make coreconfig
    make
</pre>
The coreconfig target will show the following option where you have to choice the mach-dm8168-z3:
 
    Selecting machine/board:
    1. mach-dm8168-z3
    2. mach-dm8168-tievm
 
== OPTIONAL: Installing AAC encoder and MP3 Decoder  ==
 
The DM81xx platforms have the ability to encode AAC-LC and decode MP3 on the DSP using openMax+gstreamer, however, these codecs are not in the EZSDK by default. The Ridgerun SDK for the DM8148/DM8168 has internal logic to integrate these codecs and generate a new DSP firmware if these codecs are installed properly in your host computer. This new DSP firmware will be automatically loaded by into the DSP during boot time.
 
1. Download the AAC-LC encoder from TI Web page, this is called [http://software-dl.ti.com/dsps/dsps_public_sw/codecs/C674X_Audio_Codecs/01_00_001/index_FDS.html AAC LC Encoder, Version 01.00.01.00]
 
2. Download the MP3 decoder from TI Web page, this is called [http://software-dl.ti.com/dsps/dsps_public_sw/codecs/C674X_Audio_Codecs/01_00_001/index_FDS.html MP3 Decoder, Version 1.41.00.00]
 
3. Install the AAC-LC encoder inside of your EZSDK directory, i.e, your destination directory '''MUST''' be /home/&lt;user&gt;/ti-ezsdk_dm816x-evm_5_05_02_00/component-sources/'''c674x_aaclcenc_01_00_01_00_elf'''. Please be sure that '''c674x_aaclcenc_01_00_01_00_elf''' is in your destination path
<pre style="background: none repeat scroll 0% 0% rgb(214, 228, 241);"> sudo chmod 777 c674x_aaclcenc_01_00_01_00_elf.bin
./c674x_aaclcenc_01_00_01_00_elf.bin
</pre>
4. Install the MP3 decoder inside of your EZSDK directory, i.e, your destination directory must be something like /home/&lt;user&gt;/ti-ezsdk_dm816x-evm_5_05_02_00/component-sources/c674x_mp3dec_01_41_00_00_elf
<pre style="background: none repeat scroll 0% 0% rgb(214, 228, 241);"> sudo chmod 777 c674x_mp3dec_01_41_00_00_elf.bin
./c674x_mp3dec_01_41_00_00_elf.bin
</pre>
5. Delete existing EZSDK tarball out of the way if you have build the RidgeRun SDK previously.
<pre style="background: none repeat scroll 0% 0% rgb(214, 228, 241);">cd &lt;pathOfYourDevdir&gt;
`make env`
rm -f $DEVDIR/downloads/ti-ezsdk_dm816x-* /opt/ridgerun/downloads/ti-ezsdk_dm816x-*
</pre>
6. Open a make config menu and select the '''Support external AAC and MP3 audio codecs option''' over the '''Proprietary software category.'''
<pre style="background: none repeat scroll 0% 0% rgb(214, 228, 241);">
make config
</pre>
[[Image:DM81xxAudio.png|thumb|center|400px]]
<div style="text-align: center;">Optional selection of external AAC and MP3 audio codecs support </div>
'''NOTE: If you built your SDK before to enable the audio support you need to remove the EZSDK tarball that were generated by the SDK in /opt/ridgerun/downloads thus the SDK will generate a new one including the audio codecs.'''
 
== Setting up serial access to the Linux console ==
 
You use the serial port to control u-boot and Linux. The picocom terminal emulator work well for this purpose.  
 
::[[Setting up Picocom - Ubuntu]]
::[[Setting up Picocom - Ubuntu]]


==Setting up a TFTP server==
== Setting up a TFTP server ==
If you are planning to use the SDK's installer to install images generated by the SDK in NAND, installing a TFTP server you will speed up downloads to the target hardware by using TFTP.
 
If you are planning to use the SDK's installer to install images generated by the SDK in NAND, installing a TFTP server you will speed up downloads to the target hardware by using TFTP.  
 
::[[Setting Up A Tftp Service]]
::[[Setting Up A Tftp Service]]


==Setting up an NFS server==
== Setting up an NFS server ==
For application development, it is convenient to use root NFS mount file system for the target hardware. This allows you to rebuild your application on the host and immediately run the application on the target hardware with no interveining steps. You host PC needs to be configured as a NFS server for this in order to work properly.  
 
For application development, it is convenient to use root NFS mount file system for the target hardware. This allows you to rebuild your application on the host and immediately run the application on the target hardware with no interveining steps. You host PC needs to be configured as a NFS server for this in order to work properly.  
 
::[[Setting Up A NFS Service]]
::[[Setting Up A NFS Service]]


= Booting from SD =
= Booting from a SD card  =
== Setting up your EVM to boot from SD card ==
 
In order to boot from a SD card you need to set the MMC as the first boot device to try in the DM8168 boot sequence, this can be done configuring a correct BTMODE through the switch SW3 in your EVM (see Fig. 1)
== Setting up your DM8168 EVM to boot from SD card ==
[[Image:DM8168SW3.JPG|400px|thumb|center|Figure 1. Dip switch to control boot mode (SD card)]]  
 
In order to boot from a SD card you need to set the MMC as the first boot device to try in the DM8168 boot sequence, this can be done configuring a correct BTMODE through the switch SW3 in your EVM (see Fig. 1) [[Image:SDswitch.png|thumb|center|400px|SDswitch.png]]
<div style="text-align: center;">'''Figure 1'''. Dip switch to control boot mode (SD card)</div>
== Configuring SDK to deploy firmware to a SD card  ==
 
This section describes how to configure the DM8168's SDK to deploy all basic firmware components (kernel, uboot and MLO) into a bootable SD card. The RidgeRun SDK support several filesystem types (JFFS2, NFS, etc) however in this case we are going to use it on the SD card as well.
 
1. Set your environment variables
<pre style="background:#d6e4f1">  cd $DEVDIR
`make env`
</pre>
2. Open a make config menu
<pre style="background:#d6e4f1"> make config
</pre>
running make config your SDK is going to download all basic packages needed by the SDK build system.
 
3. Go to Installer Configuration submenu and configure your installer as is shown in Fig.2 [[Image:InstallerMenuDM8168.png|thumb|center|400px|InstallerMenuDM8168.png]]  
<div style="text-align: center;">'''Figure 2'''. Installer configuration to deploy firmware to an SD card</div>
Using the ''Firmware deployment mode'' submenu you can set how to deploy your kernel, uboot and filesystem image into your target board. There are three options in this submenu: ''Attached board on communication port'', ''Deploy all the firmware to an SD card'' and ''Create an SD card installer for flash memory''.


<div style="text-align: center; ">'''Figure 1'''. Dip switch to control boot mode (SD card)</div>
*'''Attached board on communication port''' will allow you to send images to your target board using a serial port or a TFTP server, more details about this option are explained in the next section.
== Configuring SDK to deploy firmware to a SD ==
*'''Deploy all the firmware to an SD card''' tells to the installer that it must create the needed partitions on a SD card located in ''SD device on Linux host'' (please be sure that the option called ''Flash SD card image into loopback file instead of real SD'' is not selected) and that it have to install there the software's images generated by the SDK.
This section describes how to configure the DM8168's SDK to deploy all basic firmware components (kernel, uboot and MLO) into a bootable SD card. The RidgeRun SDK support several filesystem types (JFFS2, NFS, etc) however in this case we are going to use it on the SD as well.
*'''Create an SD card installer for flash memory''' is going to create and SD card with all the logic and software's images needed to flash the EVM's NAND from the SD card.
1. Set your environment variables
 
<pre style="background:#d6e4f1">
<br> 4. Go to File System Configuration submenu and configure your filesystem as is shown in Fig.3 [[Image:FSC.png|thumb|center|400px|FSC.png]]
<div style="text-align: center;">'''Figure 3'''. File system configuration to use it on the SD‎</div>
5. Compile your SDK
<pre style="background:#d6e4f1"> make
</pre>
== Installing SDK's firmware to a SD card  ==
 
Once you have built your SDK, you need to install it on the SD card running make install, but before to issue this command you need to unmount your SD card, otherwise the SDK won't let you install it (in order to avoid to erase information in some of your hard disks). Let's suppose that the environment variable called $SDNAME contains your mount point's name (Normally if you press tab after umount /media/ it will complete it with you SD card name, if you have problems to find the name you can use commands like "df" or "mount" to verify it)  
<pre style="background:#d6e4f1"> umount /media/$SDNAME
cd $DEVDIR
make install
</pre>  
you will be asked to confirm the device that you are going to partition and format, please enter ''yes'' if it is correct. After this, the SDK will start to create a bootable SD card
 
Now you are ready to test your SDK booting from a SD card. Two partitions were created by the SDK: ''boot partition'' which contains the kernel, uboot and MLO image and the ''rootfs partition'' with your file system. It's important to notice that the environment of uboot is located in a *.txt file in the partition called ''boot'', which allows you to modify it easily.
 
= Booting from NAND  =
 
This section describes how to configure the DM8168's SDK to install the SDK's firmware in NAND as well as how to set up your EVM to boot from NAND. First, we are going to start flashing uboot in NAND using the SD card created in the above section, once uboot is running properly from NAND, we can start installing the kernel and finally your filesystem.  
 
== Configuring SDK to install firmware in NAND  ==
 
1. Set your environment variables  
<pre style="background:#d6e4f1"> cd $DEVDIR
  `make env`
  `make env`
</pre>
2. Open a make config menu
<pre style="background:#d6e4f1"> make config
</pre>
3. Go to Installer Configuration submenu and configure your installer as is shown in Fig.4 [[Image:InstallerMenuAttachedMethod.png|thumb|center|400px|InstallerMenuAttachedMethod.png]]
<div style="text-align: center;">'''Figure 4'''. Installer configuration to deploy firmware in NAND</div>
<br> In this case, you must use the ''Attached board on communication port'' method, this will allow you to install all your firmware directly in nand by means of a serial port or by ethernet using a TFTP server. Here we are going to use a TFTP server and telnet as our communication method with the target board.
<br> 3.1 Go to the ''Communication method with the target board'' and select ''Telnet-serial adaptor''
3.2 Configure the protocol to transfer images as TFTP
3.3 Set the IP address of your host machine in ''IP address of telnet-serial adaptor''
3.4 Set the port number that you assigned in the telnet configuration file to the serial port where your EVM is connected in ''Network port of telnet-serial adaptor''
4. Close the make config menu and save your changes.
== Configuring your Filesystem type  ==
The RidgeRun SDK for DM8168 EVM supports different filesystem types: UBI, JFFS, NFS and also as we mentioned before you can use it in your SD card as well. In this tutorial we are going to use UBI as our default filesystem.
1. Set your environment variables
<pre style="background:#d6e4f1"> cd $DEVDIR
`make env`mach-dm8168-marlin/
</pre>
2. Open a make config menu
<pre style="background:#d6e4f1"> make config
</pre>
3. Go to the ''File System Configuration-&gt;File system image target'' and choose UBIFS volume. Please be sure that UBIFS sub-page size is set to 512.
4. Save your changes and compile your SDK
<pre style="background:#d6e4f1"> make
</pre>
== Flashing uboot, kernel and filesystem in NAND  ==
1.Boot the RidgeRun SDK using the SD card created in the [https://www.ridgerun.com/developer/wiki/index.php/Getting_Started_Guide_for_DM8168#Booting_from_a_SD_card first section] of this guide and stop the uboot countdown. Close your Picocom, minicom or telnet session.
<pre style="background:#FFFFC0">U-Boot 2010.06 (Apr 29 2013 - 15:46:20)
DRAM:  2 GiB
Using default environment
Hit any key to stop autoboot:  0
mmc1 is available
reading u-boot.bin
185432 bytes read
## Starting application at 0x80800000 ...
U-Boot 2010.06 (Apr 29 2013 - 15:46:20)
TI8168-GP rev 1.1
ARM clk: 987MHz
DDR clk: 796MHz
I2C:  ready
DRAM:  2 GiB
NAND:  256 MiB
*** Warning - booting from SD, using default environment
:,;;:;:;;;;;;;;r;;:,;;:;:;;;;;;;;:,;;:;:;;;;;;;;:,;;:;:;;;;;;;;:;;;;;;;;:,;;:;:
;,;:::;;;;r;;;rssiSiS552X5252525259GX2X9hX9X9XX2325S55252i5:,;;:;:;;;;;;;;:,;;:
;:;;;;;;;rrssSsS52S22h52299GGAAMHMM#BBH#B#HMM#HMBA&amp;&amp;XX2255S2S5Si:,;;:;:;;;;;;;;
;:;;r;;rsrrriiXS5S329&amp;A&amp;MH#BMB#A&amp;9XXA252GXiSXX39AAMMMBB&amp;G22S5i2SSiiiisi:,;;:;:;
;;;;;r;rr2iisiih393HB#B#AA99i22irrrX3X52AGsisss2Xii2299HBMA&amp;X2S5S5iSiisSsi:,;;:
r:r;rrsrsihXSi2&amp;##MHB&amp;Ahh3AGHGA9G9h&amp;#H##@@@##MAMMXXX9SSS29&amp;&amp;HGGX2i5iisiiisisi:,
;;rrrrsSiiiA&amp;ABH&amp;A9GAGhAhBAMHA9HM@@@@@@@@@@@@@@@@@@@HHhAh2S2SX9&amp;Gh22SSiisiiisii
r:rrssisiS2XM##&amp;h3AGAX&amp;3GG3Ssr5H@M#HM2;&nbsp;;2X&amp;&amp;&amp;MHMB###GBB#B&amp;XXSSs529XX55iSsisisi
r;rsrisSi2XHAhX99A3XXG&amp;&amp;XS;:,rH#HGhAS  @@@@3rs2XBM@@A552&amp;&amp;AHA2XiisSS252SSsisSs
r;issi5S22&amp;&amp;3iSSX292&amp;hXsr;;:;h@&amp;G339&amp;S9@@@@2@MA&amp;9&amp;HB##Xris29ABMAAX2ir;rsSi5iss5
rrsSi2XhG&amp;9GXh399&amp;X99i;;;;;;r#H&amp;293H9X#@@@@@@@B&amp;9GhAH@XrrsrsiXABHB&amp;HG2rr;rrSiSi
;:rsisS599&amp;AA9XG&amp;3A35r;:::;,;BMh&amp;&amp;2iX5A@@@@@@@&amp;392X5GB2;;;r;iSX393A##A&amp;Xi:::rsi
;:rss552222X553&amp;XHMhir;;::,:,h#HhGSXhG3#@@@@#AXXS2XAHA;::;;;;ss55XShBA3239r:,;;
r;ii2S5SSi2i53hirsh2srr::,,,,;MMXX359&amp;Ah3h&amp;Si59SX99A#i:,::::;;sri2,.2r;:SGAr;,:
;:;rrrrssiriXGSi::shs;;;,,,:,,rBBA9h5s5h5iS5isi2SAHB5:,,,:::;rrs5&amp;SrisSX5Srrr:,
;,r;;;;rsriSSrrrr;;5Xrr;;,:,,.,;9AA2SsisS5323XXXG9&amp;i:.,,::;;r;;;srrrrrr;;:;::::
:,;r;r;rrissrrr;:;::;s;;;;,:,,..,r293h222hXXAAGGGX;:,,,:,:,::;:;::,:,,,,...,,,,
;,;;;;rrrrrrrrirr;,.,,:::::::,,,,.,;SX&amp;ABAB2hhXir:,,.,,.,,:,,,,..,,,..,..,,,..:
:.:;:;;;:;;;;r;rrs;:.. ,,:::::,:,:,,.::rrsrr;;,,.......,..,....,,,,,,,...,.,,:,
:.:::,::::::;;r;rrr;:.......,.,.,,:::,,...............,,::.,,,,:,::,,:,:,,,:,;:
,.::,:,,,,,;;;;;;;;r;;::,..............................;;;:;::::,:::::::,:,:,,,
: ,,:,,,,,,,,,,,,,:;rrr;;:;,,,,,,,::,.,.:.,.,;s,:;;;;:;:;;;;;::::,:::,:::,:,:,:
,.,,,,,,,...,,.,,....................................:,............:,,,:,:,,,,,
Net:  &lt;ethaddr&gt; not set. Reading from E-fuse
Detected MACID:90:d7:eb:20:62:b4
Ethernet PHY: GENERIC @ 0x01
DaVinci EMAC
Hit any key to stop autoboot:  0
TI8168_EVM#
</pre>
2.Run make installbootloader to install uboot in NAND
<pre style="background:#d6e4f1"> make installbootloader
</pre>
3.Turn off your EVM and configure it to boot from NAND (please see [https://www.ridgerun.com/developer/wiki/index.php/Getting_Started_Guide_for_DM8168#Setting_up_your_EVM_to_boot_from_NAND Setting up your DM8168 EVM to boot from NAND]). Turn on your EVM and repeat step 1.
4. Now, to install your kernel and filesytem run make install
<pre style="background:#d6e4f1"> make install
</pre>
Now you have installed all the SDK components in your DM8168 EVM and you should be able to boot to Linux shell and see the logo of RigeRun on the HDMI output. The RidgeRun SDK for DM8168 EVM loads automatically all the firmware and kernel modules needed to use the video processor subsystem.
== Setting up your DM8168 EVM to boot from NAND  ==
In order to boot from a NAND you need to set it as the first boot device to try in the DM8168 boot sequence, this can be done configuring a correct BTMODE through the switch SW3 in your EVM (see Fig. 5) [[Image:NANDSWITCH.png|thumb|center|400px|NANDSWITCH.png]]
<div style="text-align: center;">'''Figure 5'''. Dip switch to control boot mode (NAND)</div>
== Introduction to NAND memories  ==
If you are more interested on NAND concepts and what is supported on the DM816x please read [http://developer.ridgerun.com/wiki/index.php?title=Introduction_to_Nand_Memories Introduction to NAND memories]
= Graphics SDK - OpenGL - Qt  =
The Professional Ridgerun SDK includes Graphics SDK 4.04.00.02 completely integrated, supporting the SGX530 3D Graphics Engine through the PowerVR driver. It also includes support to use Qt to render through the PowerVR kernel module.
1. In order to enable the Graphics SDK in your SDK, please download and install in your home directory the [http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/gfxsdk/4_04_00_02/index_FDS.html Graphics SDK 4.04.00.02] from the TI web page
<pre style="background:#d6e4f1">sudo chmod 777 Graphics_SDK_setuplinux_4_04_00_02.bin
./Graphics_SDK_setuplinux_4_04_00_02.bin
</pre>
2.Then open a make config menu
<pre style="background:#d6e4f1">cd $DEVDIR
make config
</pre>
3. Go to the Proprietary software and enable the graphics SDK. [[Image:GraphicsSDKMenu.png|thumb|center|400px|GraphicsSDKMenu.png]]
<div style="text-align: center;">'''Figure 6'''. SDK boot log after enable the Graphics SDK</div>
4. Go to File System Configuration -&gt; Select target's file system software -&gt; qt-4.7.2 and select Support openGL and its demo. Finally disable the option called Make QT as compact as possible.
5. Close the menu, save your configuration and build your SDK.
<pre style="background:#d6e4f1">cd $DEVDIR
make
</pre>
6. Install your SDK in your board
<pre style="background:#d6e4f1">make install
</pre>
7. Boot your board, you will see the following message
<pre style="background:#FFFFC0">Starting System
done.
Welcome to
__________ .__    .___              __________               
\______  \|__|  __| _/  ____    ____ \______  \ __ __  ____ 
|      _/|  | / __ |  / ___\ _/ __ \ |      _/|  |  \ /    \
|    |  \|  |/ /_/ | / /_/  &gt;\  ___/ |    |  \|  |  /|  |  \
|____|_  /|__|\____ | \___  /  \___  &gt;|____|_  /|____/ |___|  /
        \/          \//_____/      \/        \/            \/
         
    Embedded Linux Solutions
For further information see:
http://www.ridgerun.com
Build host: dsoto-Latitude-E5430-non-vPro
Built by: dsoto
Build date: Thu, 02 May 2013 16:47:40 -0600
Build tag: dm8168-tievm
Configuring network interfaces
SGX revision:  0x10205
Build type:  release6.x
Loaded PowerVR consumer services.
Please press Enter to activate this console.
</pre>
8. Finally run one of the openGL demos or one of the qt + openGL demos
<pre style="background:#FFFFC0">export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib;
export QWS_DISPLAY="powervr";
export QT_PLUGIN_PATH=/usr/plugins;
export QT_QWS_FONTDIR=/usr/lib/fonts
cd /opt/gfxsdkdemos/ogles2/
/opt/gfxsdkdemos/ogles2 # ./OGLES2Skybox2
PVRShell: EGL 1.4 initialized
cd /examples/opengl/hellogl_es2
./hellogl_es2
</pre>
= OpenMax Demos  =
To run the openMax's demos that are located by default in your filesystem in a directory called ''omx'' you need to run first the following commands in your EVM
=== Video initialization  ===
<pre style="background:#FFFFC0">echo 0 &gt; /sys/devices/platform/vpss/graphics0/enabled
echo 0 &gt; /sys/devices/platform/vpss/graphics1/enabled
echo 0 &gt; /sys/devices/platform/vpss/graphics2/enabled
</pre>
'''Notes''':
1. These commands are run to disable the video layers. An error will be shown in the case that one of them is not being used, this message can be ignored. An example of this error is:
<pre style="background:#FFFFC0">echo 0 &gt; /sys/devices/platform/vpss/graphics1/enabled
VPSS_GRPX : please open fb1 node first.
sh: write error: Invalid argument
</pre>
2. To run the decode display/encode demo with a 1080p video we recommend to use your filesystem by NFS due to the size of the input and output file.
== Decode display demo  ==
This demo is the decode-display demo included in the EZSDK. It takes an input file encoded in H264, decodes the stream and sends the output to the HDMI output
<pre style="background:#FFFFC0">./usr/share/ti/ti-omx/decode_display_a8host_debug.xv5T -i inputFile.h264 -w 1920 -h 1080 -f 60 -g 0 -d 0 -c h264
</pre>
== Capture encode demo  ==
This demo is the capture-encode demo included in the EZSDK. It takes an input video streaming from the component input (case 720p) of the daughter card(marked as J5J6J7) and encodes it in H264, the output is displayed through the HDMI output.
<pre style="background:#FFFFC0">echo 0 &gt; /sys/devices/platform/vpss/display0/enabled
echo 720p-60 &gt;/sys/devices/platform/vpss/display0/mode
echo 1 &gt; /sys/devices/platform/vpss/display0/enabled
./usr/share/ti/ti-omx/capture_encode_a8host_debug.xv5T -o sample.h264 -m 720p -f 60 -b 1000000 -d 0 -n 1000
</pre>
</pre>
2. Open a make config menu
 
<pre style="background:#d6e4f1">
= Testing audio =
make config
 
== Audio Recording ==
 
To test the audio recording, alsa has a tool named arecord.
 
<pre style="background:#FFFFC0">arecord audio.wav</pre>
 
== Audio Playback ==
 
Alsa has a tool named aplay to test the audio playback.
 
<pre style="background:#FFFFC0">aplay inputFile.wav</pre>
 
Please use a .wav audio file to test playback with aplay.
 
Also, you can use the following gstreamer pipeline to test it, you are going to hear a tone.
 
<pre style="background:#FFFFC0">gst-launch audiotestsrc ! gstperf ! alsasink</pre>
 
= Using Gstreamer  =
 
Some examples of use of GStreamer to implement basic multimedia pipelines can be found at [[Gstreamer pipelines for DM816x and DM814x]]. Please be aware that in order to display video you need to do the [https://www.ridgerun.com/developer/wiki/index.php/Getting_Started_Guide_for_DM8168#Video_initialization Video initialization]
 
'''note:''' If you are not using the Ridgerun SDK and you are trying to use the TAG 00_06_00_00 provided by TI you will need to apply the following patch to make V4L2src and omxbufferalloc work.
<pre>Index: gst-openmax-dm81xx/src/omx/gstomxbufferalloc.c
===================================================================
--- gst-openmax-dm81xx.orig/src/omx/gstomxbufferalloc.c 2012-11-14 16:15:41.392143697 -0600
+++ gst-openmax-dm81xx/src/omx/gstomxbufferalloc.c 2012-11-14 16:17:40.760145714 -0600
@@ -190,6 +190,7 @@
  gst_element_add_pad (GST_ELEMENT (filter), filter-&gt;sinkpad);
  gst_element_add_pad (GST_ELEMENT (filter), filter-&gt;srcpad);
+  filter-&gt;out_port.portptr = gst_omxportptr_new(&amp;filter-&gt;out_port);
  filter-&gt;silent = FALSE;
  filter-&gt;out_port.num_buffers = 10;
  filter-&gt;out_port.always_copy = FALSE;
</pre>
= Dual Capture Support  =
 
The DM816x-EVM comes with two Video Input Ports (VIP0 and VIP1) which can be used simultaneously through Video for Linux 2 (V4L2). However the current capture driver nor the kernel board file have all the code needed to use both video ports at the same time. Here you are going to find a patch to enable both ports (which is also included in the RidgeRun Pro SDK) as well as how to configure the RidgeRun SDK to load the V4L2 firmware instead of the openMax firmware. Some useful documentation and links to understand the changes that were made are included too.
 
== Configure RidgeRun SDK to load V4L2 Firmware  ==
 
In order to enable dual capture support in the DM816x-EVM, the V4L2 VPSS firmware has to be loaded. Specifically, the VPSS media controller needs to be running dm816x_hdvpss_v4l2.xem3 instead of dm816x_hdvpss.xem3. If you are not using the RidgeRun SDK please verify the following sha1sum
<pre>0647c92f39c9fe0e902fb27c301cd7c69481c41e  dm816x_hdvpss_v4l2.xem3
326e08f10afb8393d674d89694c09fa198ee6eac  dm816x_hdvpss.xem3
</pre>
1. If you are using the RidgeRun SDK please run <tt>make config</tt> to display the SDK configuration menu. Go to the Proprietary software submenu and choose the '''Enable V4L2 capture capability'' option as is shown in Fig. 7.
<pre style="background:#d6e4f1">cd $DEVDIR
`make env`
make config
</pre>
[[Image:V4L2CaptureFW.png|thumb|center|400px|V4L2CaptureFW.png]]
<div style="text-align: center;">'''Figure 7'''. SDK configuration menu to deploy V4L2 firmware in VPSS</div>
2. Enable the V4L2 capture Driver.
 
Go to Kernel configuration -&gt; Device Drivers -&gt; Multimedia support -&gt; Video capture adapters and select TI81XX V4L2-Capture driver
 
[[Image:V4L2CaptureDriver.png|thumb|center|400px|V4L2CaptureDriver.png]]
<div style="text-align: center;">'''Figure 8'''. SDK configuration menu enable the TI V4L2 capture driver</div>
Then close the menu and save your changes.
 
3. Go to $DEVDIR, compile and install your SDK
<pre style="background:#d6e4f1">cd $DEVDIR
make
make install.
</pre>
4. Verify proper video port mapping on the DM816x-EVM
 
Your system should be ready to capture using V4L2 and you will be able to capture from both video input nodes. If the V4L2 display driver is enabled as well, the video nodes would have the following map:
<pre>/dev/video0 --&gt; Capture VIP 0 Port A
/dev/video1 --&gt; Display 0
/dev/video2 --&gt; Display 1
/dev/video3 --&gt; Display 2
/dev/video4 --&gt; Capture VIP 0 Port B
/dev/video5 --&gt; Capture VIP 1 Port A
/dev/video6 --&gt; Capture VIP 1 Port B
</pre>
/dev/video0 and /dev/video5 have been tested with the RidgeRun SDK. If you are not using the V4L2 display driver you need to use the following map:
<pre>/dev/video0 --&gt; Capture VIP 0 Port A
/dev/video1 --&gt; Capture VIP 0 Port B
/dev/video2 --&gt; Capture VIP 1 Port A
/dev/video3 --&gt; Capture VIP 1 Port B
</pre>
You can test dual capture using the saLoopBack demo application installed on <tt>/usr/share/ti/ti-psp-examples</tt> or with [http://developer.ridgerun.com/wiki/index.php/Gstreamer_pipelines_for_DM816x_and_DM814x#Dual_capture:_Video_recording_.28H264.29_1080.4030fps_.7C_taking_snapshots_JPEG_-_EVM_.26_Z3_board gstreamer pipelines].
 
Physical map of inputs
 
<pre>
J5, J6, J7 - Component video input associated with TVP7002 #1
 
J10        - VGA input associated with TVP7002 #1
 
J2, J3, J4 - Component video input associated with TVP7002 #2
 
J9        - VGA input associated with TVP7002 #2
 
J1        - Composite input associated with TVP5147
 
P1        - S-Video input associated with TVP5147
 
P3        - HDMI input
</pre>
</pre>
running make config your SDK is going to download all basic packages needed by the SDK build system.


3. Go to Installer Configuration submenu and configure your installer as is shown in Fig.2
== Dual V4L2 Capture Patch  ==
[[Image:InstallerMenu.png|400px|thumb|center|Figure 2. Installer configuration to deploy firmware to an SD card‎]]


<div style="text-align: center; ">'''Figure 2'''. Installer configuration to deploy firmware to an SD card</div>
Changes were required to enable the second input port in the V4L2 capture driver. These changes enable the use of the second component input port (VIP1). If you want to use the video coming from the TVP5147 additional changes might be required.


Using the ''Firmware deployment mode'' submenu you can set how to deploy your kernel, uboot and filesystem image into your target board. There are three options in this submenu: ''Attached board on communication port'', ''Deploy all the firmware to an SD card'' and ''Create an SD card installer for flash memory''.
The ''add-V4L2-dual-capture-support.patch'' modifies the kernel board file to handle and configure the chips PCF8575 (Remote I2C GPIO I/O expander) labeled as U60 and U201 in the [http://support.spectrumdigital.com/boards/evm816xiodc/revc/files/evm816xiodc_Schematics_RevC.pdf EVM schematics (Rev C)] (page 14), SN74CBTLV (Bus exchange switch) labeled as U33 (page 25), 74CBTLV3253 (Dual multiplexer - SoG disabled) labeled as U66 (page 25) and THS4368 (Video amplifier and filters) labeled as U200 (page 28). Also it does the changes needed in the video capture driver (V4L2).  
*'''Attached board on communication port''' will allow you to send images to your target board using a serial port or a TFTP server, more details about this option are explained in the next section.  
 
*'''Deploy all the firmware to an SD card''' tells to the installer that it must create the needed partitions on a SD card located in ''SD device on Linux host'' (please be sure that the option called '' Flash SD card image into loopback file instead of real SD'' is not selected) and that there it have to install the software's images generated by the SDK.  
'''Note:''' Please be sure that you are using the patches suggested here as well: http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/228258/809457.aspx#809457
*'''Create an SD card installer for flash memory''' is going to create and SD card with all the logic and software's images needed to flash the EVM NAND from the SD card.
 
In order to get the patch please [https://www.ridgerun.com/contact contact us]
 
= Linux Performance  =
 
There are performance issues that can be fixed tuning the Linux kernel. Here some interesting pages are listed with tuning solutions and tricks specially for memory lateness problems.  
 
*[[Linux Performance and Tuning Tricks|Linux Performance and Tuning Tricks]]
*[[High performance SD card tuning using the EXT4 file system|High performance SD card tuning using the EXT4 file system]]
 
= Customize console number to be used by the SDK =


= Installation =
The default uboot environment is on C, however, RidgeRun SDK doesn't use the default bootargs and instead it generates the bootargs according to what is configured from the make config menu, one part is fixed and the other part can be specified from the make config menu


In order to install your DM8168 EVM SDK 2011Q2 you can follow the steps described in the [[RidgeRun 2011Q2 SDK User Guide#Installation | installation section]] of the [[RidgeRun 2011Q2 SDK User Guide]].
<pre>
-> Kernel configuration
(mem=364M@0x80000000 mem=320M@0x9FC00000 vmalloc=512M vram=81M) Extra kernel arguments
</pre>


= Video initialization =
In case of the console, it can't be set from the make config, instead it is set in:


When you boot your board the RidgeRun logo will be displayed, in order to display video the following commands must be executed:
<pre>
<pre style="background:#d6e4f1">
$DEVDIR/fs/mach/base$ rgrep console *
echo 0 > /sys/devices/platform/vpss/graphics0/enabled
Makefile:    $(V)echo -n "console=ttyO2,115200n8 ">>$(CMDLINEFILE)
echo 0 > /sys/devices/platform/vpss/graphics1/enabled
echo 0 > /sys/devices/platform/vpss/graphics2/enabled
</pre>
</pre>


= Using Gstreamer =
Please open that file and put the console that you need, for instance ttyO0. In case of using a customized machine directory to keep your changes (mach-dm8168-my-board) the change would apply just for your board and not for the EVM or other machines supported by the SDK.
 
You will also need to change the console to be used by [https://developer.ridgerun.com/wiki/index.php/Inittab#Common_embedded_Busybox_inittab_file inittab] on busybox for the filesystem.
 
<pre>
cd $DEVDIR/fs
mkdir mach/base/etc/
cp arch/base/etc/inittab mach/base/etc/inittab
</pre>


Some examples of use of GStreamer to implement basic multimedia pipelines can be found at [[DM81xx GStreamer Pipelines - SDK 2011Q2]]
open the inittab file and set the tty* needed (for instance ttyO0)


= Articles related to this board  =
:[[RidgeRun Irazu SDK User Guide]]
:[http://processors.wiki.ti.com/index.php/EZSDK_Memory_Map EZSDK Memory Map]
:[http://processors.wiki.ti.com/index.php/OMX_EZSDK_Examples OMX EZSDK Examples]
:[http://www.ti.com/lit/ds/symlink/tms320dm8168.pdf TMS320DM816x DaVinci Digital Media Processor]
:[http://www.ti.com/product/tms320dm8168 TMS320DM816x TI MainLink]
:[http://www.ti.com/lit/ug/sprugx8b/sprugx8b.pdf TMS320DM816x Technical Reference Manual]
:[[:Category:DM8168|More... ]]
[[Category:DM8168]] [[Category:GSG]]
[[Category:DM8168]] [[Category:GSG]]

Latest revision as of 11:26, 8 March 2023


Introduction

On this page you are going to find all the necessary information to start from scratch to use the RidgeRun SDK on your DM8168 evaluation module (EVM). In the following sections we assume that you have already downloaded the EZSDK version 5.05.02.00 and that you have installed the toolchain 2009q1-203 from codesourcery.

The first section of this guide shows you how to install the EZSDK for DM8168 on your computer and how to configure a TFTP and NFS server. Subsequently, the second section contains instructions about how to configure the RidgeRun's SDK to create a SD card with all software components (uboot, kernel and filesystem) needed to boot to Linux Shell in your EVM. Using this SD card in the third and fourth section of this guide, you will be able to install on NAND images created by the SDK for kernel, uboot as well as your filesystem (JFFS2, UBI, NFS are available). Using the SD card created on the second section to flash the SDK in your EVM is just an option because you could try to use the installer of the RidgeRun's SDK with the uboot version that is running by default in a new EVM, however, we cannot guaranty that it will work as we expect, hence, we recommend to use the SD card instead. Furthermore we describe how to enable the Graphics SDK support on the Professional SDK. Finally, how to run opemax demos to encode and decode 1080p/h264 videos and some pipelines using gstreamer + openMax are shown.

Basic preliminary work

Please skip below two steps (2.1 and 2.2) and jump to 2.3 if you purchased a Professional SDK.

Getting the RidgeRun's EVAL SDK Irazu

If you want to get the RidgeRun's EVAL SDK Irazu you need to go to our Evaluation SDK Download Link and select the Evaluation SDK you need. You will be asked for your email address and some information. Once you have submitted the required information you will receive an email with the following information:

Sequence of evaluation sdk download events:

You have to follow the steps below :

When you select and click on the name of evaluation sdk you want to download, shopping cart page will display with the price $0.00 (for eval sdk's)
-> click on 'Go to Checkout'. It will display 'Your Shopping Bag' page
-> click on 'Checkout'. You will get a form to enter your email id and other info
-> click on 'Continue'. It will display a 'Place Order' page
-> click on 'Place Order'. And then Please check your email with a link to download the tar file for the evaluation SDK you have selected.

Installing the EVAL SDK version

RidgeRun delivers the SDK in either two ways: a tar file for x86 platforms, or for customers with a established development relationship through a custom SCM (typically GIT) repository. If you are using a shared SCM repository, please contact RidgeRun for a detailed instructions.

System Requirements

Listed below are the minimum recommended requirements for installing and using the RidgeRun SDK:

  • A host computer with a 686 or better family processor
  • 1 GB free hard disk space
  • A Linux distribution configured on the host computer.
  • Target hardware for the SDK
  • Optional: a network card installed and configured on the host computer
  • Optional: Internet connection for SDK updates

Once you have downloaded the tar file of the evaluation SDK you can untar it by running the following command:

tar -xvzf <name of the tar file downloaded>.tar.gz 

You may find it convenient to untar the evaluation SDK more than once. For example, you might want one version to be unmodified and another version to be your working development directory. RidgeRun suggests you untar the SDK development directories in your $HOME/work/ directory. When you have more than one development directory installed, just remember to have the DEVDIR shell variable set properly. To set the DEVDIR shell variable use the `make env` command specified at RidgeRun_Irazu_SDK_User_Guide#Build_SDK

On the rest of this document, we refer as $DEVDIR to the path where the RidgeRun Eval SDK for DM8168 EVM is installed.

Installing the Professional SDK version

When all the purchase process is done, RidgeRun will provide you a GitHub repository access. For that, the GitHub user ID and other information might be requested. Once you provide that information, you must clone the given repository URL, using the next command:

git clone git@github.com:RidgeRun/<customer>.git

This would have the proper <customer> space modified. With this, you will have the SDK installed on the directory you were when executed the clone command.

RidgeRun suggests you install the SDK development directories in your $HOME/work/ directory. When you have more than one development directory installed, just remember to have the DEVDIR shell variable set properly. To set the DEVDIR shell variable use the `make env` command specified at RidgeRun_Irazu_SDK_User_Guide#Build_SDK

On the rest of this document, we refer as $DEVDIR to the path where the RidgeRun Professional SDK for DM8168 EVM is installed.

Installing the EZSDK

1. Set the ezsdk binary as executable and set correct permissions

 sudo chmod 777 ezsdk_dm816x-evm_5_05_02_00_setuplinux

2. Install EZSDK. For ubuntu versions different than Ubuntu 10.04 LTS 32-bit you will need to add the --forcehost argument to install it:

 ./ezsdk_dm816x-evm_5_05_02_00_setuplinux --forcehost

note: During the EZSDK installation process you will be asked for the toolchain's path, assuming that you installed it on /opt, the path that you need to provide is /opt/codesourcery/arm-2009q1/bin/

Configuring the bsp/mach symbolic link for Eval-SDK

The evaluation SDK for DM8168 supports Z3 and EVM platforms into the same SDK, so for choose one of them is necessary to run the next lines.

 # For an totally clean SDK #
    make config
    make coreconfig
    make

The coreconfig target will show the following option where you have to choice the mach-dm8168-z3:

   Selecting machine/board:
   1. mach-dm8168-z3
   2. mach-dm8168-tievm

OPTIONAL: Installing AAC encoder and MP3 Decoder

The DM81xx platforms have the ability to encode AAC-LC and decode MP3 on the DSP using openMax+gstreamer, however, these codecs are not in the EZSDK by default. The Ridgerun SDK for the DM8148/DM8168 has internal logic to integrate these codecs and generate a new DSP firmware if these codecs are installed properly in your host computer. This new DSP firmware will be automatically loaded by into the DSP during boot time.

1. Download the AAC-LC encoder from TI Web page, this is called AAC LC Encoder, Version 01.00.01.00

2. Download the MP3 decoder from TI Web page, this is called MP3 Decoder, Version 1.41.00.00

3. Install the AAC-LC encoder inside of your EZSDK directory, i.e, your destination directory MUST be /home/<user>/ti-ezsdk_dm816x-evm_5_05_02_00/component-sources/c674x_aaclcenc_01_00_01_00_elf. Please be sure that c674x_aaclcenc_01_00_01_00_elf is in your destination path

 sudo chmod 777 c674x_aaclcenc_01_00_01_00_elf.bin
./c674x_aaclcenc_01_00_01_00_elf.bin

4. Install the MP3 decoder inside of your EZSDK directory, i.e, your destination directory must be something like /home/<user>/ti-ezsdk_dm816x-evm_5_05_02_00/component-sources/c674x_mp3dec_01_41_00_00_elf

 sudo chmod 777 c674x_mp3dec_01_41_00_00_elf.bin
./c674x_mp3dec_01_41_00_00_elf.bin

5. Delete existing EZSDK tarball out of the way if you have build the RidgeRun SDK previously.

cd <pathOfYourDevdir>
`make env`
rm -f $DEVDIR/downloads/ti-ezsdk_dm816x-* /opt/ridgerun/downloads/ti-ezsdk_dm816x-*

6. Open a make config menu and select the Support external AAC and MP3 audio codecs option over the Proprietary software category.

 
make config
Optional selection of external AAC and MP3 audio codecs support

NOTE: If you built your SDK before to enable the audio support you need to remove the EZSDK tarball that were generated by the SDK in /opt/ridgerun/downloads thus the SDK will generate a new one including the audio codecs.

Setting up serial access to the Linux console

You use the serial port to control u-boot and Linux. The picocom terminal emulator work well for this purpose.

Setting up Picocom - Ubuntu

Setting up a TFTP server

If you are planning to use the SDK's installer to install images generated by the SDK in NAND, installing a TFTP server you will speed up downloads to the target hardware by using TFTP.

Setting Up A Tftp Service

Setting up an NFS server

For application development, it is convenient to use root NFS mount file system for the target hardware. This allows you to rebuild your application on the host and immediately run the application on the target hardware with no interveining steps. You host PC needs to be configured as a NFS server for this in order to work properly.

Setting Up A NFS Service

Booting from a SD card

Setting up your DM8168 EVM to boot from SD card

In order to boot from a SD card you need to set the MMC as the first boot device to try in the DM8168 boot sequence, this can be done configuring a correct BTMODE through the switch SW3 in your EVM (see Fig. 1)

SDswitch.png
Figure 1. Dip switch to control boot mode (SD card)

Configuring SDK to deploy firmware to a SD card

This section describes how to configure the DM8168's SDK to deploy all basic firmware components (kernel, uboot and MLO) into a bootable SD card. The RidgeRun SDK support several filesystem types (JFFS2, NFS, etc) however in this case we are going to use it on the SD card as well.

1. Set your environment variables

  cd $DEVDIR
 `make env`

2. Open a make config menu

 make config

running make config your SDK is going to download all basic packages needed by the SDK build system.

3. Go to Installer Configuration submenu and configure your installer as is shown in Fig.2

InstallerMenuDM8168.png
Figure 2. Installer configuration to deploy firmware to an SD card

Using the Firmware deployment mode submenu you can set how to deploy your kernel, uboot and filesystem image into your target board. There are three options in this submenu: Attached board on communication port, Deploy all the firmware to an SD card and Create an SD card installer for flash memory.

  • Attached board on communication port will allow you to send images to your target board using a serial port or a TFTP server, more details about this option are explained in the next section.
  • Deploy all the firmware to an SD card tells to the installer that it must create the needed partitions on a SD card located in SD device on Linux host (please be sure that the option called Flash SD card image into loopback file instead of real SD is not selected) and that it have to install there the software's images generated by the SDK.
  • Create an SD card installer for flash memory is going to create and SD card with all the logic and software's images needed to flash the EVM's NAND from the SD card.


4. Go to File System Configuration submenu and configure your filesystem as is shown in Fig.3

FSC.png
Figure 3. File system configuration to use it on the SD‎

5. Compile your SDK

 make

Installing SDK's firmware to a SD card

Once you have built your SDK, you need to install it on the SD card running make install, but before to issue this command you need to unmount your SD card, otherwise the SDK won't let you install it (in order to avoid to erase information in some of your hard disks). Let's suppose that the environment variable called $SDNAME contains your mount point's name (Normally if you press tab after umount /media/ it will complete it with you SD card name, if you have problems to find the name you can use commands like "df" or "mount" to verify it)

 umount /media/$SDNAME
 cd $DEVDIR
 make install

you will be asked to confirm the device that you are going to partition and format, please enter yes if it is correct. After this, the SDK will start to create a bootable SD card

Now you are ready to test your SDK booting from a SD card. Two partitions were created by the SDK: boot partition which contains the kernel, uboot and MLO image and the rootfs partition with your file system. It's important to notice that the environment of uboot is located in a *.txt file in the partition called boot, which allows you to modify it easily.

Booting from NAND

This section describes how to configure the DM8168's SDK to install the SDK's firmware in NAND as well as how to set up your EVM to boot from NAND. First, we are going to start flashing uboot in NAND using the SD card created in the above section, once uboot is running properly from NAND, we can start installing the kernel and finally your filesystem.

Configuring SDK to install firmware in NAND

1. Set your environment variables

 cd $DEVDIR
 `make env`

2. Open a make config menu

 make config

3. Go to Installer Configuration submenu and configure your installer as is shown in Fig.4

InstallerMenuAttachedMethod.png
Figure 4. Installer configuration to deploy firmware in NAND


In this case, you must use the Attached board on communication port method, this will allow you to install all your firmware directly in nand by means of a serial port or by ethernet using a TFTP server. Here we are going to use a TFTP server and telnet as our communication method with the target board.


3.1 Go to the Communication method with the target board and select Telnet-serial adaptor

3.2 Configure the protocol to transfer images as TFTP

3.3 Set the IP address of your host machine in IP address of telnet-serial adaptor

3.4 Set the port number that you assigned in the telnet configuration file to the serial port where your EVM is connected in Network port of telnet-serial adaptor

4. Close the make config menu and save your changes.

Configuring your Filesystem type

The RidgeRun SDK for DM8168 EVM supports different filesystem types: UBI, JFFS, NFS and also as we mentioned before you can use it in your SD card as well. In this tutorial we are going to use UBI as our default filesystem.

1. Set your environment variables

 cd $DEVDIR
 `make env`mach-dm8168-marlin/

2. Open a make config menu

 make config

3. Go to the File System Configuration->File system image target and choose UBIFS volume. Please be sure that UBIFS sub-page size is set to 512.

4. Save your changes and compile your SDK

 make

Flashing uboot, kernel and filesystem in NAND

1.Boot the RidgeRun SDK using the SD card created in the first section of this guide and stop the uboot countdown. Close your Picocom, minicom or telnet session.

U-Boot 2010.06 (Apr 29 2013 - 15:46:20)

DRAM:  2 GiB
Using default environment

Hit any key to stop autoboot:  0 
mmc1 is available
reading u-boot.bin

185432 bytes read
## Starting application at 0x80800000 ...


U-Boot 2010.06 (Apr 29 2013 - 15:46:20)

TI8168-GP rev 1.1

ARM clk: 987MHz
DDR clk: 796MHz

I2C:   ready
DRAM:  2 GiB
NAND:  256 MiB
*** Warning - booting from SD, using default environment

:,;;:;:;;;;;;;;r;;:,;;:;:;;;;;;;;:,;;:;:;;;;;;;;:,;;:;:;;;;;;;;:;;;;;;;;:,;;:;:
;,;:::;;;;r;;;rssiSiS552X5252525259GX2X9hX9X9XX2325S55252i5:,;;:;:;;;;;;;;:,;;:
;:;;;;;;;rrssSsS52S22h52299GGAAMHMM#BBH#B#HMM#HMBA&&XX2255S2S5Si:,;;:;:;;;;;;;;
;:;;r;;rsrrriiXS5S329&A&MH#BMB#A&9XXA252GXiSXX39AAMMMBB&G22S5i2SSiiiisi:,;;:;:;
;;;;;r;rr2iisiih393HB#B#AA99i22irrrX3X52AGsisss2Xii2299HBMA&X2S5S5iSiisSsi:,;;:
r:r;rrsrsihXSi2&##MHB&Ahh3AGHGA9G9h&#H##@@@##MAMMXXX9SSS29&&HGGX2i5iisiiisisi:,
;;rrrrsSiiiA&ABH&A9GAGhAhBAMHA9HM@@@@@@@@@@@@@@@@@@@HHhAh2S2SX9&Gh22SSiisiiisii
r:rrssisiS2XM##&h3AGAX&3GG3Ssr5H@M#HM2; ;2X&&&MHMB###GBB#B&XXSSs529XX55iSsisisi
r;rsrisSi2XHAhX99A3XXG&&XS;:,rH#HGhAS   @@@@3rs2XBM@@A552&&AHA2XiisSS252SSsisSs
r;issi5S22&&3iSSX292&hXsr;;:;h@&G339&S9@@@@2@MA&9&HB##Xris29ABMAAX2ir;rsSi5iss5
rrsSi2XhG&9GXh399&X99i;;;;;;r#H&293H9X#@@@@@@@B&9GhAH@XrrsrsiXABHB&HG2rr;rrSiSi
;:rsisS599&AA9XG&3A35r;:::;,;BMh&&2iX5A@@@@@@@&392X5GB2;;;r;iSX393A##A&Xi:::rsi
;:rss552222X553&XHMhir;;::,:,h#HhGSXhG3#@@@@#AXXS2XAHA;::;;;;ss55XShBA3239r:,;;
r;ii2S5SSi2i53hirsh2srr::,,,,;MMXX359&Ah3h&Si59SX99A#i:,::::;;sri2,.2r;:SGAr;,:
;:;rrrrssiriXGSi::shs;;;,,,:,,rBBA9h5s5h5iS5isi2SAHB5:,,,:::;rrs5&SrisSX5Srrr:,
;,r;;;;rsriSSrrrr;;5Xrr;;,:,,.,;9AA2SsisS5323XXXG9&i:.,,::;;r;;;srrrrrr;;:;::::
:,;r;r;rrissrrr;:;::;s;;;;,:,,..,r293h222hXXAAGGGX;:,,,:,:,::;:;::,:,,,,...,,,,
;,;;;;rrrrrrrrirr;,.,,:::::::,,,,.,;SX&ABAB2hhXir:,,.,,.,,:,,,,..,,,..,..,,,..:
:.:;:;;;:;;;;r;rrs;:.. ,,:::::,:,:,,.::rrsrr;;,,.......,..,....,,,,,,,...,.,,:,
:.:::,::::::;;r;rrr;:.......,.,.,,:::,,...............,,::.,,,,:,::,,:,:,,,:,;:
,.::,:,,,,,;;;;;;;;r;;::,..............................;;;:;::::,:::::::,:,:,,,
: ,,:,,,,,,,,,,,,,:;rrr;;:;,,,,,,,::,.,.:.,.,;s,:;;;;:;:;;;;;::::,:::,:::,:,:,:
,.,,,,,,,...,,.,,....................................:,............:,,,:,:,,,,,

Net:   <ethaddr> not set. Reading from E-fuse
Detected MACID:90:d7:eb:20:62:b4
Ethernet PHY: GENERIC @ 0x01
DaVinci EMAC
Hit any key to stop autoboot:  0 
TI8168_EVM#

2.Run make installbootloader to install uboot in NAND

 make installbootloader

3.Turn off your EVM and configure it to boot from NAND (please see Setting up your DM8168 EVM to boot from NAND). Turn on your EVM and repeat step 1.

4. Now, to install your kernel and filesytem run make install

 make install

Now you have installed all the SDK components in your DM8168 EVM and you should be able to boot to Linux shell and see the logo of RigeRun on the HDMI output. The RidgeRun SDK for DM8168 EVM loads automatically all the firmware and kernel modules needed to use the video processor subsystem.

Setting up your DM8168 EVM to boot from NAND

In order to boot from a NAND you need to set it as the first boot device to try in the DM8168 boot sequence, this can be done configuring a correct BTMODE through the switch SW3 in your EVM (see Fig. 5)

NANDSWITCH.png
Figure 5. Dip switch to control boot mode (NAND)

Introduction to NAND memories

If you are more interested on NAND concepts and what is supported on the DM816x please read Introduction to NAND memories

Graphics SDK - OpenGL - Qt

The Professional Ridgerun SDK includes Graphics SDK 4.04.00.02 completely integrated, supporting the SGX530 3D Graphics Engine through the PowerVR driver. It also includes support to use Qt to render through the PowerVR kernel module.

1. In order to enable the Graphics SDK in your SDK, please download and install in your home directory the Graphics SDK 4.04.00.02 from the TI web page

sudo chmod 777 Graphics_SDK_setuplinux_4_04_00_02.bin
./Graphics_SDK_setuplinux_4_04_00_02.bin 

2.Then open a make config menu

cd $DEVDIR
make config

3. Go to the Proprietary software and enable the graphics SDK.

GraphicsSDKMenu.png
Figure 6. SDK boot log after enable the Graphics SDK

4. Go to File System Configuration -> Select target's file system software -> qt-4.7.2 and select Support openGL and its demo. Finally disable the option called Make QT as compact as possible.

5. Close the menu, save your configuration and build your SDK.

cd $DEVDIR
make 

6. Install your SDK in your board

make install

7. Boot your board, you will see the following message

Starting System
done.
Welcome to
__________ .__     .___               __________                
\______   \|__|  __| _/  ____    ____ \______   \ __ __   ____  
 |       _/|  | / __ |  / ___\ _/ __ \ |       _/|  |  \ /    \ 
 |    |   \|  |/ /_/ | / /_/  >\  ___/ |    |   \|  |  /|   |  \
 |____|_  /|__|\____ | \___  /  \___  >|____|_  /|____/ |___|  /
        \/          \//_____/       \/        \/             \/ 
           
    Embedded Linux Solutions
 
For further information see:
http://www.ridgerun.com
Build host: dsoto-Latitude-E5430-non-vPro
Built by: dsoto
Build date: Thu, 02 May 2013 16:47:40 -0600
Build tag: dm8168-tievm
Configuring network interfaces
SGX revision:  0x10205
Build type:  release6.x
Loaded PowerVR consumer services.

Please press Enter to activate this console. 

8. Finally run one of the openGL demos or one of the qt + openGL demos

export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib;
export QWS_DISPLAY="powervr"; 
export QT_PLUGIN_PATH=/usr/plugins; 
export QT_QWS_FONTDIR=/usr/lib/fonts

cd /opt/gfxsdkdemos/ogles2/
/opt/gfxsdkdemos/ogles2 # ./OGLES2Skybox2 
PVRShell: EGL 1.4 initialized


cd /examples/opengl/hellogl_es2
./hellogl_es2

OpenMax Demos

To run the openMax's demos that are located by default in your filesystem in a directory called omx you need to run first the following commands in your EVM

Video initialization

echo 0 > /sys/devices/platform/vpss/graphics0/enabled 
echo 0 > /sys/devices/platform/vpss/graphics1/enabled
echo 0 > /sys/devices/platform/vpss/graphics2/enabled

Notes:

1. These commands are run to disable the video layers. An error will be shown in the case that one of them is not being used, this message can be ignored. An example of this error is:

echo 0 > /sys/devices/platform/vpss/graphics1/enabled 
VPSS_GRPX : please open fb1 node first.
sh: write error: Invalid argument

2. To run the decode display/encode demo with a 1080p video we recommend to use your filesystem by NFS due to the size of the input and output file.


Decode display demo

This demo is the decode-display demo included in the EZSDK. It takes an input file encoded in H264, decodes the stream and sends the output to the HDMI output

./usr/share/ti/ti-omx/decode_display_a8host_debug.xv5T -i inputFile.h264 -w 1920 -h 1080 -f 60 -g 0 -d 0 -c h264

Capture encode demo

This demo is the capture-encode demo included in the EZSDK. It takes an input video streaming from the component input (case 720p) of the daughter card(marked as J5J6J7) and encodes it in H264, the output is displayed through the HDMI output.

echo 0 > /sys/devices/platform/vpss/display0/enabled
echo 720p-60 >/sys/devices/platform/vpss/display0/mode
echo 1 > /sys/devices/platform/vpss/display0/enabled
./usr/share/ti/ti-omx/capture_encode_a8host_debug.xv5T -o sample.h264 -m 720p -f 60 -b 1000000 -d 0 -n 1000

Testing audio

Audio Recording

To test the audio recording, alsa has a tool named arecord.

arecord audio.wav

Audio Playback

Alsa has a tool named aplay to test the audio playback.

aplay inputFile.wav

Please use a .wav audio file to test playback with aplay.

Also, you can use the following gstreamer pipeline to test it, you are going to hear a tone.

gst-launch audiotestsrc ! gstperf ! alsasink

Using Gstreamer

Some examples of use of GStreamer to implement basic multimedia pipelines can be found at Gstreamer pipelines for DM816x and DM814x. Please be aware that in order to display video you need to do the Video initialization

note: If you are not using the Ridgerun SDK and you are trying to use the TAG 00_06_00_00 provided by TI you will need to apply the following patch to make V4L2src and omxbufferalloc work.

Index: gst-openmax-dm81xx/src/omx/gstomxbufferalloc.c
===================================================================
--- gst-openmax-dm81xx.orig/src/omx/gstomxbufferalloc.c	2012-11-14 16:15:41.392143697 -0600
+++ gst-openmax-dm81xx/src/omx/gstomxbufferalloc.c	2012-11-14 16:17:40.760145714 -0600
@@ -190,6 +190,7 @@
 
   gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
   gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
+  filter->out_port.portptr = gst_omxportptr_new(&filter->out_port);
   filter->silent = FALSE;
   filter->out_port.num_buffers = 10;
   filter->out_port.always_copy = FALSE;

Dual Capture Support

The DM816x-EVM comes with two Video Input Ports (VIP0 and VIP1) which can be used simultaneously through Video for Linux 2 (V4L2). However the current capture driver nor the kernel board file have all the code needed to use both video ports at the same time. Here you are going to find a patch to enable both ports (which is also included in the RidgeRun Pro SDK) as well as how to configure the RidgeRun SDK to load the V4L2 firmware instead of the openMax firmware. Some useful documentation and links to understand the changes that were made are included too.

Configure RidgeRun SDK to load V4L2 Firmware

In order to enable dual capture support in the DM816x-EVM, the V4L2 VPSS firmware has to be loaded. Specifically, the VPSS media controller needs to be running dm816x_hdvpss_v4l2.xem3 instead of dm816x_hdvpss.xem3. If you are not using the RidgeRun SDK please verify the following sha1sum

0647c92f39c9fe0e902fb27c301cd7c69481c41e  dm816x_hdvpss_v4l2.xem3
326e08f10afb8393d674d89694c09fa198ee6eac  dm816x_hdvpss.xem3

1. If you are using the RidgeRun SDK please run make config to display the SDK configuration menu. Go to the Proprietary software submenu and choose the 'Enable V4L2 capture capability option as is shown in Fig. 7.

cd $DEVDIR
`make env`
make config
V4L2CaptureFW.png
Figure 7. SDK configuration menu to deploy V4L2 firmware in VPSS

2. Enable the V4L2 capture Driver.

Go to Kernel configuration -> Device Drivers -> Multimedia support -> Video capture adapters and select TI81XX V4L2-Capture driver

V4L2CaptureDriver.png
Figure 8. SDK configuration menu enable the TI V4L2 capture driver

Then close the menu and save your changes.

3. Go to $DEVDIR, compile and install your SDK

cd $DEVDIR
make
make install.

4. Verify proper video port mapping on the DM816x-EVM

Your system should be ready to capture using V4L2 and you will be able to capture from both video input nodes. If the V4L2 display driver is enabled as well, the video nodes would have the following map:

/dev/video0 --> Capture VIP 0 Port A
/dev/video1 --> Display 0
/dev/video2 --> Display 1
/dev/video3 --> Display 2
/dev/video4 --> Capture VIP 0 Port B
/dev/video5 --> Capture VIP 1 Port A
/dev/video6 --> Capture VIP 1 Port B

/dev/video0 and /dev/video5 have been tested with the RidgeRun SDK. If you are not using the V4L2 display driver you need to use the following map:

/dev/video0 --> Capture VIP 0 Port A
/dev/video1 --> Capture VIP 0 Port B
/dev/video2 --> Capture VIP 1 Port A
/dev/video3 --> Capture VIP 1 Port B

You can test dual capture using the saLoopBack demo application installed on /usr/share/ti/ti-psp-examples or with gstreamer pipelines.

Physical map of inputs

J5, J6, J7 - Component video input associated with TVP7002 #1

J10        - VGA input associated with TVP7002 #1

J2, J3, J4 - Component video input associated with TVP7002 #2

J9         - VGA input associated with TVP7002 #2

J1         - Composite input associated with TVP5147

P1         - S-Video input associated with TVP5147

P3         - HDMI input

Dual V4L2 Capture Patch

Changes were required to enable the second input port in the V4L2 capture driver. These changes enable the use of the second component input port (VIP1). If you want to use the video coming from the TVP5147 additional changes might be required.

The add-V4L2-dual-capture-support.patch modifies the kernel board file to handle and configure the chips PCF8575 (Remote I2C GPIO I/O expander) labeled as U60 and U201 in the EVM schematics (Rev C) (page 14), SN74CBTLV (Bus exchange switch) labeled as U33 (page 25), 74CBTLV3253 (Dual multiplexer - SoG disabled) labeled as U66 (page 25) and THS4368 (Video amplifier and filters) labeled as U200 (page 28). Also it does the changes needed in the video capture driver (V4L2).

Note: Please be sure that you are using the patches suggested here as well: http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/228258/809457.aspx#809457

In order to get the patch please contact us

Linux Performance

There are performance issues that can be fixed tuning the Linux kernel. Here some interesting pages are listed with tuning solutions and tricks specially for memory lateness problems.

Customize console number to be used by the SDK

The default uboot environment is on C, however, RidgeRun SDK doesn't use the default bootargs and instead it generates the bootargs according to what is configured from the make config menu, one part is fixed and the other part can be specified from the make config menu

-> Kernel configuration
(mem=364M@0x80000000 mem=320M@0x9FC00000 vmalloc=512M vram=81M) Extra kernel arguments

In case of the console, it can't be set from the make config, instead it is set in:

$DEVDIR/fs/mach/base$ rgrep console *
Makefile:    $(V)echo -n "console=ttyO2,115200n8 ">>$(CMDLINEFILE)

Please open that file and put the console that you need, for instance ttyO0. In case of using a customized machine directory to keep your changes (mach-dm8168-my-board) the change would apply just for your board and not for the EVM or other machines supported by the SDK.

You will also need to change the console to be used by inittab on busybox for the filesystem.

cd $DEVDIR/fs
mkdir mach/base/etc/
cp arch/base/etc/inittab mach/base/etc/inittab

open the inittab file and set the tty* needed (for instance ttyO0)

Articles related to this board

RidgeRun Irazu SDK User Guide
EZSDK Memory Map
OMX EZSDK Examples
TMS320DM816x DaVinci Digital Media Processor
TMS320DM816x TI MainLink
TMS320DM816x Technical Reference Manual
More...