RB-Host Setup

Description:

Rugged BOARD consists architecture of ARM family and houses A5D2x ARM Cortex A5 (500MHZ) processor. It can be powered either through a micro-USB port or an external 5V power supply that is present as an optional arrangement.

Hardware Details:

Section-1 :Host setup Environment:

Required OS : Ubuntu

OS Version : 16.04 LTS (64 bit)

To install Ubuntu OS please follow the below link.

https://help.ubuntu.com/community/GraphicalInstall

After successful installation Let us start Work with Linux – Ubuntu OS Open up an application on your computer called “Terminal” by either pressing Control + Alt + T or by clicking the symbol at the top of the Ubuntu launcher and searching for “Terminal”.

It looks like this:

You can use the terminal to write commands to your computer (this is the “command line Interface of Linux Operating System”). Let’s try it out!

In terminal, type : $ ls

The ls command, shows for “list” of directory contents.

For further development work we will be using Ubuntu as a host system and will be referred as host, also create a work directory inside your home directory by typing the below command on your host terminal and use this directory to store all development related files.

$ mkdir work

$ cd work

Install Dependency Packages:

Ubuntu doesn’t come with all the prerequisite archives for development, to prepare the host for development, download the packages store in the file called elinux_pkg.sh script file.

:~/work/$ vim elinux_pkg.sh # copy and paste the below lines

sudo apt-get update

sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential

sudo apt-get install chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils

sudo apt-get install debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa

sudo apt-get install libsdl1.2-dev pylint3 xterm minicom

:~/work/$ sudo chmod 777 elinux_pkg.sh # excutive permissions to this script

:~/work/$ sh elinux_pkg.sh

Section-2: Power up Rugged Board:

List of Minimum Hardware components required:

  • ruggedBoard-A5D2x board.

  • USB to microUSB cable.

  • A PC with Linux Installed (ubuntu 16.04 LTS version)

  • Ethernet

Configure the Serial port connection:

Step 1: Connect the micro USB cable to PC and the board. Check if the light on the board glows up. If the LED is glowing on the board then proceed to test the serial Console on Linux Host.

To confirm USB device is detected, enter the following command

Host@ubuntu:~$ dmesg | tail

Look for ls /dev/ttyUSBx where x means the connected port number.

Example: If the device is connected in USB0, you will get message as /dev/ttyUSB0

Note: If you do not find /dev/ttyUSB0 Reconnect the cable and type the same command

Step 2: Install minicom Serial Monitor on your host PC

Host@ubuntu:~$ sudo apt-get install minicom

Step 3: Setting Serial Console (Minicom):

Host@ubuntu :~$ sudo minicom –s

Step 4: Select the option “Serial port setup” from menu on terminal and press 'Enter'.

For example: Serial device - /dev/ttyUSB0, first press ‘A’ the cursor blinks at the particular line then change the device name to /dev/ttyUSB0 and press ‘ENTER’

Note: Serial device name will vary based on your serial device. dev/ttyS0, if you are using Serial cable and /dev/ttyUSB0, if you are using USB to Serial converter.

After making all changes like baud rate "115200", hardware flow control "No" by pressing the keyword ‘F’ and Software flow contorl also “No” that are required press ‘ENTER’ to come out from the screen,

Simply follow the further screens from the menu listed and select “Save setup as default” by Press Enter key and Exit from the minicom setup process. It will take into ‘minicom’ the serial terminal.

Make sure that serial port configuration by cross check the below:

Press A, B, C, D, E, F, G to change configuration.

  1. Serial Device : /dev/ttyUSB0

  2. Lockfile Location : /dev/lock

  3. Callin Program :

  4. Callout Program :

  5. Bps/Par/Bits :115200 8N1

  6. Hardware Flow Control : No

  7. Software Flow Control : No

Finally, you will get Board Console after board boot-up

Note:

In this stage if the board does not show the boot-logs/Board terminal, then press “Enter key” or just restart the board by switching power "OFF" and "ON".

  • Rugged Board Terminal:

Section-3: Transferring Files from Host to Board

Configuring Services (TFTP, NFS)

Similar to the installation of additional packages, the file named "tftp-script.sh" given with the script directory and execute scripts with the help of “sh” command below

Step1: :~/work $ sh tftp-script.sh

Step 2: By running the above Command it creates a folder called tftpboot under /var/lib/ directory. The box highlighted in green shows that tftpboot folder has been created in /var/lib/ directory.

Note: The purpose of creating this tftpboot folder – it acts as a share folder between the host and the board.

$ cd /var/lib (In any directory you can give this command)

$ ls

Step 3: Connect an Ethernet cable to the board from the PC and type ifconfig on your Host terminal and note down your server address. Highlighted white text shows server address in my case (This is my PC’s Ip address) .

NOTE: Testing the access of test.txt file which is in tftpboot folder from the board

Step 4: Create a test file (Ex: test.txt) in work directory. Create a file named test.txt

:~/work $ touch test.txt (touch command is used for creating a file)

Step 5: Copy it to /var/lib/tftpboot

:~/work $ cp test.txt /var/lib/tftpboot

step 6: Test local host setup type below command :

$ tftp localhost

> get test.txt

Received 3219628 bytes in 0.3 seconds //Configured tftp successfull....

PC with Ethernet- Setup:

Step 7: $ sudo ifconfig eth0 192.168.1.12 up (pc ip configured)

RuggedBoard with Ethernet -Setup:

Step8: $ ifconfig eth0 192.168.1.11 up

Configure the gateway address for target:

$ route add default gw 192.168.1.1

Step 9 : Ping both side Host and Rugged Board by using command “ping ip”

Step 10: Switch to RugeedBoard terminal and type in

root@ruggedBoard-A5D2x:~# tftp -r test.txt -g pc-ip (For sending the test.txt file from your host terminal to your Rugged board, in this case the ip (192.168.1.12) address belongs to your PC terminal from where you want to transfer the file.)

Section-4: Export the Toolchain to Shell Path

Make use Cross compiler toolchain to compile the applications specific to arm Arch .

Step1: Extract the toolchain which is provided in workfolder

$ tar -xvf arm-cortex8-linux-gnueabihf.tar.bz2

Now write a script that export the target Architecture and toolchain prefix as below.

Step 2: $ vim env.sh # In this file, add the following lines

#!/bin/sh

export PATH=$PATH:/home/<user>/<path to toolchain bin>

export ARCH=arm

export CROSS_COMPILE=arm-cortexa8-linux-gnueabihf-

Save and exit from the editor. Execute the script by issuing : $ . env.sh

Section-5: Compiling User-application:

Note : Run the script “env.sh” ,make sure cross-toolchain enabled by check with command : arm-<press tab twise>

Step1: Write a helloworld.c program for ruggedBoard. Open file helloworld.c via command

$ gedit helloworld.c

Step2: Compile it with toolchain

$ arm-cortexa8-linux-gnueabihf-gcc helloworld.c -o helloworld

Step3: Transfer the file through tftp

On Host : $ cp helloworld /var/lib/tftpboot

On Target: $ tftp -r helloworld -g <serverip>

$ ./helloworld

Last updated

Was this helpful?