DM365 Leopard SDK 2011Q2 Getting Started Guide

From RidgeRun Developer Connection

(Difference between revisions)
Jump to:navigation, search
(DVSDK 4 Installation)
(Getting the RR LeopardBoard DM365 EVAL SDK 2011Q2)
(37 intermediate revisions not shown)
Line 6: Line 6:
== Getting the RR LeopardBoard DM365 EVAL SDK 2011Q2 ==
== Getting the RR LeopardBoard DM365 EVAL SDK 2011Q2 ==
-
If you want to get the LeopardBoard DM365 EVAL SDK 2011Q2 you need to go to our [http://www.ridgerun.com/downloadcenter.shtml download center] page and select the ''LeopardBoard DM365 Evaluation SDK''. 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:
+
If you want to get the LeopardBoard DM365 EVAL SDK 2011Q2 you need to go to our [https://www.ridgerun.com/index.php/download-center.html download center] page and select the ''LeopardBoard DM365 Evaluation SDK''. 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:
-
* The LeopardBoard DM365 SDK 2011Q2 Installer file for GNU/Linux based operative systems.
+
* A link to download the LeopardBoard DM365 SDK 2011Q2 Installer file for GNU/Linux based operative systems.
-
* A link to the detailed installation instructions.
+
* A username and password to download the installer.
 +
* A link to the installation instructions.
== CodeSourcery Toolchain Installation ==
== CodeSourcery Toolchain Installation ==
Line 32: Line 33:
3. You will be asked for the Toolchain's path, you need to specify the path to the binaries' directory of the toolchain as is shown in the following image:
3. You will be asked for the Toolchain's path, you need to specify the path to the binaries' directory of the toolchain as is shown in the following image:
-
[[File:DVSDK4_toolchain_check.jpeg|500px|thumb|center| DVSDK 4 Toolchain check window.]]
+
[[File:DVSDK4_toolchain_check.jpeg|500px|thumb|center| Figure 1. DVSDK 4 Toolchain check window.]]
4. Install the DVSDK with the default configuration.
4. Install the DVSDK with the default configuration.
Line 56: Line 57:
* minicom
* minicom
* libtool
* libtool
-
* libncurses5-dev  
+
* libncurses5-dev
 +
It is possible you need to install some additional packages when some features require them, the SDK will ask you for this packages in the form of a error message as is shown below:
-
== Checkout SDK ==
+
<pre>
 +
Checking for host packages required by the SDK build system:
 +
    buildsystem (build-essential) is installed
 +
    make (make) is installed
 +
    ncurses (libncurses5-dev) is installed
 +
    texinfo (texinfo) is installed
 +
>> minicom (minicom) is NOT installed
 +
    perl (perl) is installed
 +
    quilt (quilt) is installed
 +
    dc (dc) is installed
 +
    subversion (subversion) is installed
 +
    curl (curl) is installed
 +
    git (git-core) is installed
 +
    autoconf (autoconf) is installed
 +
    crypt-ssleay (libcrypt-ssleay-perl) is installed
 +
    quilt (quilt) is installed
 +
    libusb (libusb-dev) is installed
 +
    perl-expect (libexpect-perl) is installed
 +
    mono (mono-devel) is installed
 +
There are missing packages, please install them:
 +
apt-get install minicom
 +
make: *** [.oscheck] Error 1
 +
</pre>
-
With this SVN repository Linux from the email, check out a development directory from the repository:
+
== Installing the SDK ==
 +
 
 +
Once you have downloaded the SDK installer you can execute it by running the following commands:
<pre style="background:#FFFFC0">
<pre style="background:#FFFFC0">
-
mkdir -p ~/work
+
sudo chmod a+x LeopardBoardDM365sdk-EVAL2011Q2-Linux-x86-Install.bin
-
cd ~/work
+
./LeopardBoardDM365sdk-EVAL2011Q2-Linux-x86-Install.bin
-
svn co <repositoryLink> leo365
+
</pre>
</pre>
 +
 +
Once you have executed it you can follow the next steps for its installation.
 +
 +
1. Click ''Yes'' in the start up window.
 +
 +
[[File:EVAL_SDK_Installation_Step1.jpeg|400px|thumb|center| Figure 2. Installer's start up window.]]
 +
 +
2. Click ''Next'' in the main window.
 +
 +
[[File:EVAL_SDK_Installation_Step2.jpeg|400px|thumb|center| Figure 3. Installer's main window.]]
 +
 +
3. Accept the license terms in order to use the EVAL SDK and click ''Next'' to continue.
 +
 +
[[File:EVAL_SDK_Installation_Step3.jpeg|400px|thumb|center| Figure 4. Installer's License Agreement window.]]
 +
 +
4. Choose the destination directory to where the EVAL SDK will be installed. '''Note: The installation directory must be a folder that doesn't exist since the installer will create it in the process.'''
 +
 +
[[File:EVAL_SDK_Installation_Step4.jpeg|400px|thumb|center| Figure 5. Installer's destination directory window.]]
 +
 +
5. Once you have selected the installation directory a confirmation window will be displayed. Click ''Next'' to start the installation or ''Back'' to change any data. '''Note: Be sure to have an Internet connection before click ''Next'' since the installer needs to download some packages'''
 +
 +
[[File:EVAL_SDK_Installation_Step5.jpeg|400px|thumb|center| Figure 6. Installer's confirmation window.]]
 +
 +
6. Wait while the EVAL SDK is installed in your computer.
 +
 +
[[File:EVAL_SDK_Installation_Step6.jpeg|400px|thumb|center| Figure 7. Installer's installation progress window.]]
 +
 +
7. Once the EVAL SDK has been successfully installed the next window will be displayed. Click ''Finish'' to close the installer and start using the EVAL SDK.
 +
 +
[[File:EVAL_SDK_Installation_Step7.jpeg|400px|thumb|center| Figure 8. Installer's installation complete window.]]
I put all my development directories in the work directory in my home folder.  You can have more than one development directory installed, just remember to have the DEVDIR shell variable set properly.
I put all my development directories in the work directory in my home folder.  You can have more than one development directory installed, just remember to have the DEVDIR shell variable set properly.
-
== Build SDK ==
+
== Configuring the SDK ==
-
Several packages are needed in order to compile the SDK.  The SDK build process will let you know what packages are needed. While compiling you will be prompted to install them using ''sudo apt-get &lt;packages&gt;''.  
+
RidgeRun SDK can be easily configured using a menuconfig-like tool.
Configure the features you want to have in your board using:  
Configure the features you want to have in your board using:  
Line 79: Line 134:
<pre style="background:#FFFFC0">
<pre style="background:#FFFFC0">
make config
make config
 +
</pre>
 +
 +
You'll find that there are a lot of options you can choose according to your needs.
 +
 +
Users will be particularly interested in changing the type of connection between the host PC and the target board and the target file system type.
 +
NFS and JFFS2 file system configurations will be detailed here, creating bootable SD cards is detailed later on this wiki.
 +
 +
===NFS===
 +
This is the easiest way to develop on the target board since it allows the user to make changes on the host PC which are going to be reflected on the target
 +
board without having to reinstall.
 +
 +
First, connect the board to the same network your host PC is. In most cases that means to connect the board to a free port in your router.
 +
 +
Next, the NFS service needs to be started. Please follow the next guide in order to achieve that:
 +
 +
https://www.ridgerun.com/developer/wiki/index.php/Setting_Up_A_NFS_Service
 +
 +
Next step is to configure the SDK appropriately. Enter the configuration menu and modify the following entries:
 +
 +
* Set firmware deployment mode to "Attached board on communication port":
 +
<pre>
 +
  ┌───────────────────────────────────────────────── Firmware deployment mode ──────────────────────────────────────────────────┐
 +
  │ There is no help available for this option.                                                                                │ 
 +
  │ Prompt: Firmware deployment mode                                                                                           
 +
  │  Defined at installer/u-boot-installer/Config:6                                                                           
 +
  │  Location:                                                                                                               
 +
  │    -> Installer Configuration                                                                                             
 +
  │  Selected by: m
 +
</pre>
 +
 +
* Set the interface your host PC is using to connect to the network (probably eth0 or wlan0):
 +
<pre>
 +
  │ CONFIG_INSTALLER_HOST_NET_INTERFACE:                                                                                       
 +
  │                                                                                                                           
 +
  │ If you are going to deploy over tftp or use NFS root mount, you need to                                                   
 +
  │ specify which network interface in your host machine faces the target                                                     
 +
  │ hardware in order for the SDK to identify the network address to use                                                       
 +
  │                                                                                                                           
 +
  │ Symbol: INSTALLER_HOST_NET_INTERFACE [=eth0]                                                                             
 +
  │ Prompt: Interface on your host machine connected to your target hardware                                                   
 +
  │  Defined at installer/u-boot-installer/Config:40                                                                         
 +
  │  Depends on: INSTALLER_MODE_ATTACHED_BOARD || INSTALLER_MODE_SD_CARD && FS_TARGET_NFSROOT                                 
 +
  │  Location:                                                                                                               
 +
  │    -> Installer Configuration
 +
</pre>
 +
 +
* Select the protocol for transfering images from the host PC to the target board
 +
<pre>
 +
  ┌─────────────────────────────────────── Protocol for transfering images to the target ───────────────────────────────────────┐
 +
  │ There is no help available for this option.                                                                             
 +
  │ Prompt: Protocol for transfering images to the target                                                                     
 +
  │  Defined at installer/u-boot-installer/methods/attached_board/Config:30                                                   
 +
  │  Depends on: (INSTALLER_MODE_ATTACHED_BOARD || INSTALLER_MODE_SD_CARD_INSTALLER) && !INSTALLER_MODE_SD_CARD_INSTALLER     
 +
  │  Location:                                                                                                             
 +
  │    -> Installer Configuration                                                                                             
 +
  │  Selected by: (INSTALLER_MODE_ATTACHED_BOARD || INSTALLER_MODE_SD_CARD_INSTALLER) && !INSTALLER_MODE_SD_CARD_INSTALLER && m 
 +
  │                                                                                                                           
 +
</pre>
 +
 +
The fastest method is using TFTP, see how to set up a TFTP service [https://www.ridgerun.com/developer/wiki/index.php/Setting_Up_A_Tftp_Service here].
 +
 +
* Choose ''NFS root file system''
 +
<pre>
 +
  ┌───────────────────────────────────────────────── File system image target ──────────────────────────────────────────────────┐
 +
  │ There is no help available for this option.                                                                                │ 
 +
  │ Prompt: File system image target                                                                                           
 +
  │  Defined at fs/Config:14                                                                                                 
 +
  │  Location:                                                                                                               
 +
  │    -> File System Configuration                                                                                           
 +
  │  Selected by: m 
 +
</pre>
 +
Choosing NFS will use $DEVDIR/fs/fs as the root file system for Linux on your target board.
 +
 +
===JFFS2===
 +
If you decide to use JFFS2, the contents of $DEVDIR/fs/fs will be used to create a JFFS2-type image that will be installed on the target NAND flash memory.
 +
 +
Whenever you make a change on your file system (e.g. adding a new package to you SDK configuration) you'll need to reinstall the SDK, which makes
 +
developing slower. Using JFFS2 has the advantage that it doesn't require your board to be connected to the network.
 +
 +
* Choose ''JFFS2 disk image''
 +
<pre>
 +
  ┌───────────────────────────────────────────────── File system image target ──────────────────────────────────────────────────┐
 +
  │ There is no help available for this option.                                                                                │                                                                                 
 +
  │ Prompt: File system image target                                                                                           
 +
  │  Defined at fs/Config:14                                                                                                 
 +
  │  Location:                                                                                                               
 +
  │    -> File System Configuration                                                                                           
 +
  │  Selected by: m 
 +
</pre>
 +
 +
if your board isn't connected to the network you'll be forced to transfer images to the board using the serial port on
 +
 +
* Select the protocol for transfering images from the host PC to the target board
 +
<pre>
 +
  ┌─────────────────────────────────────── Protocol for transfering images to the target ───────────────────────────────────────┐
 +
  │ There is no help available for this option.                                                                             
 +
  │ Prompt: Protocol for transfering images to the target                                                                     
 +
  │  Defined at installer/u-boot-installer/methods/attached_board/Config:30                                                   
 +
  │  Depends on: (INSTALLER_MODE_ATTACHED_BOARD || INSTALLER_MODE_SD_CARD_INSTALLER) && !INSTALLER_MODE_SD_CARD_INSTALLER     
 +
  │  Location:                                                                                                             
 +
  │    -> Installer Configuration                                                                                             
 +
  │  Selected by: (INSTALLER_MODE_ATTACHED_BOARD || INSTALLER_MODE_SD_CARD_INSTALLER) && !INSTALLER_MODE_SD_CARD_INSTALLER && m 
 +
  │                                                                                                                         
 +
</pre>
 +
 +
 +
==Building the SDK ==
 +
 +
Several packages are needed in order to compile the SDK.  The SDK build process will let you know what packages are needed. While compiling you will be prompted to install them using ''sudo apt-get &lt;packages&gt;''.
 +
 +
You can get a description of all the available commands for the SDK by running the following command into your SDK's installation directory:
 +
 +
<pre style="background:#FFFFC0">
 +
make help
 +
</pre>
 +
 +
It will show a list as the shown bellow:
 +
 +
<pre>
 +
RidgeRun Integrated Linux Software Developer's Kit
 +
 +
Make targets:
 +
 +
  build          - build kernel, target fs, bootloader
 +
  kernel          - build kernel
 +
  fs              - build target filesystem
 +
  cmdline        - build cmdline for target kernel (fs target does the same as well)
 +
  bootloader      - build bootloader
 +
  config          - allow SDK to be configured
 +
  config_batch    - attempt to configure without user interaction
 +
  clean          - delete all derived files
 +
  update          - Checks for repository updates for the SDK
 +
  show_updates    - Checks for available updates for the SDK's release; use revision=<number> to specify a particular revision or range (same syntax as svn log) or showdirs=1 to enable showing change details in the log displayed.
 +
  env            - Displays commands to run to setup shell environment
 +
  coreconfig      - Select toolchain, bootloader, and kernel (updates bsp/mach/Make.conf)
 +
  doc            - Generate the SDK API documentation into the documentation folder
 +
  prelink        - prelink the root filesystem
 +
  install        - Install all out of date images to target
 +
  installbootloader - Install bootloader to target
 +
  installmtd      - Install uBoot MTD partition table
 +
  installkernel  - Install kernel to target
 +
  installfs      - Install file system to target
 +
  installcmdline  - Install uBoot kernel command line
 +
  installbootcmd  - Install uBoot boot command
 +
  svnup          - recursively run the 'svn up' command.
 +
 +
Make parameters:
 +
 +
  VERBOSE        - set to 1 to output executing commands
 +
  LOGFILE        - set to built output filename
 +
 +
Make update parameters:
 +
 +
  FORCE_UP        - set to force the application/removal of patches
 +
  DEBUG_UP        - set to output the executing commands
 +
 +
U-boot Installer Parameters ($DEVDIR/installer/u-boot-installer)
 +
  PORT            - Host serial port to use for install
 +
  HOST_IP        - Host IP address to use for TFTP install
 +
  FORMAT          - Set to 1 to force SD card to be formatted
 +
  FORCEINSTALL    - Set to yes to force performing the requested install target
 +
  ERASECHIP      - Set to yes if you want to scrub the FLASH chip during bootloader installation
 +
 +
Examples:
 +
 +
  make                  # same as 'make build'
 +
  make VERBOSE=1
 +
  make installbootloader PORT=/dev/ttyUSB1
</pre>
</pre>
Line 156: Line 379:
</pre>
</pre>
-
For SDK 2011Q2 and later versions it has been added a new target called '''make show_updates''' which will shows a list of all available updates with its detailed description.
+
A list of all current updates available is shown when running the following command
 +
<pre style="background:#FFFFC0">
 +
make show_updates
 +
</pre>
= SDK Hints =
= SDK Hints =
 +
 +
== Common problems and their solution FAQ ==
 +
 +
A FAQ listing error messages / solutions is available at [[RidgeRun SDK Technical FAQ]].
== SD boot recover  ==
== SD boot recover  ==
-
If you brick your board, this can be recovered from an SD card. In order to make a bootable SD card you first need to have a successfully compiled SDK.  
+
If you brick your board, this can be recovered from the installer SD card available at http://www.ridgerun.com/downloadcenter.shtml look for the SD image with the name: "Leo365Eval2011Q2_JFFS2.zip". The SD image will install bootloader, kernel and file system into the LeopardBoard.
 +
 
 +
In order to make a bootable SD card with RR SDK, you need to have a successfully compiled SDK. Then proceed to create the SD image:
=== SD card preparation ===
=== SD card preparation ===
Line 168: Line 400:
1. Insert the SD card to the host port
1. Insert the SD card to the host port
-
2. Find out the device mounting point (e.g. /dev/sdd)  
+
2. Find out the device mounting point (e.g. /dev/sdd) where sdX is your device mounting point.
-
 
+
-
3. On your devdir root directory type:
+
 +
3. On your SDK make config menu, search for Installer Configuration and set:
<pre style="background:#FFFFC0">
<pre style="background:#FFFFC0">
-
make sd_boot_recover device=/dev/sdX
+
Firmware deployment mode (Deploy all the firmware to an SD card)
 +
(128) Size of loopback device for SD card (in MB) #Size can be bigger
 +
[*] Flash SD card image into loopback file instead of real SD #To create an image file
</pre>
</pre>
-
where sdX is your device mounting point.  
+
[[File:SD1.jpg]]
-
=== Install Boot recovery files on SD card ===
+
4. Install the SD using make install:
 +
<pre>
 +
make install
 +
</pre>
-
1. Remove SD card from host and reinsert the SD card into host.  This will cause your host to mount the VFAT file system on the SD card.
+
A warning will be displayed
-
2. Type
+
[[File:SDcard2.jpg]]
-
<pre style="background:#FFFFC0">
+
Type yes in order to format the sdcard.img file and create a new one. the file will be created at $DEVDIR/images
-
make install sd_boot_recover
+
 
-
</pre>
+
Use any unix software like "dd" in order to save the sdcard.img file at a SD card. WARNING be careful when using software like dd, you could damage boot partiotions of your computer if write into the wrong device.
 +
 
 +
=== Create a bootable SD card with file system ===
 +
 
 +
1. At make config menu, Select at file system configuration: File system image target (Secure Digital Card)
 +
 
 +
[[File:Sd3.jpg]]
 +
 
 +
Follow the steps indicated at: [https://www.ridgerun.com/developer/wiki/index.php/DM365_Leopard_SDK_2011Q2_Getting_Started_Guide#SD_card_preparation "SD card preparation"]
 +
 
 +
 
 +
=== SD card preparation without loopback file  ===
 +
 
 +
This method allows the SDK to write directly into the SD card. WARNING a wrong configuration may cause the SDK to write into a wrong device which may cause problems, formating wrong devices or loss of data, be sure to find out the device mounting point of the SD card.
 +
 
 +
A way to find the SD mounting point is to use "df":
 +
 
 +
[[Image:Sd4.jpg]]
 +
 
 +
At the above image the sd card was mounted at /dev/sdb in this case the SDK will be configured to write sdb, on your computer the SD could be mounted at other mount point:
 +
 
 +
[[Image:Sd5.jpg]]
 +
 
 +
Also the SD needs to be unmounted before using the make install command of the SDK other case the SDK will refuse to format the SD.
 +
 
 +
[[File:Sd7.jpg]]
 +
 
 +
WARNING the SDK will format the device at the specified mount point, configuring the SDK to format a wrong device may cause data loss, boot partition format or other serious issues.
=== Boot from SD to recover NAND image ===
=== Boot from SD to recover NAND image ===
Line 248: Line 511:
== Activation of video capture modules  ==
== Activation of video capture modules  ==
-
While configuring the SDK go to ''Kernel configuration-&gt;Device drivers-&gt;Multimedia support-&gt;Video capture adapters and activate the devices you desire.''
+
While configuring the SDK go to ''Kernel configuration-&gt;Device drivers-&gt;Multimedia support-&gt;Video capture adapters'' and activate the devices you desire. For more details see [[Hardware setup - LeopardBoard DM365]].
-
[[LeopardBoard 365 GStreamer Pipelines]] contains instructions showing examples to demonstrate the hardware is working.
+
[[LeopardBoard 365 GStreamer Pipelines - SDK 2011Q2]] contains instructions showing examples to demonstrate the hardware is working.
Before running a capture pipeline you must be sure you have chained the video previewer, that could be done in two ways:
Before running a capture pipeline you must be sure you have chained the video previewer, that could be done in two ways:

Revision as of 21:19, 5 February 2013

This guide includes instructions and tips users should follow to get their DM365 Leopard Board to work with the RR Evaluation SDK. For this guide different commands need to be executed on the host machine and the target. Commands to be run on the Ubuntu host have a yellow background. Commands to be run on the Ubuntu target have an aqua background.

Contents

Installation

Getting the RR LeopardBoard DM365 EVAL SDK 2011Q2

If you want to get the LeopardBoard DM365 EVAL SDK 2011Q2 you need to go to our download center page and select the LeopardBoard DM365 Evaluation SDK. 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:

CodeSourcery Toolchain Installation

New DM365 SDK 2011Q2 uses the Codesourcery toolchain for cross compilation. You need to download and install the toolchain before you can build the SDK.

In order to download and install the CodeSourcery's toolchain for the DM365 SDK 2011Q2 please see Code Sourcery ARM toolchain 2009q1-203.

DVSDK 4 Installation

In addition to the toolchain, it is necessary to install the TI's Digital Video Software Development Kit (DVSDK) package before installing the SDK. The DM365 SDK 2011Q2 uses the new DVSDK 4. The download and installation instructions are detailed below:

1. The dvsdk_dm365-evm_4_02_00_06_setuplinux binary file can be downloaded from TI's site.

2. Install it by executing the binary file with the following commands:

sudo chmod a+wrx dvsdk_dm365-evm_4_02_00_06_setuplinux
./dvsdk_dm365-evm_4_02_00_06_setuplinux

3. You will be asked for the Toolchain's path, you need to specify the path to the binaries' directory of the toolchain as is shown in the following image:

Figure 1. DVSDK 4 Toolchain check window.

4. Install the DVSDK with the default configuration.

Install other required packages

Usually the SDK will ask you to install any missing package it requires that is not installed on your host machine. You can install them using the following command:

sudo apt-get install package_name

The following is the list of the required packages by the SDK:

It is possible you need to install some additional packages when some features require them, the SDK will ask you for this packages in the form of a error message as is shown below:

Checking for host packages required by the SDK build system:
    buildsystem (build-essential) is installed
    make (make) is installed
    ncurses (libncurses5-dev) is installed
    texinfo (texinfo) is installed
 >> minicom (minicom) is NOT installed
    perl (perl) is installed
    quilt (quilt) is installed
    dc (dc) is installed
    subversion (subversion) is installed
    curl (curl) is installed
    git (git-core) is installed
    autoconf (autoconf) is installed
    crypt-ssleay (libcrypt-ssleay-perl) is installed
    quilt (quilt) is installed
    libusb (libusb-dev) is installed
    perl-expect (libexpect-perl) is installed
    mono (mono-devel) is installed
There are missing packages, please install them:
 apt-get install minicom
make: *** [.oscheck] Error 1

Installing the SDK

Once you have downloaded the SDK installer you can execute it by running the following commands:

sudo chmod a+x LeopardBoardDM365sdk-EVAL2011Q2-Linux-x86-Install.bin
./LeopardBoardDM365sdk-EVAL2011Q2-Linux-x86-Install.bin

Once you have executed it you can follow the next steps for its installation.

1. Click Yes in the start up window.

Figure 2. Installer's start up window.

2. Click Next in the main window.

Figure 3. Installer's main window.

3. Accept the license terms in order to use the EVAL SDK and click Next to continue.

Figure 4. Installer's License Agreement window.

4. Choose the destination directory to where the EVAL SDK will be installed. Note: The installation directory must be a folder that doesn't exist since the installer will create it in the process.

Figure 5. Installer's destination directory window.

5. Once you have selected the installation directory a confirmation window will be displayed. Click Next to start the installation or Back to change any data. Note: Be sure to have an Internet connection before click Next since the installer needs to download some packages

Figure 6. Installer's confirmation window.

6. Wait while the EVAL SDK is installed in your computer.

Figure 7. Installer's installation progress window.

7. Once the EVAL SDK has been successfully installed the next window will be displayed. Click Finish to close the installer and start using the EVAL SDK.

Figure 8. Installer's installation complete window.

I put all my development directories in the work directory in my home folder. You can have more than one development directory installed, just remember to have the DEVDIR shell variable set properly.

Configuring the SDK

RidgeRun SDK can be easily configured using a menuconfig-like tool.

Configure the features you want to have in your board using:

make config

You'll find that there are a lot of options you can choose according to your needs.

Users will be particularly interested in changing the type of connection between the host PC and the target board and the target file system type. NFS and JFFS2 file system configurations will be detailed here, creating bootable SD cards is detailed later on this wiki.

NFS

This is the easiest way to develop on the target board since it allows the user to make changes on the host PC which are going to be reflected on the target board without having to reinstall.

First, connect the board to the same network your host PC is. In most cases that means to connect the board to a free port in your router.

Next, the NFS service needs to be started. Please follow the next guide in order to achieve that:

https://www.ridgerun.com/developer/wiki/index.php/Setting_Up_A_NFS_Service

Next step is to configure the SDK appropriately. Enter the configuration menu and modify the following entries:

  ┌───────────────────────────────────────────────── Firmware deployment mode ──────────────────────────────────────────────────┐
  │ There is no help available for this option.                                                                                 │  
  │ Prompt: Firmware deployment mode                                                                                            
  │   Defined at installer/u-boot-installer/Config:6                                                                            
  │   Location:                                                                                                                 
  │     -> Installer Configuration                                                                                              
  │   Selected by: m
  │ CONFIG_INSTALLER_HOST_NET_INTERFACE:                                                                                        
  │                                                                                                                             
  │ If you are going to deploy over tftp or use NFS root mount, you need to                                                     
  │ specify which network interface in your host machine faces the target                                                       
  │ hardware in order for the SDK to identify the network address to use                                                        
  │                                                                                                                             
  │ Symbol: INSTALLER_HOST_NET_INTERFACE [=eth0]                                                                               
  │ Prompt: Interface on your host machine connected to your target hardware                                                    
  │   Defined at installer/u-boot-installer/Config:40                                                                           
  │   Depends on: INSTALLER_MODE_ATTACHED_BOARD || INSTALLER_MODE_SD_CARD && FS_TARGET_NFSROOT                                  
  │   Location:                                                                                                                 
  │     -> Installer Configuration 
  ┌─────────────────────────────────────── Protocol for transfering images to the target ───────────────────────────────────────┐
  │ There is no help available for this option.                                                                              
  │ Prompt: Protocol for transfering images to the target                                                                       
  │   Defined at installer/u-boot-installer/methods/attached_board/Config:30                                                    
  │   Depends on: (INSTALLER_MODE_ATTACHED_BOARD || INSTALLER_MODE_SD_CARD_INSTALLER) && !INSTALLER_MODE_SD_CARD_INSTALLER      
  │   Location:                                                                                                               
  │     -> Installer Configuration                                                                                              
  │   Selected by: (INSTALLER_MODE_ATTACHED_BOARD || INSTALLER_MODE_SD_CARD_INSTALLER) && !INSTALLER_MODE_SD_CARD_INSTALLER && m  
  │                                                                                                                            

The fastest method is using TFTP, see how to set up a TFTP service here.

  ┌───────────────────────────────────────────────── File system image target ──────────────────────────────────────────────────┐
  │ There is no help available for this option.                                                                                 │  
  │ Prompt: File system image target                                                                                            
  │   Defined at fs/Config:14                                                                                                   
  │   Location:                                                                                                                 
  │     -> File System Configuration                                                                                            
  │   Selected by: m  

Choosing NFS will use $DEVDIR/fs/fs as the root file system for Linux on your target board.

JFFS2

If you decide to use JFFS2, the contents of $DEVDIR/fs/fs will be used to create a JFFS2-type image that will be installed on the target NAND flash memory.

Whenever you make a change on your file system (e.g. adding a new package to you SDK configuration) you'll need to reinstall the SDK, which makes developing slower. Using JFFS2 has the advantage that it doesn't require your board to be connected to the network.

  ┌───────────────────────────────────────────────── File system image target ──────────────────────────────────────────────────┐
  │ There is no help available for this option.                                                                                 │                                                                                   
  │ Prompt: File system image target                                                                                            
  │   Defined at fs/Config:14                                                                                                   
  │   Location:                                                                                                                 
  │     -> File System Configuration                                                                                            
  │   Selected by: m  

if your board isn't connected to the network you'll be forced to transfer images to the board using the serial port on

  ┌─────────────────────────────────────── Protocol for transfering images to the target ───────────────────────────────────────┐
  │ There is no help available for this option.                                                                              
  │ Prompt: Protocol for transfering images to the target                                                                       
  │   Defined at installer/u-boot-installer/methods/attached_board/Config:30                                                    
  │   Depends on: (INSTALLER_MODE_ATTACHED_BOARD || INSTALLER_MODE_SD_CARD_INSTALLER) && !INSTALLER_MODE_SD_CARD_INSTALLER      
  │   Location:                                                                                                               
  │     -> Installer Configuration                                                                                              
  │   Selected by: (INSTALLER_MODE_ATTACHED_BOARD || INSTALLER_MODE_SD_CARD_INSTALLER) && !INSTALLER_MODE_SD_CARD_INSTALLER && m  
  │                                                                                                                           


Building the SDK

Several packages are needed in order to compile the SDK. The SDK build process will let you know what packages are needed. While compiling you will be prompted to install them using sudo apt-get <packages>.

You can get a description of all the available commands for the SDK by running the following command into your SDK's installation directory:

make help

It will show a list as the shown bellow:

RidgeRun Integrated Linux Software Developer's Kit

Make targets:

   build           - build kernel, target fs, bootloader
   kernel          - build kernel
   fs              - build target filesystem
   cmdline         - build cmdline for target kernel (fs target does the same as well)
   bootloader      - build bootloader
   config          - allow SDK to be configured
   config_batch    - attempt to configure without user interaction
   clean           - delete all derived files
   update          - Checks for repository updates for the SDK
   show_updates    - Checks for available updates for the SDK's release; use revision=<number> to specify a particular revision or range (same syntax as svn log) or showdirs=1 to enable showing change details in the log displayed.
   env             - Displays commands to run to setup shell environment
   coreconfig      - Select toolchain, bootloader, and kernel (updates bsp/mach/Make.conf)
   doc             - Generate the SDK API documentation into the documentation folder
   prelink         - prelink the root filesystem
   install         - Install all out of date images to target
   installbootloader - Install bootloader to target
   installmtd      - Install uBoot MTD partition table
   installkernel   - Install kernel to target
   installfs       - Install file system to target
   installcmdline  - Install uBoot kernel command line
   installbootcmd  - Install uBoot boot command
   svnup           - recursively run the 'svn up' command.

Make parameters:

   VERBOSE         - set to 1 to output executing commands
   LOGFILE         - set to built output filename

Make update parameters:

   FORCE_UP        - set to force the application/removal of patches
   DEBUG_UP        - set to output the executing commands

 U-boot Installer Parameters ($DEVDIR/installer/u-boot-installer)
   PORT            - Host serial port to use for install
   HOST_IP         - Host IP address to use for TFTP install
   FORMAT          - Set to 1 to force SD card to be formatted
   FORCEINSTALL    - Set to yes to force performing the requested install target
   ERASECHIP       - Set to yes if you want to scrub the FLASH chip during bootloader installation

Examples:

   make                   # same as 'make build'
   make VERBOSE=1
   make installbootloader PORT=/dev/ttyUSB1

Set the PATH to include the toolchain and aslo set the DEVDIR shell variable

$(make env) # this is the same as using grave accents to execute the output from the command - `make env`

Compile the SDK:

make

Install bootloader, kernel, and target file system on LeopardBoard 365

Verify bootloader is active

First a minicom (or any other terminal emulator used) session must be opened in order to stop the booting process at the bootloader prompt:

minicom

Reboot the board and stop the autoboot when

Hit any key to stop autoboot: ...

is displayed. Then close your minicom session.

Save bootloader to target hardware

The next step is to install the bootloader on the target. Typically you only install the SDK bootloader once.

make installbootloader

Update target hardware with new images

Power cycle your target hardware, and install uboot environment / kernel / FS on the target (per your SDK configuration choices):

make install

Similar to the bootloader installation, to install the devdir on the target the booting process should be stopped at the bootloader prompt.

Updating your SDK

Since the SDK is in a SVN respository RidgeRun can periodically make updates to the contents. To have an up-to-date SDK the following command must be executed on the SDK root directory

make update

If, for any reason, modifications to any files that are included in a patch were made, the make update process won't be able to finish successfully. In order to override this the following command must be executed

make update FORCE_UP=1

Note that all changes previously made to these files will be lost.

Also, a debug functionality is implemented where all the executed commands will be displayed on the standard error (usually the same as standard output). To activate it use

make update DEBUG_UP=1

Of course, a combination of both options can be used

make update FORCE_UP=1 DEBUG_UP=1

A brief help menu explaining these features can be displayed using

make help

A list of all current updates available is shown when running the following command

make show_updates

SDK Hints

Common problems and their solution FAQ

A FAQ listing error messages / solutions is available at RidgeRun SDK Technical FAQ.

SD boot recover

If you brick your board, this can be recovered from the installer SD card available at http://www.ridgerun.com/downloadcenter.shtml look for the SD image with the name: "Leo365Eval2011Q2_JFFS2.zip". The SD image will install bootloader, kernel and file system into the LeopardBoard.

In order to make a bootable SD card with RR SDK, you need to have a successfully compiled SDK. Then proceed to create the SD image:

SD card preparation

1. Insert the SD card to the host port

2. Find out the device mounting point (e.g. /dev/sdd) where sdX is your device mounting point.

3. On your SDK make config menu, search for Installer Configuration and set:

Firmware deployment mode (Deploy all the firmware to an SD card)
(128) Size of loopback device for SD card (in MB) #Size can be bigger
[*] Flash SD card image into loopback file instead of real SD #To create an image file

SD1.jpg

4. Install the SD using make install:

make install

A warning will be displayed

SDcard2.jpg

Type yes in order to format the sdcard.img file and create a new one. the file will be created at $DEVDIR/images

Use any unix software like "dd" in order to save the sdcard.img file at a SD card. WARNING be careful when using software like dd, you could damage boot partiotions of your computer if write into the wrong device.

Create a bootable SD card with file system

1. At make config menu, Select at file system configuration: File system image target (Secure Digital Card)

Sd3.jpg

Follow the steps indicated at: "SD card preparation"


SD card preparation without loopback file

This method allows the SDK to write directly into the SD card. WARNING a wrong configuration may cause the SDK to write into a wrong device which may cause problems, formating wrong devices or loss of data, be sure to find out the device mounting point of the SD card.

A way to find the SD mounting point is to use "df":

Sd4.jpg

At the above image the sd card was mounted at /dev/sdb in this case the SDK will be configured to write sdb, on your computer the SD could be mounted at other mount point:

Sd5.jpg

Also the SD needs to be unmounted before using the make install command of the SDK other case the SDK will refuse to format the SD.

Sd7.jpg

WARNING the SDK will format the device at the specified mount point, configuring the SDK to format a wrong device may cause data loss, boot partition format or other serious issues.

Boot from SD to recover NAND image

1. Set switch 2 of DIPSW1 to ON, 1 and 3 to OFF. This is SD card boot mode.

2. Power up the board, it will automatically erase the NAND flash, and burn UBL, u-boot, kernel and file system. The SD card recovery LeopardBoard 365 serial output will provide progress information.


Verify NAND recovery

1. Set all pos of DIPSW1 to OFF for NAND boot mode.

2. Connect serial cable to PC and power cycle the board (it should boot up). Insert the SD card to the board.

Your LeopardBoard 365 now contains the UBL, uboot, kernel, and file system that was originally shipped on LeopardBoard 365 boards.

Having this done the bootloader and devdir must be installed (check Installation for instructions).

Setting up video components

The output and mode used for video playback/capture can be set during the SDK configuration process. The first step is to enter the configuration script:

make config

Inside Architecture configurations select the options you desire on Video Output and Video Default Resolution.

Finally compile your changes and install

make
make install

When you use the SDK to set your video output and resolution, the SDK build process creates $DEVDIR/images/cmdline with different kernel command line parameter settings. The table below shows the various video output settings for three of the common settings

Video Output DVI Component Composite sysfs file
Resolution 720P-60 720P-60 NTSC
davinci_enc_mngr.ch0_output DVI COMPOSITE COMPONENT /sys/class/davinci_display/ch0/output
davinci_enc_mngr.ch0_mode 720P-60 720P-60 NTSC /sys/class/davinci_display/ch0/mode
davinci_display.cont2_bufsize 6291456 6291456 3145728
vpfe_capture.cont_bufoffset 6291456 6291456 3145728
vpfe_capture.cont_bufsize 6291456 6291456 6291456

Activation of video capture modules

While configuring the SDK go to Kernel configuration->Device drivers->Multimedia support->Video capture adapters and activate the devices you desire. For more details see Hardware setup - LeopardBoard DM365.

LeopardBoard 365 GStreamer Pipelines - SDK 2011Q2 contains instructions showing examples to demonstrate the hardware is working.

Before running a capture pipeline you must be sure you have chained the video previewer, that could be done in two ways:

Video initialization

When you boot your board the RidgeRun logo will be displayed, in order to display video the following commands must be executed:

fbset -disable


Output volume modification

To increase/decrease the volume for audio playback (or other audio options) type

alsamixer

and modify as desired.

Using ipiped and AEW library

Ipiped is a D-Bus server for controlling and configuring the camera sensor, the dm365 video processor and the aew library. It usually works together with the auto white balance and auto exposure (aew) library in order to give a better control of the quality of the image captured.

You can find a Demo version of the AEW library in our EVAL SDK for DM365 2011Q2. This version is fully functional but has some demo features:

You can find more about Ipiped and the AEW library at Auto exposure and auto white balance library

AEW Commands

In order to use Ridgerun's AEW demo a series of commands needs to be entered at the Leopard's console:

640x480 Video Playback

First you need to remove RidgeRun logo image from the screen

 fbset -disable

The screen will be plain white after the "fbset -disable" command

In order to use the Ridgerun's AEW Demo, first a config script for the 5Mp video sensor mt9p031 needs to be run:

 ipipe-client run-config-script dm365_mt9p031_config

This will chain ipiped, set the bayer-pattern and others.

Next, configure auto exposure:

 ipipe-client init-aew G EC S C 150000 15 50 640 480 50

This will configure the auto exposure as:

White balance: Gray world algorithm
Auto exposure: Electronic centric
Gain type: the sensor gain
Exposure metering method: center weighted metering
Time between algorithm adjustments: 200000 uS
Minimum frame rate: 15
Frame segmentation factor: 50
Width: 640
Height: 480
Center percentage: 50%

For more information about RidgeRun's AEW options:

 ipipe-client help init-aew

Other options are available, for example white balance can use retinex algorithm, Exposure can use: partial metering, average metering or segmented metering.

Recommended pipeline for video playback:

 gst-launch -e v4l2src chain-ipipe=false always-copy=false ! dmaiaccel ! video/x-raw-yuv,format=\(fourcc\)NV12, width=640, height=480, framerate=\(fraction\)30/1 ! dmaiperf \
 ! TIDmaiVideoSink sync=false accelFrameCopy=false videoOutput=composite videoStd=D1_NTSC&

640x480 Video Recording

Same as 640x480 video playback, but use the following pipeline:

 gst-launch -e -v v4l2src always-copy=FALSE chain-ipipe=false num-buffers=300 ! \
 'video/x-raw-yuv,format=(fourcc)NV12,width=640,height=480' ! dmaiaccel ! dmaienc_mpeg2 ! \
 dmaiperf ! mpegpsmux ! filesink location= test8003.mpeg

A file named: test8003.mpeg will be created, no video will be displayed in the composite output.

1280x720 Video Recording

Similar to 640x480 video playback, but instead of using:

ipipe-client init-aew G EC S C 150000 15 50 640 480 50

Use:

 ipipe-client init-aew G EC S C 150000 15 50 1280 720 50

Use the following pipeline:

 gst-launch -e -v v4l2src always-copy=FALSE chain-ipipe=false num-buffers=300 \
 ! 'video/x-raw-yuv,format=(fourcc)NV12,width=1280,height=720 \
 ' ! dmaiaccel ! dmaienc_mpeg2 ! dmaiperf ! mpegpsmux ! filesink location= test8003.mpeg

A file named: test8003.mpeg will be created, no video will be displayed in the composite output.

Using GStreamer with the LeopardBoard DM365 EVAL SDK 2011Q2

You can combine the SDK and the LeopardBoard DM365 with the GStreamer's API in order to get powerful multimedia applications in an easy and faster way. Some examples of use of GStreamer to implement basic multimedia pipelines can be found at LeopardBoard 365 GStreamer Pipelines - SDK 2011Q2.

SDK common errors

Bash is not the default shell

Error

bash is not your default shell 
Please run: 
    sudo rm /bin/sh 
    sudo ln -s /bin/bash /bin/sh 
make: *** [.oscheck] Error 255 

Solution: Set bash as your default shell. Run the following commands.

sudo rm /bin/sh 
sudo ln -s /bin/bash /bin/sh 

Missing packages in host computer

If you are running the "make config" command for the first time, you may need to install some packages in order to compile the SDK. You might receive a message as follows:

work@work-laptop:leopard-dm365$ make config 
The system is ubuntu-10.04 running in a 32 bit architecture 
SYSID: ubuntu-10.04_32 
Checking for host packages required by the SDK build system: 
    buildsystem (build-essential) is installed 
 >> libtool (libtool) is NOT installed 
    make (make) is installed 
 >> ncurses (libncurses5-dev) is NOT installed 
    texinfo (texinfo) is installed 
 >> minicom (minicom) is NOT installed 
    perl (perl) is installed 
    quilt (quilt) is installed 
    dc (dc) is installed 
    subversion (subversion) is installed 
 >> curl (curl) is NOT installed 
    quilt (quilt) is installed 
 >> libusb (libusb-dev) is NOT installed 
 >> perl-expect (libexpect-perl) is NOT installed 
 >> mono (mono-devel) is NOT installed 
There are missing packages, please install them: 
 apt-get install libtool libncurses5-dev minicom curl libusb-dev libexpect-perl mono-devel 
make: *** [.oscheck] Error 1 

Use the apt-get command to install the missing packages, for example, if you get the following message:

 >> curl (curl) is NOT installed 

Then you should install that package as follows:

sudo apt-get install curl

arm-linux-gnueabi-gcc: command not found

If you have not installed the toolchain yet, you will get the following erros:

kernel/bounds.c 
/bin/sh: arm-linux-gnueabi-gcc: command not found 
make[3]: *** [kernel/bounds.s] Error 127 
make[2]: *** [prepare0] Error 2 
make[2]: Leaving directory `/home/work/leopard-dm365/kernel/linux-2.6.32' 
make[1]: *** [build] Error 2 
make[1]: Leaving directory `/home/work/leopard-dm365/kernel' 
make: *** [kernel_build] Error 2 

You need to install the toolchain, follow the instructions Install here.

Unable to find the dvsdk

Error:

	        echo "Unable to find the file $DVSDK_DIR/Rules.make. Aborting" ; exit 1 ; \ 
	    fi \ 
	fi 

You need to install dvsdk_3_10_00_19 provided by Texas Instruments 
You can abort now and install the dvsdk_3_10_00_19 binary package on the default path 
at /home/work/dvsdk/dvsdk_3_10_00_19, so it will be automatically detected next time you try to build. 
Otherwise you can enter the location where you installed the package below. 

Please provide the path to dvsdk_3_10_00_19 installation location or press ctrl-c to abort 

You need to download and install the dvsdk in your home directory.

Autotools and automake not found

Error:

  checking for automake-1.6 >= 1.7 ... not found. 
  checking for automake-1.5 >= 1.7 ... not found. 
  .
  .
  .
  checking for autoconf-2.53 >= 2.52 ... not found. 
  checking for autoconf-2.52 >= 2.52 ... not found. 

You need to install the package autoconf by running the following command:

sudo apt-get install autoconf2.59 
Navigation
Toolbox