{{WarningMessage|text=The following information are valid for <b>DIVELK</b> version up to release <b>2.2.0</b>}}
= Introduction =
* 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 byof:* 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 systemand how to work with '''DIVELK version 2.0.0''' and above. 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 ==
We are committed to making our products user-friendly and will help customers use our CPU modules in their systems. Technical support is delivered through email. Support requests can be sent to [mailto:support-divahelpdesk@dave.eu support-divahelpdesk@dave.eu]. Software upgrades are available in the restricted download area of '''DAVE web siteEmbedded Systems''' git server: http://www<code>git@git.dave.eu</reserved-area. code> An account is required to access this area (please contact [mailto:support-divahelpdesk@dave.eu support-divahelpdesk@dave.eu] for account requests).
Please refer to our Web site at http://www.dave.eu/dave-cpu-module-am335x-diva.html for the latest product documents, utilities, drivers, Product Change Notices, Board Support Packages, Application Notes, mechanical drawings and additional tools and software.
== 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 AM Software Development Kit (EZSDK AMSDK for short). EZSDK AMSDK releases are published on a regular basis. For more details please refer to:
Diva DIVA Embedded Linux Kit, in turn, is directly derived from EZSDKAMSDK. Hence DIVELK documentation often refers to EZSDK AMSDK 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 [[Prodotti_-_Dave_-_Diva_(DDx)_-_doc_-_Software_ManualBooting_Linux_Kernel#Net_nfs Configuration_net_nfs | net_nfs]]).
==== Please note that DIVELK software components ====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 SOM.
Dave adds For further information on AMSDK, please refer to the latest EZSDK from Texas Instruments the customization required to support the Diva platform[http://processors.wiki.ti.com/index.php/Sitara_SDK_5. For this reason most of the documentation provided by TI remains valid for the DIVELK development kit06. However, some customization is required, in particular at bootloader and linux kernel levels00_Release_Notes Sitara SDK release notes].
The following table shows how NELK releases are related to EZSDK releases.
{| class="wikitable"
!
!colspan="1" | DIVELK version
|-
|Release number
|1.0.0
|-
|Status
|Planned
|-
|Release date
|May 2013
|-
|'''Release notes'''
|[[Software_Manual_(Diva)#DIVELK_1.0.0 | Ver 1.0.0]]
|-
|SOM PCB version
|CS133012A
|-
|Supported carrier boards
|[[DivaEVB-Lite]]<br>[[:Category:Dacu | Dacu]]
|-
|U-Boot version
|2012.10-delk-1.0.0
|-
|Linux version
|3.2.0-delk-1.0.0
|-
|Drivers
|SPI NOR Flash (boot)<br>NAND 8 bit (boot)<br>UART0 (2-wire)<br>USB Host<br>SD/MMC1<br>GPIO<br>LCD<br>Touch screen controller<br>EMAC0 RMII (Fast Ethernet)<br>PMIC RTC (battery powered)<br>
Audio (ALSA)
|-
|TI EZSDK
|05.06.00.00
|}
==== DIVELK contains all the required software and documentation to start developing Linux application on the Diva platform. In particular, DIVELK provides a Virtualbox virtual machine with two emulated disks:components ====
* Boot disk with pre-installed Ubuntu Linux 12'''DAVE Embedded Systems''' adds to the latest AMSDK from Texas Instruments the customization required to support the DIVA platform.04For this reason most of the documentation provided by TI remains valid for the DIVELK development kit.2 LTS and pre-configured basic Linux services (TftpHowever, NFSsome customization is required, ...) * Secondary disk containing source code in particular at bootloader and tools:** Bootloader (u-boot) source tree cloned from DAVE's public git repository ** Linux linux kernel source tree cloned from DAVE's public git repository** Pre-installed AM335x EZSDK with setup scripts, makefiles, example applications, ..levels.** Toolchain
[[Diva_Embedded_Linux_Kit_(DIVELK)#DIVELK_software_components | Please note that refer to this table how DIVELK u-boot and kernel source trees releases are derived from the official trees released by TI; these trees have been customized related to add support for the 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 notesAMSDK releases]].
=== DIVELK Updates ===
{{ImportantMessage|text=It's recommended to use the latest available DIVELK version. Customer who want to update to the latest DIVELK release can send an email to [mailto:support-diva@dave.eu support-diva@dave.eu]. Please refer to [[Software_Manual_(Diva)#Release notes | Release notes]] for further information.}}
==== Updating git repositories ====
In DIVELK, the following source trees are clones of '''DAVEEmbedded Systems'''s public git repositories:
{| class="wikitable"
|Linux
|git@git.dave.eu:dave/diva/linux-am33x.git
|/home/dvdk/delkdivelk/linux-am33x.git
|-
|U-Boot
|git@git.dave.eu:dave/diva/u-boot-am33x.git
|/home/dvdk/delkdivelk/u-boot-am33x.git|-|Yocto BSP|git@git.dave.eu:dave/diva/diva-bsp.git|Please refer to [[Software_Manual_(Diva)#Building the software components with Yocto | Building the software components with Yocto]]
|-
|}
This means that these components can be kept in sync and up to date with '''DAVEEmbedded Systems'''s repositories.
==== RSA key generation ====
* start a shell session
* enter the .ssh subdirectory into your home directory: <code>cd ~/.ssh/</code>
* launch the following command: <br><pre>ssh-keygen -t rsa -C "username@myhost.com"-f username@myhost.com</pre>
* this command creates the files <code>~/.ssh/username@myhost.com</code> ('''private key''') and <code>~/.ssh/username@myhost.com.pub</code> ('''public key''')
* edit your <code>~/.ssh/config</code> adding the following lines:
with the request for the creation of a new public git account associated to your username. The support team will enable the account and send you a confirmation as soon as possible.
==== Synchronizing the repository ====
<pre class="workstation-terminal">
dvdk@dvdk-vm:~$ cd /home/dvdk/delkdivelk/linux-am33x.git/dvdk@dvdk-vm:/home/dvdk/delkdivelk/linux-am33x.git$ git fetch origin
</pre>
== Release notes ==Please note that <code>git fetch</code> doesn't merge the commits on the current branch. To do that, you should run
* Release date: May 2013* Status: planned* EZSDK version: 05or replace the ''fetch-merge'' process with a single <code>git pull</code> command.06Please note that the recommended method is the ''fetch-merge'' process.00.00* Supported carrier boardsFor further information on Git, please refer to [http: DivaEVB//git-Lite, Dacuscm.com/documentation Git Documentation].
==== Notes ==Release notes ==
* First official releasePlease refer to [https://wiki.dave.eu/index.php/Diva_Embedded_Linux_Kit_(DIVELK)#Release_notes this page] for DIVELK Release Notes
= Developing environment =
[[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 tftpTFTP]), 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 ==
For further information on Linux for TI processors, please refer to http://processors.wiki.ti.com/index.php/Category:Linux
==== Linux Device Tree ====
The Flattened Device Tree (FDT) is a data structure for describing the hardware in a system (for further information, please refer to http://elinux.org/Device_Tree). Device tree source code is stored into the arch/arm/boot/dts/ directory.
=== Target root file system ===
The Linux kernel running on the target needs to mount a root file system. Building a root file system from scratch is definitively a complex task because several well known directories must be created and populated with a lot of files that must follow some standard rules. Again we will use pre-packaged root file systems that make this task much easier.
=== Yocto ===
The Yocto Project, hosted by the Linux Foundation, provides open source, high-quality infrastructure and tools to help developers create their own custom Linux distributions for any hardware architecture and across multiple market segments. The Yocto Project is intended to simplify the work of the developers, providing a set of tools and components, including a highly configurable build system, that enables users to construct their own custom distributions, targeted for specific embedded devices. It is not, itself, a Linux distribution. Rather, it is capable of producing an image for a particular embedded device without dictating the composition of the Linux distribution actually built or the hardware architecture used. The software components for the DIVA platform can be built using Yocto and the source trees released with the DIVELK 2.0.0.
=== DVDK ===
Dave '''DAVE Embedded Systems''' Virtual Development Kit is a virtual machine, based on Oracle VirtualBox that allows developers to start using Dave's ''DAVE Embedded Systems'''' platform without wasting time in installing the development environment. The Virtual Machine comes with all the development tools and source code, pre-configured, and requires only a minimal setup by the end user (usually only to adapt network interface to the user environment).
DVDK can also be converted, easily, into a physical environment, for example to increase speed on slower machines.
Please refer to [http://wiki.dave.eu/index.php/Category:DVDK DVDK page on Dave '''DAVE Embedded Systems''' Developer's Wiki] for further information on DVDK.
== Build system DVDK installation ==
=== Introduction DVDK features ===
* VirtualBox virtual machine (.OVA archive)* Based on Lubuntu 12.04 LTS (64-bit version)* Pre-installed VirtualBox Guest Additions* LXDE desktop environment* Boot disk with the distro and pre-configured basic Linux services:** TFTP: with base directory /srv/tftp/ (please refer to [[VirtualBox_Network_Configuration]])** NFS: configured through the /etc/exports file (please refer to [[VirtualBox_Network_Configuration]])* Secondary disk containing source code and tools:** Bootloader (u-boot) source tree cloned from DAVE Embedded Systems public git repository ** Linux kernel source tree cloned from DAVE Embedded Systems public git repository** External pre-built toolchain** Yocto bsp for DIVA* Pre-installed Yocto-based root file systems with setup scripts, makefiles, example applications, ...* Administrator account (dvdk) with autologin. Please note that the user account credentials are provided with the development kit (you can find them into the README file contained in the sw/dvdk folder of the kit distribution) === DIVELK microSD Layout === The microSD provided with DIVELK is used to store:* A bootable partition (mmcblk0p1, vfat) containing:** binary images (MLO, u-boot and kernel images)** DIVELK documentation** DIVELK DVDK virtual machine image* DIVELK root file system partition (mmcblk0p2, ext3) DIVELK contains all the required software and documentation to start developing Linux application on the DIVA platform. === Importing the Virtual Machine === DIVELK provides a virtual machine image as a .ova file, which is a virtual application exported in Open Virtualization Format (OVF). Please find below the instructions for creating the Virtualbox virtual machine: # Start the Oracle VM VirtualBox Manager <br><br>[[File: Screenshot-Oracle VM VirtualBox Manager.png|600px]]<br><br># Click on File and select "Import Virtual Application", then click on "Open Virtual Application": <br><br>[[File: import-ova-01.png|600px]]<br><br># Navigate your file system and select the .ova file provided with the DIVELK: <br><br>[[File: import-ova-01b.png|600px]]<br><br># Click "Next" and on the next window click on "Import" <br><br>[[File: import-ova-02.png|600px]]<br><br> === Launching the Virtual Machine ===# Now that the virtual machine is ready, launch it by clicking on the start icon: <br><br>[[File:Divelk-dvdk-configuration.png|600px]]<br><br># VirtualBox will open three message windows like the following, you can click "Ok" to close them<br><br>[[File:VirtualBox Info.png]]<br><br># When the boot process is completed, you can login into the Ubuntu system with the credentials provided with the development kit (you can find them into the '''README''' file contained in the '''dvdk''' folder of the kit distribution)# Mount the sdk disk launching the sdk-mount.sh script contained into /home/dvdk directory as shown on the image below:<br><br>[[File:divelk-dvdk-sdk-mount.png|600px]]<br><br> <pre>dvdk@dvdk:~$ sh sdk-mount.sh divelk[sudo] password for dvdk: dvdk@dvdk:~$</pre> ==== Guest Additions Update ==== Once logged in, the system could suggest to update the [http://www.virtualbox.org/manual/ch04.html Virtualbox Guest Additions package]. You can follow the on-screen instructions to easily install the updated package. ==== Further steps ==== # Check if your keyboard layout matches the Ubuntu keyboard settings. You can change the keyboard layout selecting System->Preferences->Keyboard from the top panel menù.# Configure the Virtual Machine network interface: [[VirtualBox_Network_Configuration]]# Start working with the development kit == Working with DIVELK == === The build system === A build system is a set of source trees, Makefiles, patches, configuration files, tools and scripts that makes it easy to generate all the components of a complete embedded Linux system. A build system, once properly set up, automates the configuration and cross-compilation processes, generating all the required targets (userspace packages (libraries, programs), the kernel, the bootloader and root filesystem images) depending on the configuration. Some well known build systems are the following:
The Texas Instruments Arago distribution (http://arago-project.org/wiki/index.php/Main_Page) and therefore DIVELK 2.0.0 are based on Yocto.
=== Overview of the installed components ===
Once the virtual machine is ready, the actual development kit can be found into the directory <code>/home/dvdk/divelk</code>: <br><br>[[File:Divelk-dvdk-divelk-content.png|600px]]<br><br>
The divelk directory contains the following subdirectories:
* yocto: the Yocto SDK installation directory (containing the cross-toolchain)
* linux-am33x: the Linux source tree
* u-boot-am33x: the U-Boot source tree
* diva-bsp: the Yocto BSP for DIVA
* rfs: DIVELK provides three root file systems:
** diva-base: minimal root file system with basic packages (/home/dvdk/divelk/rfs/diva-base)
** diva-matrix: full root file system with lots of packages and demo applications, useful during the development phase (/home/dvdk/divelk/rfs/diva-matrix)
** diva-qt5: root file system with Qt5 libraries and examples (/home/dvdk/divelk/rfs/diva-qt5)
* env.sh: a bash script containing the following lines:
Using the following command, the environment shell variables required during the building procedure are set up:
<pre>
source ~/divelk/env.sh
</pre>
=== Setting up the server environment ===
==== TFTP Server ====
One of the most useful features of a bootloader during development is the capability to download the Linux kernel from the network. This saves a lot of time because developer doesn't have to program the image in flash every time he/she modifies it. U-Boot implements the TFTP protocol (see the <code>tftp </code> command), so the host system must be configured to enable the TFTP service. Installation and configuration of a TFTP server depends on the host Linux distribution.
The default DVDK <code>tftp</code> installation has <code>/srv/tftp</code> as work directory. It is recommended to create a A subdirectory dedicated to the image files created with associated to the DIVELK(/srv/tftp/divelk) is available, but developers can add their custom subdirectories when required.
==== NFS Server ====
One of the most important components of a Linux system is the root file system. A good development root file system provides the developer with all the useful tools that can help him/her on his/her work. Such a root file system can become very big in size, so it's hard to store it in flash memory. User could split the file system in different parts, mounting them from different media (flash, network, usb...). But the most convenient thing is to mount the whole root file system from the network, allowing the host system and the target to share the same files. In this way, the developer can quickly modify the root file system, even “on the fly” (meaning that the file system can be modified while the system is running).
The most common way to setup a system like the one described is through NFS. As for TFTP, installation and configuration depends on the host Linux distribution.
One of the most important components of a Linux system is the root file system. A good development root file system provides the developer with all the useful tools that can help developers on their work. Such a root file system can become very big in size, so it's hard to store it in flash memory. User could split the file system in different parts, mounting them from different media (flash, network, usb...). But the most convenient thing is to mount the whole root file system from the network, allowing the host system and the target to share the same files. In this way, developers can quickly modify the root file system, even “on the fly” (meaning that the file system can be modified while the system is running). The most common way to setup a system like the one described is through NFS (Network File System). As for TFTP, installation and configuration depends on the host Linux distribution. The default DVDK nfs NFS installation is configured for sharing <code>/home/dvdk/divelk</code> directory and all the subdirectories. We recommend reading the [[VirtualBox_Network_Configuration]] page for additional details on the DVDK networking configuration and on how to enable 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 verion is 4.5.3).
DIVELK provides the Linaro gnueabihf-4.7-2013.03 toolchain (GCC version is 4.7.3).
==== Pre-built root file system ====
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 systemsystems, that can be used during the evaluation/development phase, since it provides a rich set of they contains the software packages for working with the Diva DIVA platform. However, there are other pre-built file systems that can be used:
* Arago (httpDIVELK root file systems are built with the Yocto build system and are stored into the following directories://arago-project.org/files/releases/)* Angstrom/Narcissus (http://www.angstrom-distribution.org/narcissus/)* Beaglebone (http://www.angstrom-distribution.org/demo/beaglebone/)
DIVELK root file systems are stored into the following directories:* /home/dvdk/divelk/rfs/diva-base* /home/dvdk/delkdivelk/rfs/aragodiva-basematrix* /home/dvdk/delkdivelk/rfs/tisdkdiva-qt5
== Working Building the software components with DIVELK Yocto ==The build process creates an entire Linux distribution from source. The build process can be summarized as follows:* Make sure that all the prerequisites are met* Initialize the build environment, as described in the following sections* Optionally ensure the conf/local.conf configuration file, which is found in the Build Directory, is set up how you want it. This file defines many aspects of the build environment including the target machine architecture through the MACHINE variable, the development machine's processor use through the BB_NUMBER_THREADS and PARALLEL_MAKE variables, and a centralized tarball download directory through the DL_DIR variable.* Build the image using the bitbake command. If you want information on BitBake, see the BitBake User Manual.N.B. Since the DIVELK virtual machine is already configured to match all the requirements for using the Yocto build system, developers who wants to quickly build a Yocto image can directly go to section [[Software_Manual_(Diva)#Building the Yocto image]].
=== Creating the Virtual Machine Prerequisites ===
The following prerequisites are required and only need to be done once. Please note that the DIVELK provides a virtual machine image as a .ova file, which is a virtual application exported in Open Virtualization Format (OVF). Please find below already configured to match all the instructions requirements for creating using the Virtualbox virtual Yocto build system.Some generic development tools are required on the host Linux machine:* git* curl* build-essential* diffstat* texinfo* gawk* chrpath* ia32-libs (if the host machine is running a 64-bit OS)* python-m2crypto
# Start These packages can be installed with the Oracle VM VirtualBox Manager <br><br>[[Filefollowing command: Screenshot-Oracle VM VirtualBox Manager.png|600px]]<br><brpre># Click on File and select "Import Virtual Application", then click on "Open Virtual Application": <br><br>[[File: importsudo apt-ovaget install git curl build-01.png|600px]]<br><br># Navigate your file system and select the .ova file provided with the DIVELK: <br><br>[[File: importessential diffstat texinfo gawk chrpath ia32-ovalibs python-01b.png|600px]]<br><br>m2crypto# Click "Next" and on the next window click on "Import" <br><br>[[File: import-ova-02.png|600px]]<br><br/pre>
=== Launching the VM ===# Now that the virtual machine It is ready, launch it by clicking on the start icon: <br><br>[[File:Divelk-dvdk-configuration.png|600px]]<br><br># VirtualBox will open three message windows like the following, you can click "Ok" also recommended to close them<br><br>[[File:VirtualBox Info.png]]<br><br># When the boot process is completed, you can login into switch the system shell from Ubuntu system with the credentials provided with the development kit (you can find them into the '''README''' file contained in the '''dvdk''' folder of the kit distribution)# Mount the sdk disk launching the sdk-mount.sh script contained into /home/dvdk directory as shown on the image below:<br><br>[[Files standard dash to more universal bash:divelk-dvdk-sdk-mount.png|600px]]<br><br># After launching the VM for the first time, create the tftp directory for DIVELK contents:<br><pre>$ sudo mkdir /srv/tftp/divelkdpkg-reconfigure dash</pre><br>
==== Guest Additions Update =Initializing the build environment ===
Once logged inIn the DIVELK, we have simplified the Yocto initialization phase, relying on the system could suggest to update repo tool and on a DIVA bsp git repository, so that the [initialization can be completed with a few commands as reported below:<pre>$ curl http://wwwcommondatastorage.virtualboxgoogleapis.orgcom/git-repo-downloads/manualrepo > repo$ chmod +x repo$ ./ch04repo init -u git@git.html Virtualbox Guest Additions package]dave.eu:dave/diva/diva-bsp. You can follow the ongit -screen instructions to easily install the updated packageb diva$ ./repo sync</pre>
==== Further steps =Building the Yocto image ===
# Check if your keyboard layout matches Please note that even building the Ubuntu keyboard settings. You can change basic root file system requires a few hours to complete the keyboard layout selecting Systemprocess on a mid-hi range desktop PC (4->Preferences6 cores, 8->Keyboard 12 GiB RAM), also depending on the Internet connection speed (all source are fetched from the top panel menùnetwork). Nearly 20GiB of disk space is required for the build. Moreover, building inside the DVDK adds some overhead, since the performances of a virtual machine are reduced if compared to the physical hardware.# Configure Thus, it's recommended to check the hardware capabilities of the Virtual Machine network interface: [[VirtualBox_Network_Configuration]]# Start working host system and, when building with Yocto is required, developers should consider the development kit=== DIVELK HowTos ===following options:
Once * migrating the virtual build system to a physical machine is ready* assuming that the host system has the required resources, extending the actual development kit can be found into hardware capabilities of the directory <code>/home/dvdk/delk</code>: <br><br>[[Filedefault DVDK (eg:Divelk-dvdk-divelk-content.png|600px]]<br><br>adding more cores and disk space)
The delk directory contains Once completed the following subdirectories:* arago-2012.10: initialization phase, developers can launch the cross-toolchain. GNU Compiler Collection (GCC) version is 4.5.3* linux-am33x: the Linux source tree* u-boot-am33x: the U-Boot source tree* rfs: DIVELK provides two root file systems:** arago-base: minimal root file system Yocto image build process with basic packages (/home/dvdk/delk/rfs/arago-base)** tisdk: full root file system with lots of packages, useful during the development phase (/home/dvdk/delk/rfs/tisdk)* env.sh: a bash script containing the following linescommands:
By issuing the following command, some environment shell variables required during the building procedure Please note that three different images are set upavailable:
<pre>* matrix-rootfs-image (includes the matrix gui application from Texas Instruments)source ~/diva/env* qt5-rootfs-image (root file system with Qt 5.sh1.1 libraries and examples)</pre>* base-rootfs-image (minimal root file system)
The resulting files (kernel, device tree and u-boot binaries, plus root file system in a .tar.gz archive) will then be available inside the build/tmp/deploy/images/diva directory.
==== Build a custom application ==4.4 Building the software components outside Yocto ==
This section will be completed in a future release of this manual.=== Build/configure Linux kernel ===
==== Build/configure Linux kernel ==== Enter the Linux sources directory (''~/diva/delkdivelk/linux-am33x.git'') and run the following commands:
<pre>
dvdk@dvdk-vm:~/diva/delkdivelk/linux-am33x.git$ make diva_defconfigdvdk@dvdk-vm:~/diva/delkdivelk/linux-am33x.git$ make uImageam335x-divelk.dtb
</pre>
The former command select selects the default Diva DIVA configuration, while the latter builds the kernel binary image with the required u-boot headerand the dtb binary.
Default linux kernel configuration can be changed by using the standard ''menuconfig'', ''xconfig'', ''gconfig'' make target.
Subsequent builds just require ''uImage'' make target to update the binary image.
Once the build process is complete, the kernel binary image is stored into the <code>arch/arm/boot/uImage</code> file, while the dtb is stored into the <code>linux-am33x/arch/arm/boot/dts/am335x-divelk. This dtb</code> file . These files can be copied to the <code>/srv/tftp/divelk/</code> directory with the following commandcommands:
Enter the Linux U-Boot sources directory (''~/diva/delkdivelk/u-boot-am33x.git'') and run the following commands:
<pre>
dvdk@dvdk-vm:~/diva/delkdivelk/u-boot-am33x.git$ make diva_spibootdvdk@dvdk-vm:~/diva/delkdivelk/u-boot-am33x.git$ make
</pre>
The former command select selects the default Diva DIVA configuration which is used to boot from SPI NOR Flash, while the latter build builds the u-boot binary images.
Subsequent builds just require ''make'' command, without targets, to update the binary images.
==== Build the graphics components =a custom application ===
AM335x processors provide a PowerVR SGX530 2D/3D graphics accelerator (SGX). This subsystem accelerates 2-dimensional (2D) and 3Some users may prefer to cross-dimensional (3D) graphics compile their applications. The SGX subsystem is based on outside of the POWERVR® SGX core from Imagination TechnologiesYocto flow. SGX is a It maybe specifically useful and easier for new generation projects in their prototyping and proof-of programmable POWERVR graphic cores-concept stages or for any smaller applications in general. The POWERVR SGX530 v1This way users don't have to worry about creating Yocto "recipes" for their applications and becoming familiar with the entire Yocto build system.2.5 architecture is scalable and can target all market segments from mainstream mobile devices In order to highcross-end desktop graphics.[http:compile an application, written in C//softwareC++, the cross-dltoolchain provided with the DIVELK is required.tiAssuming that the environment variables have been configured with the <code>env.comsh</dsps/dsps_public_sw/sdo_sb/targetcontent/gfxsdk/latest/index_FDScode> script, developers can write a simple "Hello world" application, called for example hello.html TI Linux Graphics SDK] is the development package that provides graphics drivers and OpenGLES1.1,2c:<pre>#include <stdio.h>int main(){ printf("Hello world\n"); return 0 and OpenVG libraries and demos running on all TI platforms;}</pre>To cross-compile it:<pre>$ arm-none-linux-gnueabi-gcc -o hello hello.c</pre>Instruction on how Copy the executable file to build the graphic components can be found hereroot file system, and execute it from the DIVA system: http<pre>root@diva://processors.wiki.ti~#.com/index.phphelloHello world</Graphics_SDK_Quick_installation_and_user_guidepre>
== Boot configurations ==
OOB size 64 b
Erase size 131072 b
</pre>
=== Default flash NOR SPI partitions ===
<pre>
[ 1.370563] Creating 7 MTD partitions on "spi1.0":
=== DivaEVBThis section describes how to quick start a DIVA system composed of a DIVA SOM plugged into the DIVAEVB-Lite standalone ===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).
This section describes how to quick start a DivaEVB-Lite system, provided that it is programmed according to DIVELK configuration. # connect the serial cable, provided with the board, to J6the J25 pin-strip connector on the Dacu board# insert the microSD card provided with the development kit into the microSD slot# connect a 12Vcc power supply to JP2 on the Dacu board# (optional) connect this cable to PC COM port through a NULL-modem cable (not provided)# (optional) start your favourite terminal software on PC; communication parameters are:
#* baud rate: 115200 Bps
#* data bits: 8
#* stop bits: 1
#* parity: none
# (optional) to connect the system to Ethernet LAN, please plug cable on connector J7# connect a 12Vcc power supply to J8of the DIVAEVB-Lite
Once power has been appliedThe system is configured to boot automatically, Uwhen powered up, from the SD card, loading u-Boot bootloader will be executed 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. The following messages will be printed on serial console (please note that messages may vary for different U-Boot releases):
These messages are printed by U-Boot, which has a serial console that allows basic interaction with the system.diva login:
At the end of its boot sequence, U-Boot prints <code style="board-terminal">DIVA#</codepre> prompt and waits for user commands.
The default u-boot environment can be printed console dump below (obtained using the <code style="board-terminal">print</code> command) shows the default u-boot environment:
=== DivaEVB-Lite plugged on Dacu =DIVA Frequency Scaling ==
This section describes how The frequency of the CPU can be changed on the run using the Cpufreq framework (please refer to quick start a Diva system composed of a Diva SOM plugged the documentation included into the DivaEVBlinux-Lite and then mounted on am33x/Documentation/cpu-freq directory of the kernel source tree). The cpufreq framework works in conjunction with the Dacu carrier board, provided that it is programmed according to DIVELK configurationrelated driver & governor.
# connect Cpufreq implementation controls the serial cable, provided with the board, to the J25 pin-strip connector on the Dacu board# connect this cable to PC COM port through a NULL-modem cable (not provided)# start your favourite terminal software on PC; communication parameters are:#* baud rate: 115200 Bps#* data bits: 8#* stop bits: 1#* parity: none# Linux OPP (optionalOperating Performance Points) to connect the system to Ethernet LAN, please plug cable on connector J7 of adjusting the DivaEVBCortex-Lite# connect a 12Vcc power supply to JP2 on A8 core voltages and frequencies. CPUFreq is enabled by default in the Dacu boardDIVA kernel configuration.
Once power has been applied, U-Boot bootloader will be executed and and To view the following messages will be printed on serial console (please note that messages may vary for different U-Boot releases)available governors:
I2C: readyDRAM: 512 MiBWARNING: Caches not enabledNow running in RAM <pre class="board- U-Boot at: 9ff46000NAND: 1024 MiBMMC: OMAP SD/MMC: 0SF: Detected S25FL256S_64K with page size 256, total 33554432 bytesSF: Detected S25FL256S_64K with page size 256 Bytes, total 32 MiBREAD: 0xc0000 =terminal"> cmd = { 0x0b 0x000c000000 } len = 0x40000READroot@am335x-evm: 0x100000 =~# echo 275000 > cmd = { 0x0b 0x0010000000 } len = 0x40000USB Host mode controller at 47401000 using PIO, IRQ 0USB Host mode controller at 47401800 using PIO, IRQ 0Module id#: 0x1Net: cpsw connected to SMSC LAN8710/LAN8720sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeedcpsw, usb_etherHit any key to stop autobootroot@am335x-evm: 0 DIVA~#
</pre>
These messages are printed by U-BootPlease note that OPP can be changed only using the '''userspace''' governor. If governors like ondemand is used, which has a serial console that allows basic interaction with OPP change happens automatically based on the systemload.
At For further details, please refer to the end of its boot sequence, U-Boot prints <code style="board-terminal">DIVA#<[http://processors.wiki.ti.com/index.php/code> prompt and waits for user commandsAM335x_Linux_Power_Management_User_Guide AM335x Linux Power Management User Guide].
The default == Forcing the kernel to use a limited amount of RAM == To evaluate the performances of the system with a specific amount of available RAM, the user can pass the ''mem'' parameter to the kernel, by setting the command line arguments in u-boot environment can be printed using (for detailed instruction, please refer to the [[Change_Linux_Command_Line_Parameter_from_U-boot]] page). For example, to limit the amount of RAM to 128 MB, create the <code style="boardfollowing variables in u-terminal">print</code> commandboot:
<pre class="board-terminal">
DIVA# printsetenv mem 128MBaddcons=DIVA# setenv addmem 'setenv bootargs ${bootargs} consolemem=${consolemem} loglevel'</pre> And add the addmem variable to the boot macro: <pre class=8"board-terminal">DIVA# setenv net_nfs 'run loadk nfsargs addip=setenv bootargs addcons addmem; bootm ${bootargsbuf} ip'</pre> For further details, please refer to the linux-am33x/Documentation/kernel-parameters.txt file of the kernel source tree provided with the DIVELK. ==${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off panicUsing GPIOs from userspace =1 eth0=${ethaddr}baudrate=115200bootcmd=dcache on; echo trying Please refer to boot the official documentation from DELK MMC; mmc rescan 0; fatload mmc 0 80900000 bootthe TI wiki: http://processors.wiki.ti.com/index.scr; source 80900000; run net_nfsphp/GPIO_Driver_Guide#User_Space_-_Sysfs_control bootdelay=3= Running QT applications ==bootfile=divaThe root file system provided with the DIVELK (/home/dvdk/divelk/rfs/uImagetisdk on the DVDK virtual machine) contains a pre-built version (4.8.as0) of the QT libraries:console=ttyO0,115200n8ethact=cpsw<pre>ethaddr=00dvdk@dvdk-vm:50:c2:1e:af:af~/divelk/rfs/tisdk/usr/lib$ ll libQ*ethdev=eth0....fdtaddr=0x80F80000....gatewayip=192lrwxrwxrwx 1 root root 19 Dec 17 2012 libQtCoreE.so.4 -> libQtCoreE.so.4.1688.0*lrwxrwxrwx 1 root root 19 Dec 17 2012 libQtCoreE.so.4.8 -> libQtCoreE.so.4.8.2540*hostname=diva-rwxr-xr-x 1 root root 3233396 Dec 16 2012 libQtCoreE.so.4.8.0*ipaddr=192lrwxrwxrwx 1 root root 19 Dec 17 2012 libQtDBusE.so.4 -> libQtDBusE.so.1684.8.0*lrwxrwxrwx 1 root root 19 Dec 17 2012 libQtDBusE.so.4.8 -> libQtDBusE.so.4.8.770*kloadaddr=0x80007fc0-rwxr-xr-x 1 root root 497236 Dec 16 2012 libQtDBusE.so.4.8.0*lrwxrwxrwx 1 root root 26 Dec 17 2012 libQtDeclarativeE.so.4 -> libQtDeclarativeE.so.4.8.0*load=tftp ${loadaddr} diva/ulrwxrwxrwx 1 root root 26 Dec 17 2012 libQtDeclarativeE.so.4.8 -boot> libQtDeclarativeE.so.img4.as8.0*loadaddr=0x80200000-rwxr-xr-x 1 root root 3850720 Dec 16 2012 libQtDeclarativeE.so.4.8.0*loadk=tftp ${kloadaddr} ${bootfile}lrwxrwxrwx 1 root root 33 Dec 17 2012 libQtDesignerComponentsE.so.4 -> libQtDesignerComponentsE.so.4.8.0*module_id#=0x1lrwxrwxrwx 1 root root 33 Dec 17 2012 libQtDesignerComponentsE.so.4.8 -> libQtDesignerComponentsE.so.4.8.0*nand_load_1st=tftp ${loadaddr} diva/MLO-rwxr-xr-x 1 root root 3012324 Dec 16 2012 libQtDesignerComponentsE.so.4.8.0*nand_nfs=nand read ${kloadaddr} 0x2A0000 0x400000; run nfsargs addip addcons; bootm ${kloadaddr}lrwxrwxrwx 1 root root 23 Dec 17 2012 libQtDesignerE.so.4 -> libQtDesignerE.so.4.8.0*nand_update=nand erase 80000 60000; nand write ${loadaddr} 80000 60000lrwxrwxrwx 1 root root 23 Dec 17 2012 libQtDesignerE.so.4.8 -> libQtDesignerE.so.4.8.0*nand_update_1st=nand erase -rwxr-xr-x 1 root root 5246140 Dec 16 2012 libQtDesignerE.so.4.8.0 20000; nand write ${loadaddr} *lrwxrwxrwx 1 root root 18 Dec 17 2012 libQtGuiE.so.4 -> libQtGuiE.so.4.8.0 20000*nand_updatek=nand erase 0x2A0000 0x400000; nand write ${kloadaddr} 0x2A0000 0x400000lrwxrwxrwx 1 root root 18 Dec 17 2012 libQtGuiE.so.4.8 -> libQtGuiE.so.4.8.0*net_nfs=tftp ${kloadaddr} ${bootfile}; run nfsargs addip addcons; bootm ${kloadaddr}-rwxr-xr-x 1 root root 9852452 Dec 16 2012 libQtGuiE.so.4.8.0*netdev=eth0lrwxrwxrwx 1 root root 19 Dec 17 2012 libQtHelpE.so.4 -> libQtHelpE.so.4.8.0*netmask=255lrwxrwxrwx 1 root root 19 Dec 17 2012 libQtHelpE.so.4.8 -> libQtHelpE.so.2554.2558.0*nfsargs=setenv bootargs -rwxr-xr-x 1 root root= 523292 Dec 16 2012 libQtHelpE.so.4.8.0*.........dvdk@dvdk-vm:~/divelk/rfs/tisdk/usr/devlib</nfs rw nfsroot=${serverip}pre> The root file system also provides a lot of pre-built demos and examples (with the related source code and project files), contained in the following directories:${rootpath} rootdelay=2rdaddr=0x81000000rootpath=* /home/dvdk/divelk/rfs/tisdk/usr/bin/qtopia/demos* /home/shareddvdk/develdivelk/daverfs/tisdk/usr/bin/divaqtopia/examples The Matrix-DDxGui application (http:/sw/linuxprocessors.wiki.ti.com/rfsindex.php/delkMatrix_Users_Guide) that launched automatically after DIVELK startup is based on QT and can directly show some demos (simply touching the QT icon). Moreover, additional examples can be launched, for example the "calculator" QML demo: <pre>serverip=192# stop the Matrix Gui application, in case it is running/etc/init.168d/matrix-gui-2.0stop# enter the demo application directorycd /usr/bin/qtopia/demos/declarative/calculator# launch the application.23/calculator -qws</pre> spi_load_1st=tftp ${loadaddr} diva== Building a QT application === The following page describes how to build a simple application: http://processors.wiki.ti.com/MLOindex.byteswapphp/Using_Qt_4.as7#Creating_a_.22Hello_World.22_QtQuick_application spi_nfs=sf probe;sf read ${kloadaddr} 0x140000 0x400000; run nfsargs addip addcons; bootm ${kloadaddr}spi_update=sf probe 0:0; sf erase 0x40000 0x80000; sf write ${loadaddr} 0x40000 0x80000spi_update_1st=sf probe 0:0; sf erase 0x0 0x40000; sf write ${loadaddr} 0x0 0x40000spi_updatekOpening/importing an example project from the DIVELK root file system =sf probe 0:0; sf erase 0x140000 0x400000; sf write ${kloadaddr} 0x140000 0x400000stderr=serialstdin=serialstdout=serialusbnet_devaddr=00Qt Creator (http:18//qt-project.org/wiki/Category:30Tools:f0:2fQtCreator) can open/import the example projects provided with the DIVELK root file system. The developer can explore the project to read and analyse the source code and configuration file and learn how the Qt libraries work:bever=U[[File:Qt-Boot 2012.10creator-00110import-ge8fd044example-dirty (May 13 2013 from- 14:01:25) [delk-0rfs.9.1-rc1png|800px|frameless|border]] === Resources ===
Environment sizeFor additional information, please refer to the following pages: 1987/262139 bytesDIVA#</pre>