Rana-AM335x System Development User Manual PDF
Rana-AM335x System Development User Manual PDF
Product No
SOM PCB No
CB PCB No
Edition
: PCL-051/PBA-CD-03
: 1397.0
: 1404.0
: March 10, 2014
In this manual copyrighted products are not explicitly indicated. The absence of the
trademark () and copyright () symbols does not imply that a product is not protected.
Additionally, registered patents and trademarks are similarly not expressly indicated in this
manual.
The information in this document has been carefully checked and is believed to be entirely
reliable. However, PHYTEC Embedded Pvt. Ltd. assumes no responsibility for any
inaccuracies. PHYTEC Embedded Pvt. Ltd neither gives any guarantee nor accepts any
liability whatsoever for consequential damages resulting from the use of this manual or its
associated product. PHYTEC Embedded Pvt. Ltd reserves the right to alter the information
contained hereby without prior notification and accepts no responsibility for any damages
that might result.
Additionally, PHYTEC Embedded Pvt. Ltd offers no guarantee nor accepts any liability for
damages arising from the improper usage or improper installation of the hardware or
software. PHYTEC Embedded Pvt. Ltd further reserves the right to alter the layout and/or
design of the hardware without prior notification and accepts no liability for doing so.
Copyright 2014 PHYTEC Embedded Pvt. Ltd, Koramangala Bangalore INDIA.
Rights - including those of translation, reprint, broadcast, photomechanical or similar
reproduction and storage or processing in computer systems, in whole or in part - are
reserved. No reproduction may be made without the explicit written consent from PHYTEC
Embedded Pvt. Ltd.
EUROPE
PHYTEC Technologie
Holding AG
Robert-Koch-Str. 39
55129 Mainz
GERMANY
NORTH AMERICA
PHYTEC America
LLC 203 Parfitt Way
SW, Suite G100
Bainbridge Island, WA
98110 USA
Ordering
Information:
INDIA
Phytec Embedded Pvt.
Ltd #16/9C 3rd Floor
3rd Main 8th Block
Opp: Police Station
Koramangala
Bangalore-560095
+91-80-40867046
[email protected]
1 (800) 278-9913
[email protected]
Web Site:
http://www.phytec.in
http://www.phytec.de
http://www.phytec.com
Address:
Table of Contents:
1. Prepare Host Environment: ........................................................................................... 4
1.1 Configuring Services (TFTP, NFS) .......................................................................................... 4
1.1.1 Configuring TFTP .................................................................................................................................. 4
1.1.2 Configuring NFS Service ....................................................................................................................... 6
If the same file is received without any error from the tftp server then the tftp service is
configured correctly.
To transfer file through tftp between host and target follow steps listed below, configure
the IP address for host by selecting the option Network Connection and modify the related
option. The same can be done through command line interface by issuing the following
command
Host Side Setup :
$ ifconfig eth0 192.168.1.12 up
Note: This will be used as server IP address. Note that 192.168.1.12 is not mandatory you can
give any IP but IP for server and target should not be same
Targert Side Setup :
On Target side issue the command with a different IP as below
$ ifconfig eth0 192.168.1.11 up
Configure the gateway address for target
$ route add default gw 192.168.1.1
Check the default gateway by command
$ route
or
$ /sbin/route -n
Edit the /etc/exports file and add the below line at the end of the file, save and close it
/nfsroot *(rw, sync, no_subtree_check, no_root_squash)
$ sudo gedit /etc/exports
To restart the service with made changes issue the following commands on the terminal.
$ sudo exportfs ra
$ sudo /etc/init.d/nfs-kernel-server restart
Figure 2. 11
Figure 3.1
Using the options at left; make the setting as shown in the figure 3.2. For ex: Serial
device - /dev/ttsyS0, first press A the cursor blinks at the particular line then change the
device name to /dev/ttyS0 and press ENTER.
Note : The /dev/ttyS0 is not fixed it may vary depending upon the interface which You are
using for example if you are using usb to serial converter then the node will be /dev/ttyUSB*
Where * may be 0,1,...
Figure 3.2
After making all required changes, like baud rate -115200, hardware control flow No
etc. Press ENTER to come out from the screen, now the previous screen will appear.
Figure 3.3
Now select the Save setup as dfl it saves the setting as default.
Now select Exit
Figure 3.4
It will take into minicom the serial terminal.
10
Save and exit from the editor. Execute the script by issuing
$ . env.sh
Note: The Command is dot space env.sh. Execute the above command for every new shell
where you are trying to start compilation of Linux Kernel or Boot loader
Check whether the toolchain path is set or not by issuing below command
$ echo $PATH
Above command displays the entire paths that are added to Shell PATH variable
separated by colon :. See if your path is printed on the terminal. If you are not able to see
your toolchain path repeat the steps from the beginning of this section.
11
3 Flashing binaries:
Figure 3.5
Figure shows two methods. The first method used to provide all needed components to
run on the target itself. The Linux kernel image and the root file system image are persistent
in the media the target features. This means the only connection needed is the serial cable to
see what is happening on our target. This method is called standalone. This works after
writing image into NAND which is explained later in the Document.
The other method is to provide needed components via network. In this case the
development host is connected to the phyBOARD-RANA-AM335x with a serial cable and
via Ethernet. The embedded board boots into the bootloader, then issues a TFTP request on
the network and boots the kernel from the TFTP server on the host. Then, after
decompressing the kernel into the RAM and starting it, the kernel mounts its root file system
at phyBOARD-RANA-AM335x Board /root directory.
The latter one is especially for development purposes, as it provides a very quick
turnaround while testing the kernel and the root file system. Other methods like Micro SD
card and NAND have also been discussed.
12
On Target:
Insert the Micro SD card and make sure that the pins 3+4 of JP5 is shorted, Power On the
board, press m for barebox menu & select option 2 to boot from SD Card.
Remove the Micro SD card and make sure that JP5 is open, Power On the board, press m
13
If you want to do it manually then download the patches for phyBOARD-RANAAM335x from the public ftp from the link below. Apply the patches.
$wget ftp://ftp.phytec.de/pub/Products/India/phyBOARD-RANAAM335x/Linux/PD13.0.0/src/patches/barebox-2013.07.0/barebox/*
Apply the patches one by one using following command.
$ patch -p1 < <patch_file_name.patch>
14
If the compilation goes well you will find the files MLO and barebox.bin in the source
directory. If you experience any error act accordingly or post the errors at our forums you will
get help accordingly.
15
If the compilation goes well you will find the files zImage and uImage in arch/arm/boot
directory. If you experience any error act accordingly or post the errors at our forums you will
get help accordingly.
5 Compiling User-application:
Note: Refer section 1.4 Installing Toolchain before going ahead.
Make a helloworld program for target. Open file helloworld.c via command
$ gedit helloworld.c
Write a simple helloworld C program Compile it with toolchain
$ arm-cortexa8-linux-gnueabihf-gcc helloworld.c -o helloworld
Transfer it on target by tftp-server or USB or Micro SD card (Please make sure Micro SD
card is inserted properly, while booting form mmc).
Host Side:
TFTP
$ cp helloworld /val/lib/tftpboot/
SCP
$ scp helloworld root@<target ip>:~
Target Side:
TFTP
$ tftp -r helloworld -g <host_ip>
After the transfer is complete, you will be able to see your helloworld app in the current
directory.
$ ./helloworld <to run the application>
SCP
No need to do anything it will be there in home directory just run the application using below
command.
$ ./helloworld <to run the application>
16
Insert the USB pendrive to target and switch to minicom terminal. The USB pendrive
Will be detected & mounted in sdb :sdb1 .Use that following command to mount it.
$ mount /dev/sdb1 /mnt
$ cd /mnt
$ ./helloworld
$wget ftp://ftp.phytec.de/pub/Products/India/phyBOARD-RANAAM335x/Linux/PD13.0.0/buildsystems/ptxdist/ptxdist-2013.01.0.tar.bz2
17
18
19
Type m or exit in the barebox shell you will get a menu like this.
Here are a lot of options are provided to boot from different devices such as MMC,
NAND, TFTP. You can select any one to boot but if you want to modify the default
functionality on the expansion you have to go inside Setting option as shown in below
diagram.
20
As you had seen that in Settings a lot of options are there you can set the network
related things such as IP address in Network settings, etc. You can modify the default
Expansion functionality by changing the 3rd option Expansion settings as shown below.
By default we are providing support for LCD, SPI0, UART1, UART2, UART3, CAN0,
CAN1, 28 GPIOs. As it is mention a lot of options you can pass whatever you want on the
expansion just by passing:
expansion=<Functionality>
Eg. expansion=ALLGPIO (It will provide 70 gpios on the Expansion)
Next if you need Max GPIOs and 1 UART then you have to pass.
expansion=ALLGPIO,UART1
(It will provide 68 gpios and UART1 tx, UART1 rx on the Expansion)
Next if you need Max GPIOs, 1 UART and 1 CAN then you have to pass.
expansion=ALLGPIO,UART1,CAN0
(It will provide 66 GPIOs and UART1 Tx, UART1 Rx, CAN0 Tx, CAN0 Rx on the
Expansion)
21
While booting the kernel you can see the devices which you have selected.
As you had seen we had selected LCD, SPI0, UART1, UART2, UART3, CAN0, CAN1, 28
GPIOs so these devices has been initialised and are available on the expansion.
22
23
INDIA
PHYTEC Embedded Pvt.Ltd.
#16/9C, 3rd Floor, 3rd Main
8th Block, Opp. Police Station
Kormangala, Bangalore-560095
Tel.: +91-80-40867046-49
www.phytec.in
Germany
PHYTEC Messtechnik GmbH
Robert-Koch-Strae 39
D-55129 Mainz
Tel.: +49 6131 9221-32
Fax: +49 6131 9221-33
www.phytec.de
www.phytec.eu
America
PHYTEC America LLC
203 Parfitt Way SW, Suite G100
Bainbridge Island, WA 98110
Tel.: +1 206 780-9047
Fax: +1 206 780-9135
www.phytec.com
France
PHYTEC France SARL
17, place St. Etienne
F-72140 Sill le Guillaume
Tel.: +33 2 43 29 22 33
Fax: +33 2 43 29 22 34
www.phytec.fr
.................................We are looking forward to hear from you!..............................
24