Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.

Beginners guide for Leopard Board DM365

From Texas Instruments Wiki
Jump to: navigation, search

Setting up the hardware

This section will explain how to set up the LeopardBoard's hardware in order to get it ready to use.

Basic hardware

In order to get the LeopardBoard DM365 running its necessary a basic hardware items. These hardware elements are shown in the Figure 1. As it is possible to see, there is necessary four basic hardware elements:

  1. Serial cable adapter: it allows the user to transfer the kernel and file system images to the LeopardBoard DM365 and to get access to it.
  2. Switching power supply: it supplies the necessary power to get the LeopardBoard powered on.
  3. Power supply AC cable
  4. LeopardBoard DM365
Figure 1. Basic harware elements for the LeopardBoard DM365


It is also possible to provides the board's power through the USB port if the board is working in device mode. In that case, the basic hardware is reduced to the serial cable adapter, the USB cable adapter (shown with the number 2 in the Figure 2) and the LeopardBoard DM365 as is shown in the next figure.

Figure 2. Alternate basic hardware elements configuration for the LeopardBoard DM365 (USB powered).

Boot control switch configuration

Before connect your LeopardBoard DM365 to your computer or to start it alone, it is necessary to set up the boot source, that is done by setting the boot control dip switch on the LeopardBoard to the respective boot mode. The standard operation mode of the board is the NAND boot mode which allows the board to read the boot data and system images from its own memory devices.

To set the LeopardBoard DM365 in NAND boot mode you must turn off all the switches on the board such as is shown in the following image.

Figure 3. How to set the NAND boot mode.

Power supply connection

If you are using the conventional power supply mode (shown in the Figure 1), you must connect the power supply plug into the power supply jack allocate in the LeopardBoard as is shown in the Figure 4.

Figure 4. Power supply connection in the LeopardBoard DM365


If you are using the USB powered configuration, you must refer to the following section.

USB cable connection

The LeopardBoard DM365 is able to work in both USB modes: device and host mode. If it is working in device mode, it is possible to provide the power through the USB interface and don't use the power supply adapter.

Not matter which configuration is used, you must connect the LeopardBoard DM365 USB interface to the USB cable adapter. This is done by connecting the B type mini-USB connector of the cable adapter to the USB interface in the LeopardBoard in the form shown in the following figure.

Figure 5. USB cable adapter connection.

Serial cable connection

The serial cable adapter is a useful tool that allows the user to take control of the LeopardBoard DM365 and reprogram its memory data. To connect it to the LeopardBoard you must got the stereo plug terminal of the serial cable adapter and connect it to the UART stereo plug allocated in the LeopardBoard, in the Figure 6 is shown how to connect them.

Figure 6. Serial cable adapter connection in the LeopardBoard DM365.

In the other hand, there is necessary to connect the other side of the serial cable adapter to your personal computer. To do this, you must connect the adapter's male serial terminal to the female serial terminal in your computer as is shown in the following figure.

Figure 7. Serial cable adapter connection to the PC.

Network cable connection

In the Figure 8 you can find how to connect the network cable to the LeopardBoard DM365 in order to get it connected to a particular network.

Figure 8. Network cable connection.

SD Card connection

In the following figure it is shown how to introduce a MMC/SD Card into the LeopardBoard DM365's MMC/SD Card slot. This is useful to get the LeopardBoard up after it gets bricked.

Figure 9. MMC/SD Card connection.

Composite video cable connection

If you want to use the LeopardBoard DM365's composite video output you must connect the cable adapter's 2-pin terminal to the output port on the LeopardBoard such as is shown in the following figure.

Figure 10. Composite video cable adapter connection.

Component video cable connection

If you want to connect the LeopardBoard to a video device like a DVD player, is commonly to find that this kind of devices have three video input RCA connectors like the shown in the Figure 11.

Figure 11. Component video terminals on a video device.

Because of the above explained, you need to connect the component video cable adapter to the stereo video output jack allocate on the LeopardBoard in order to get the three connectors you need to connect the board to the device. In the Figure 12 is shown how to connect the component video cable adpapter to the LeopardBoard DM365 and in the Figure 13 is shown how to connect the video terminals to the device, in this last case, take care to connect the terminals correctly accord to its color.

Figure 12. Component video cable adapter connection on the LeopardBoard DM365.
Figure 13. Component video terminals connection on a video device.

Camera module connection

If you want to use a camera module (see section 2.2) you must connect it to the LeopardBoard DM365's camera interface. This connection is shown in the following figure.

Figure 14. Camera module connection on the LeopardBoard DM365.

NOTE: take care of the camera module's orientation. It must has the optical sensor oriented out the board.

First interaction with the board

The first step is to communicate with your Leopard Board, in order to be able to do this, your board contains a UART serial output. Follow the next steps:

1. Connect a serial cable between the serial port on the Leopard Board and the serial port (for example COM1) on a PC as shown on Figures 1 and 2.

Figure 15. Serial cable adapter connection in the LeopardBoard DM365.
Figure 16. Serial cable adapter connection to the PC.


2. Run a terminal session (such as Minicom on Linux or TeraTerm on Windows) on the workstation. This guide will use minicom as an example.

2.1 Install Minicom.

sudo apt-get install minicom

2.2 Configure minicom settings

sudo minicom -s

2.3 The following screen will appear

Figure 17. Minicom configuration menu.

2.4 Select serial port setup and make sure to enter the configuration shown in the Figure below.


Figure 18. Configuring the serial port using minicom

2.5 Open minicom

$ minicom

The following screen will be displayed:

Figure 19. Minicom output.

Beginning Development

In this section it will be explained how to set up your PC's Linux programming environment and how to run a simple C program example on the LeopardBoard DM365.

Setting up your programming environment

To set up your Linux programming environment you need to have installed a group of basic applications. Next it will be described the minimum requirements you need:

1. GNU/Linux OS: The basic you must have is an GNU/Linux distribution installed on your computer. It is recommended to use GNU/Linux Ubuntu 9.04 or later but it is possible that other Linux distributions work well. If you want to install the latest Ubuntu version you can go to http://www.ubuntu.com/.

2. Text Editor: You must have installed a text editor program in which you will write your applications. You can find some terminal's text editor applications such as nano or mcedit, some other graphical interface editors such as gedit and if you want something more advanced you can install an integrated development environment such as Anjuta or Eclipse.

3. GCC package: It's useful to have installed a PC's C compiler in order to test your code on it before compiling it for the LeopardBoard DM365. To install it (if you don't have it installed by default) you must type the following command:

sudo apt-get install build-essential

This package will install also some other programming applications like g++, to compile C++ source codes.

4. RidgeRun SDK: In order to cross-compile and flash your applications and system images to the LeopardBoard DM365 you must have installed the SDK (see RidgeRun Evaluation SDK for Leopard Board DM365).

Running a "Hello LeopardBoard!" program

In order to get a first contact with the LeopardBoard DM365, this section will show you how to compile, flash and run a simple C program.

You can download the following file which contains all the source files you need to do the exercise: File:Beginning Development.zip

1. To start you must open a text editor (see the previous section) and write the following C code and name the file as for example main.c:

#include <stdio.h>

/*
*  This is the principal procedure
*/
int main (void)
{
   /*
   * Printing a message on the standart output
   */
   printf("\nHello LeopardBoard!\n");

   /*
   * Exiting the program with no error
   */
   return 0;
}

This code has been added also to the .zip file you downloaded before with the name main.c.

2. You must create a Config file and a Makefile. These files allow you to integrate your application to the SDK in order to cross-compile it. In the .zip file you will find these files configured.

If you don't know how to integrate your application or in this case the example application into the SDK that is, how to configure and create the build files (Makefile and Config file) and how to set up your application to be compiled, you can see How to add my application to the SDK and Integrating applications in the SDK.

3. Once you have added your application to the SDK you can compile it typing the following command

make fs

This command will compile only the file system directory in which you will find your application. If it is the first time you run a make command or you want to build all the SDK (kernel, bootloader, file system) you can type the following command

make

This command will run all the rules necessary to build all the system.

4. When you get your system ready to be flashed into the LeopardBoard DM365 you must connect your LeopardBoard to your computer (see First interaction with the board) and run the following command

make install

5. If the make install command ends without errors you have your LeopardBoard ready to start the system. You must access to the LeopardBoard through minicom (see First interaction with the board) and reset it (press the reset button on the board) and you will see all the bootloader, kernel and file system start up on your terminal (see Figure 20).

Figure 20. Minicom output when the LeopardBoard finishes to load the system.

Once you get this output you can press any key and the command line input will appear. There you can explore the LeopardBoard's file system. If you want to run your application you must go to /examples and run it as is shown below

cd examples/
./main

And you will see an output like the following

Figure 21. Application output.

Getting your Evaluation SDK

You can get you evaluation SDK binary from the following link Evaluation SDK

Running demos

How to install High Definition 720p IPCam DEMO

1. First Download the require files from Leopard downloading page link:

LeopardImagingDownloadCenter

 I.  uImage_ipnc_dm365 //Directly download from the web page
 II. ramdisk_ipnc_dm365. //To download this file you should use curl or wget command.
  • If you don't have wget or curl packages installed in your linux PC, do the following in your linux prompt:
~/Desktop $ sudo apt-get install curl
~/Desktop $ sudo apt-get  install wget
  • Download ramdisk_ipnc_dm365: There's two options, Choose one to your convenience.
~/Desktop $ wget https://www.leopardimaging.com/uploads/ramdisk_ipnc_dm365.gz
~/Desktop $ curl https://www.leopardimaging.com/uploads/ramdisk_ipnc_dm365.gz>ramdisk_ipnc_dm365.gz

2. Getting your Leopard and Demo Up.

  • Get connected to your Leopard via Termnet
~/Desktop $ termnet localhost <# number serial port>

or via Minicom: You can follow the First Interaction with the board section.

If you don't have termnet please install:

~/Desktop $ sudo apt-get install termnet
  • Set up u-boot environment. Plug in the LeopardBoard an run this uboot commands:
Leopard 365 :> setenv ipaddr <its_ip_addr (e.g 10.251.101.233)> // Give a free ip from your eth service
Leopard 365 :> setenv serverip <server_ip_addr (e.g. 10.251.101.60)> // This is the ip address from your host machine
Leopard 365 :> setenv bootcmd 'nand read 0x82000000 0x1000000 0xb00000;nboot 0x80700000 0 0x400000;bootm 0x80700000'
Leopard 365 :> setenv bootargs console=ttyS0,115200n8 root=/dev/ram0 rw initrd=0x82000000,11M mem=60M eth=02:00:10:00:00:06 ip=10.251.101.233:eth:on
Leopard 365 :> setenv autostart no

Note: Please adjust the ip setting in the bootargs accordingly.

3. Burn linux kernel and ramdisk (where the Demo is) images:

  • On your linux host machine, copy uImage & ramdisk.gz to your tftp server /tftpboot

If you don't have a tftp server installed in your linux host machine, follow the steps described in this link Setting_Up_A_Tftp_Service

  • Next you have to load the kernel image in RAM memory:
		
Leopard 365 :> tftpboot 82000000 uImage_ipnc_dm365
  • Once you have the kernel image loaded in RAM, we need to flash it to Nand memory because we are setting that every time you are going to boot the LeopardBoard the kernel will be load from Nand Memory to RAM:
	
Leopard 365 :> nand erase 400000 200000
Leopard 365 :> nand write 82000000 400000 200000
  • Next you have to load ramdisk image in RAM memory by typing:
	 	
Leopard 365 :>tftpboot 82000000 ramdisk_ipnc_dm365.gz
  • As same for the kernel image, flash it to NAND Memory:
			
Leopard 365 :> nand erase 1000000 b00000
Leopard 365 :> nand write 82000000 1000000 b00000

4. Run the Demo

  • Reset the board by press SW1, make sure ethernet is connected.
  • Connect the board to a PC running Windows, through an USB cable. "Removable Disk" will show up. Run usbconf.exe to check the ip settings. The following window will appear:
Figure 1. Window to check the Ip address of the cam.

This will show you which is the number of the ip address of the IPN camm

  • Unplug the USB cable
  • Run Internet Explorer from PC, access the cam by it's ip address
  • A registration windoww will appear. Use the following information:
 
user name : admin  
password: 9999
Figure 2. Registration window.


5. The following windows show the options that the DEMO brings once you access it:

Figure 3. Window that shows live video.
Figure 4. Window that takes a snapshot image.
Figure 5. Window that shows network settings.
Figure 6. Window to set date an time.
Figure 7. Window that shows Video file settings.