DM365 Leopard SDK Legacy Getting Started Guide
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.
- 1 Installation
- 1.1 GNU Toolchain Installation
- 1.2 Install other required packages
- 1.3 Checkout SDK
- 1.4 Build SDK
- 1.5 Install bootloader, kernel, and target file system on LeopardBoard 365
- 1.6 Updating your SDK
- 2 SDK Hints
- 2.1 SD boot recover
- 2.2 Setting up video components
- 2.3 Activation of video capture modules
- 2.4 Video initialization
- 2.5 Component output initialization
- 2.6 CMEM pools modification
- 2.7 Output volume modification
- 2.8 Using GStreamer with the LeopardBoard DM365 EVAL SDK Legacy
- 3 SDK common errors
The e-mail received with the evaluation SDK installation links should have:
- The SVN repository link.
- The toolchain download link.
- An username and password in order to access the download link for the toolchain.
GNU Toolchain Installation
The LeopardBoard 365 Evaluation SDK uses the GNU toolchain for cross compilation. You need to download and install the toolchain before you can build the SDK.
The email you received when you requested the LeopardBoard 365 Evaluation SDK contained a link to the toolchain tarball, along with the user name and password to access the files available for download.
I saved the toolchain to the default $HOME/Downloads directory.
Assuming the toolchain tarball is in the $HOME/Downloads directory, you can follow these steps to install the toolchain into the location expected by the SDK.
sudo tar -C / -xjf $HOME/Downloads/toolchain.tar.bz2
Verify your GNU toolchain is installed properly.
and you should see around 35 tools in the directory.
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:
With this SVN repository Linux from the email, check out a development directory from the repository:
mkdir -p ~/work cd ~/work svn co <repositoryLink> leo365
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.
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>.
Configure the features you want to have in your board using:
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:
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:
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.
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):
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
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
NOTE: In the latest 2XXXQX versions of the SDK you will be able to find a new target called make show_updates, this target shows all the current available updates for your SDK with a detailed description of each one.
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.
SD card preparation
1. Insert the SD card to the host port
2. Find out the device mounting point (e.g. /dev/sdd)
3. On your devdir root directory type:
make sd_boot_recover device=/dev/sdX
where sdX is your device mounting point.
Install Boot recovery files on SD card
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.
make install sd_boot_recover
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:
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|
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.
LeopardBoard 365 GStreamer Pipelines contains instructions showing examples to demonstrate the hardware is working.
When you boot your board the RidgeRun logo will be displayed, in order to display video the following commands must be executed:
loadmodules.sh fbset -disable
Component output initialization
There's a known bug with the component output initialization. Before you play or capture video using the component output this commands must be executed on the target:
echo "COMPOSITE" > /sys/class/davinci_display/ch0/output echo "COMPONENT" > /sys/class/davinci_display/ch0/output
CMEM pools modification
Depending on the video displayed, the CMEM pools need to be modified to meet the requirements. This is needed when you execute a pipeline and the following error is displayed:
CMEMK Error: Failed to find a pool which fits <poolsize>
First you need the start and end addresses of the CMEM pools, these can be obtained executing loadmodules.sh and checking the output: a line like the next one will be printed
Loading CMEM from 0x<startaddr> to 0x<endaddr>
rmmod cmemk modprobe cmemk phys_start=<startaddr> phys_end=<endaddr> pools=<somepools>, <mynewpools>
where <mynewpools> must be in format: <numberofpools>x<poolsize> (e.g 2x128). You may also need to resize/delete <somepools>
Output volume modification
To increase/decrease the volume for audio playback (or other audio options) type
and modify as desired.
Using GStreamer with the LeopardBoard DM365 EVAL SDK Legacy
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 - Legacy SDK.
SDK common errors
Please refer RidgeRun developer wiki Common RidgeRun SDK issues and how to solve them