Open main menu

DAVE Developer's Wiki β

Changes

Software Manual (Diva)

40 bytes removed, 15:44, 2 October 2014
m
no edit summary
* build system (on development host)
== Diva DIVA Embedded Linux Kit: what is it? ==
[[File:Divelk_01.png|500px]]
Diva DIVA Embedded Linux Kit (DIVELK for short) provides all the necessary components required to set up the developing environment to:
* build the bootloader (U-Boot)
* build and run Linux operating system on DivaDIVA-based systems
* build Linux applications that will run on the target.
The kit is composed of:
* hardware platform composed by Diva DIVA system-on-module (SOM for short) and carrier board. Supported carrier boards are:** DivaEVBDIVAEVB-Lite standalone** DivaEVBDIVAEVB-Lite plugged on Dacu carrier board
* U-Boot bootloader sources
* Linux kernel sources
* Technical documentation such hardware manuals, mechanical drawings, reference schematics, application notes etc.
The documents related to the software issues help the user to quickly start configuring the bootloader and the operating system, by hiding most of the complexity of the underlying hardware. For more details about Diva DIVA hardware characteristics, please refer to the Diva DIVA Hardware Manual. An account for the reserved area of [http://www.dave.eu DAVE's website] is required to access the kit contents.
== Diva DIVA Embedded Linux Kit: what is not? ==
The kit is neither a complete Linux programming guide nor a Linux Reference Guide. Internet provides lots of information, tutorials and examples about writing applications and drivers for this operating system and how to work with it from the user's point of view (for example, type “Linux programming” in your favorite search engine). As the kit is heavily based on open-source community-maintained software projects, DIVELK does not provide exhaustive documentation for these software components but it points out where to find the information on the Internet or books. For example, for the U-Boot bootloader, the kit does not list all the commands it handles but provides the link to the on-line documentation and to the public mailing list used by its community.
== About this manual ==
This document describes how to run Linux on the DivaDIVA/DivaEVBDIVAEVB-Lite/Carrier-board system and how to work with '''DIVELK version 2.0.0'''. For novice users who have no experience at all about embedded Linux systems, reading of [http://shop.oreilly.com/product/9780596002220.do Building Embedded Linux Systems By Karim Yaghmour] is strongly recommended. Practically speaking, the book covers all matters involved in developing software for such systems (from tool-chain organization to the most famous file systems running on top of MTD). It is not a reference guide, but it provides a complete and exhaustive overview that helps the developer save a lot of time in searching for such information on the Internet. For a brief but still exhaustive overview of the Linux and Embedded Linux world, please look at the Training and Docs sections of [http://free-electrons.com Free Electrons website].
== Support service ==
== Components ==
=== Diva DIVA SOM ===
[[File:Diva-400.png|300px]]
The heart of Diva DIVA SOM is Texas Instruments "Sitara" [http://www.ti.com/lsds/ti/arm/sitara_arm_cortex_a_processor/sitara_arm_cortex_a8/am335x_arm_cortex_a8/products.page?paramCriteria=no AM335x microprocessors]. From a software point of view, Texas Instruments supports this processor family through so-called Linux EZ Software Development Kit (EZSDK for short). EZSDK releases are published on a regular basis. For more details please refer to:
* http://www.ti.com/tool/linuxezsdk-sitara
* http://processors.wiki.ti.com/index.php/Category:EZSDK
Diva DIVA Embedded Linux Kit, in turn, is directly derived from EZSDK. Hence DIVELK documentation often refers to EZSDK resources.
=== Carrier boards ===
==== DivaEVBDIVAEVB-Lite ====
DivaEVBDIVAEVB-Lite is an adapter board designed to evaluate the functions of Diva DIVA system-on-module.
[[File:Diva-evb-with-som.png|300px]]
For further information on the DivaEVBDIVAEVB-Lite, please refer to [[DivaEVB-Lite]]
The following figure shows the carrier board block diagram:
==== Dacu ====
DivaEVBDIVAEVB-Lite can be plugged on the Dacu carrier board to extend the set of available interfaces.
[[File:Diva divaevb dacu.png|450px]]
# the root file system – this file system is mounted (which means "made available", "attached") by the kernel during the boot process on the root directory (“/”).
The typical developing environment for an Embedded Linux system is composed of a host machine and a target machine. The host is used by the developer to compile the code that will run on the target. In our case the target is obviously the Diva DIVA module, while the host is assumed to be a PC running the Linux operating system. The Linux kernel running on the target can mount the root file system from different physical media. During the software development, we strongly recommend using a directory exported via NFS by the host for this purpose (see the example configuration called [[Booting_Linux_Kernel#Configuration_net_nfs | net_nfs]]).
Please note that DIVELK u-boot and kernel source trees are derived from the official trees released by TI; these trees have been customized to add support for the Diva DIVA SOM.
For further information on EZSDK, please refer to [http://processors.wiki.ti.com/index.php/Sitara_SDK_5.06.00_Release_Notes Sitara SDK release notes].
==== DIVELK software components ====
'''DAVE Embedded Systems''' adds to the latest EZSDK from Texas Instruments the customization required to support the Diva DIVA platform. For this reason most of the documentation provided by TI remains valid for the DIVELK development kit. However, some customization is required, in particular at bootloader and linux kernel levels.
The following table shows how DIVELK releases are related to EZSDK releases.
* Status: Work in progress
* EZSDK version: 07.00.00.00
* Supported carrier boards: DivaEVBDIVAEVB-Lite, Dacu
==== Notes ====
* Status: released
* EZSDK version: 05.06.00.00
* Supported carrier boards: DivaEVBDIVAEVB-Lite, Dacu
==== Notes ====
[[File:Development env.png]]
The typical developing environment for an Embedded Linux system is composed of a host machine and a target machine. The host is used by the developer to (cross-)compile the code that is to run on the target. In our case the target is the Diva DIVA CPU module, while the host is assumed to be a PC running the Linux operating system, either in a physical installation or as a virtual machine. The bootloader running on the target can download the Linux kernel image through the network ([http://en.wikipedia.org/wiki/Trivial_File_Transfer_Protocol TFTP]), as well as the u-boot binary images (useful when an update of the bootloader is required). Moreover, the Linux kernel running on the target is able to mount the root file system from different physical media, for example from a directory exported via [http://en.wikipedia.org/wiki/Network_File_System Network File System (NFS)] by the host. This strategy (kernel image and RFS retrieved from the network) saves time during the development phase, since no flash reprogramming or removable storage (SD, usb pen drives, external disks) is required to test new versions or updates of the software components.
== Software components ==
* DIVELK root file system partition (mmcblk0p2, ext3)
DIVELK contains all the required software and documentation to start developing Linux application on the Diva DIVA platform. In particular, DIVELK provides a Virtualbox virtual machine with two emulated disks:
* Boot disk with pre-installed Ubuntu Linux 12.04.2 LTS and pre-configured basic Linux services (TFTP, NFS, ...)
==== Pre-built toolchain ====
To start developing software for the Diva DIVA platform, users need a proper toolchain, which can be pre-built or built-from-scratch. Building a toolchain from scratch is not a trivial task (though using a recent build system is easier than in the past), so the recommended approach consists in using a pre-built toolchain.
DIVELK provides the arago-2012.10 toolchain (GCC version is 4.5.3).
For more information on the Linux filesystem, please refer to [http://www.freeos.com/articles/3102/ The Linux filesystem explained]
DIVELK provides a pre-built root file system, that can be used during the evaluation/development phase, since it provides a rich set of packages for working with the Diva DIVA platform. However, there are other pre-built file systems that can be used:
* Arago (http://arago-project.org/files/releases/)
=== Initializing the build environment ===
In the DIVELK, we have simplified the Yocto initialization phase, relying on the repo tool and on a Diva DIVA bsp git repository, so that the initialization can be completed with a few commands as reported below:
<pre>
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > repo
=== Build/configure Linux kernel ===
Enter the Linux sources directory (''~/diva/divelk/linux-am33x.git'') and run the following commands:
<pre>
dvdk@dvdk-vm:~/diva/divelk/linux-am33x.git$ make diva_defconfigdvdk@dvdk-vm:~/diva/divelk/linux-am33x.git$ make uImage
</pre>
The former command selects the default Diva DIVA configuration, while the latter builds the kernel binary image with the required u-boot header.
Default linux kernel configuration can be changed by using the standard ''menuconfig'', ''xconfig'', ''gconfig'' make target.
<pre>
dvdk@dvdk-vm:~/diva/divelk/linux-am33x.git$ sudo cp arch/arm/boot/uImage /srv/tftp/divelk/
</pre>
=== Build/configure U-Boot only ===
Enter the U-Boot sources directory (''~/diva/divelk/u-boot-am33x.git'') and run the following commands:
<pre>
dvdk@dvdk-vm:~/diva/divelk/u-boot-am33x.git$ make diva_spibootdvdk@dvdk-vm:~/diva/divelk/u-boot-am33x.git$ make
</pre>
The former command selects the default Diva DIVA configuration which is used to boot from SPI NOR Flash, while the latter builds the u-boot binary images.
Subsequent builds just require ''make'' command, without targets, to update the binary images.
<pre>
dvdk@dvdk-vm:~/diva/divelk/linux-am33x.git$ sudo cp MLO u-boot.img /srv/tftp/divelk/
</pre>
$ arm-none-linux-gnueabi-gcc -o hello hello.c
</pre>
Copy the executable file to the root file system, and execute it from the Diva DIVA system:
<pre>
root@diva:~#./hello
== Quick start ==
=== DivaEVBDIVAEVB-Lite plugged on Dacu ===
This section describes how to quick start a Diva DIVA system composed of a Diva DIVA SOM plugged into the DivaEVBDIVAEVB-Lite and then mounted on the Dacu carrier board, provided that it is programmed according to DIVELK configuration. The SD provided with the DIVELK can be used to boot the system, since it contains a bootable partition (mmcblk0p1) and a root file system partition (mmcblk0p2).
# connect the serial cable, provided with the board, to the J25 pin-strip connector on the Dacu board
#* stop bits: 1
#* parity: none
# (optional) to connect the system to Ethernet LAN, please plug cable on connector J7 of the DivaEVBDIVAEVB-Lite
The system is configured to boot automatically, when powered up, from the SD card, loading u-boot which runs the<code>mmcboot</code> macro, that loads the kernel and launches it with the options for mounting the root file system from the mmcblk0p2 partition.
=== DivaEVBDIVAEVB-Lite standalone ===
This section describes how to quick start a DivaEVBDIVAEVB-Lite system, provided that it is programmed according to DIVELK configuration.
# connect the serial cable, provided with the board, to J6
= DIVELK use cases =
== Diva DIVA Frequency Scaling ==
The frequency of the CPU can be changed on the run using the Cpufreq framework (please refer to the documentation included into the linux-am33x/Documentation/cpu-freq directory of the kernel source tree). The cpufreq framework works in conjunction with the related driver & governor.
Cpufreq implementation controls the Linux OPP (Operating Performance Points) adjusting the Cortex-A8 core voltages and frequencies. CPUFreq is enabled by default in the Diva DIVA kernel configuration.
To view the available governors: