Version: | 1.0.0A |
---|---|
Copyright: | Architech |
Date: | 06/11/13 |
This documentation is about the Yocto based SDK v01.00.00 for the Pengwyn board. The SDK is provided by means of an already configured VirtualBox virtual machine, inside the virtual machine everything has already been configured for you so you don’t waste time trying to understand every single detail of every single software component from the beginning. If you are a new user of the Yocto based SDK we suggest you to read the
otherwise, if you want to have a better understanding of specific topics, we suggest you to have a look to the documentation chapters:
The development environment is provided as a Virtual Machine image.
To be able to use it, you first need to install VirtualBox. The version must be the 4.2.10 or above.
Go to:
https://www.virtualbox.org/wiki/Downloads
and download the version that suits your host operating system. You need to download and install the Extension Pack as well.
Important
Make sure that the extension pack has the same version of VirtualBox.
Install the software with all the default options.
Launch the program and follow these steps:
Tip
If you are using Linux, double click directly on the .ova file from your file explorer, there will appear a window so click import button.
Jump to step 3.
Important
The sudo password is pengwyn
Another important thing to do is to set the IP address of the virtual machine as static. To do this follow the next steps inside the virtual machine:
You can configure the system settings of the virtual machine. This is possible only if the virtual machine is off. First, select the Yocto based SDK virtual machine from the list of virtual machines, click on the Settings icon in the Oracle VM VirtualBox Manager window:
In the left menu, click on System. In the Motherboard tab you can select how much RAM you want to assign to the vm.
Select Processor tab to select how many CPUs you want to assign to the virtual machine:
If you changed the number of processors, you might want to consider reading the guides on how to speedup the build process for Poky and HOB.
Poky is a stable version of OpenEmbedded tailored for the Yocto Project. It consists of BitBake, that is a make-alike build tool, and a set of recipes (.bb files) and configuration files used to drive bitbake during the build process. A recipe is a collection of metadata used by BitBake to set variables or define additional build-time tasks. With the variables, a recipe can specify, for example, where to get the sources, which build process to use, the license of the package, an so on. There is a set of predefined tasks (the fetch task for example fetches the sources from the network, from a repository or from the local machine, than the sources are cached for later reuses), but a recipe can always adds custom ones or overrides/modifies existing ones. Yocto is an umbrella project that contains a few components, Poky is one of the largest components of Yocto. This document will focus on the most basic topics, for a full guide you are encouraged to read the official documentation of the Yocto Project.
The virtual machine contains Denzil (version 7.0.1 of Poky, corresponding to Yocto version 1.2.1) already installed and configured to work with the Pengwyn board under /home/pengwyn/yocto/poky. To start using Poky, open a terminal (Ctrl+Alt+t or from Ubuntu’s menu: Applications→Accessories→Terminal) and type:
pengwyn@pengwyn-desktop:~$ cd yocto
pengwyn@pengwyn-desktop:~/yocto$ source poky/oe-init-build-env
### Shell environment set up for builds. ###
You can now run 'bitbake <target>'
Common targets are:
core-image-minimal
core-image-sato
meta-toolchain
meta-toolchain-sdk
adt-installer
meta-ide-support
You can also run generated qemu images with a command like 'runqemu qemux86'
pengwyn@pengwyn-desktop:~/yocto/build$
With the source command the environment has been prepared and, in the current shell, you are able to execute bitbake commands. The sourced script changed also the current directory, that now is ~/yocto/build. You are free to use another build directory, to do that, when you source the environment script, you can specify the name of the directory to use like in the following example:
pengwyn@pengwyn-desktop:~/yocto$ source poky/oe-init-build-env myBuilds
You had no conf/local.conf file. This configuration file has therefore been
created for you with some default values. You may wish to edit it to use a
different MACHINE (target hardware) or enable parallel build options to take
advantage of multiple cores for example. See the file for more information as
common configuration options are commented.
The Yocto Project has extensive documentation about OE including a reference manual
which can be found at:
http://yoctoproject.org/documentation
For more information about OpenEmbedded see their website:
http://www.openembedded.org/
You had no conf/bblayers.conf file. The configuration file has been created for
you with some default values. To add additional metadata layers into your
configuration please add entries to this file.
The Yocto Project has extensive documentation about OE including a reference manual
which can be found at:
http://yoctoproject.org/documentation
For more information about OpenEmbedded see their website:
http://www.openembedded.org/
### Shell environment set up for builds. ###
You can now run 'bitbake <target>'
Common targets are:
core-image-minimal
core-image-sato
meta-toolchain
meta-toolchain-sdk
adt-installer
meta-ide-support
You can also run generated qemu images with a command like 'runqemu qemux86'
pengwyn@pengwyn-desktop:~/yocto/myBuilds$
To make a Linux distribution for the Pengwyn board you are going to need:
There is a set of recipes already prepared to generate all that. The pre-configured virtual machine supports the following subset of those recipes:
Each recipe generates the bootloader, the Linux Kernel, and a specific filesystem. We encourage you to read the official documentation for the details of the aforementioned images recipes. To tell BitBake to build one of those images, run bitbake with the image recipe name (without .bb) as argument, for example, to build the core-image-minimal.bb image run bitbake core-image-minimal like in the following example:
pengwyn@pengwyn-desktop:~/yocto/build$ bitbake core-image-minimal
Pseudo is not present but is required, building this first before the main build
Loading cache: 100% |#############################################| |ETA: 00:00:00
Loaded 1790 entries from dependency cache.
OE Build Configuration:
BB_VERSION = "1.15.2"
TARGET_ARCH = "arm"
TARGET_OS = "linux-gnueabi"
MACHINE = "pengwyn"
DISTRO = "poky"
DISTRO_VERSION = "1.2.1"
TUNE_FEATURES = "armv7a vfp neon cortexa8"
TARGET_FPU = "vfp-neon"
meta
meta-yocto = ":"
meta-efl
meta-gnome
meta-gpe
meta-initramfs
meta-multimedia
meta-oe
meta-xfce = "(nobranch):e77646bc2cf905fd671fc5c19ab6fd17f9b94b3f"
meta-ti-amsdk = "(nobranch):d8f257b275bbf2d573d66d823a118c765f7a26f9"
meta-silica = ":"
NOTE: Resolving any missing task queue dependencies
NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
...
Depending on your hardware and Internet characteristics, this task can take from less than one hour to several hours. Once it finishes, you are going to find bootloader, Linux kernel, kernel modules and filesystem under directory ~/yocto/tmp/deploy/images. If you were working under the default directory (build directory), for example, you are going to find all the following files under directory ~/yocto/build/tmp/deploy/images:
that is the result of building your Linux system from the ground up. It might happen that a fetch task gives an error, if so, double check that the virtual machine has a proper network configuration. If the network configuration has been proved correct, the error might mean that the needed server is down for some reason, in that case the only option you have is to wait and try again later.
When you imported the virtual machine, you might have choosen the number of processors to give to the virtual machine, if so, you can change the parallelism factors to speedup the build process. Once you sourced the environment script and it changed your current directory, you can find the file local.conf inside directory conf, use your preferred editor to open it and change BB_NUMER_THREADS variable value from 2 to <number of processors> * 2, and change PARALLEL_MAKE variable value from -j 2 to -j <number of processors> * 2. For example, if you gave 4 processors to the virtual machine, you could set:
Those modifications are available to the current build directory alone, so if you create another build directory you should set again the same values in the corresponding local.conf file. To make such changes available anytime you create a new build directory, you can edit file ~/yocto/poky/meta-yocto/conf/local.conf.sample and change the value of the aforementioned variables, every time you create a new build directory local.conf.sample file will be used to create the project local.conf file, and the modification will be seen and used by your new projects.
Poky supports the generation of three types of packages:
The default one is ipk, you can change that modifying the PACKAGE_CLASSES variable value inside conf/local.conf file in your build directory. Also in this case, you can make your preference permanent editing file ~/yocto/poky/meta-yocto/conf/local.conf.sample directly.
The tool used to manage the packages directly onto the target is going to be installed by default, to remove it and save space on the generated file system you can edit file local.conf and remove package-management value from EXTRA_IMAGE_FEATURES variable. As usual, if you want that modification to be permanent, change the value directly within file local.conf.sample.
To debug your code on the Pengwyn board you will need:
Both the utility have already been configured to be installed on the destination file system but, if you want a smaller file system and you already finished debugging your application, you can remove tcf-agent and gdbserver values from IMAGE_INSTALL_append inside local.conf file.
Another set of utilities that you might be insterested about is mtd-utils, with the programs installed by such a package you can manage the NAND memory and you can write your filesystem directly onto the NAND memory. By default the mtd-utils package is going to be installed onto your preferred filesystem, anyway, if you want to remove it from the build process you can delete mtd-utils value from IMAGE_INSTALL_append variable.
Kernel modules are pieces of code that can be loaded and unloaded into the kernel space upon demand. They extend the functionality of the kernel without the need to reboot the system. If you want insert new modules into your distribution there are two ways to do this:
- turn on Pengwyn board
- use minicom (refer to section Usb-Serial to know how to configure minicom) to uncompress the new module package from the root of the target file system.
- launch command:
depmod
This command handle dependency descriptions for the new loadable kernel modules. This dependency is written to modules.dep file that can be used by modprobe to automatically load the relevant modules.
- Before to use bitbake command to build a image, go to directory ~/yocto/build/conf and open the local.conf file with your preferred editor.
- Modify IMAGE_INSTALL_append variable value adding kernel-modules like in the following example:
IMAGE_INSTALL_append = " tcf-agent dgbserver kernel-modules"
In this way the modules dependencies will be resolved at build time and the kernel modules will be installed in the file system.
To customize u-boot you need to modify the sources. First of all, you need to have two different directories, one that contains the exact sources that poky uses to build the system, and another one with your modifications. To explain how to setup those two directories, hereafter will be assumed that you will work inside directory ~/Documents. Open the terminal, than type:
pengwyn@pengwyn-desktop:~/Documents$ mkdir /home/pengwyn/Documents/u-boot-configuration
pengwyn@pengwyn-desktop:~/Documents$ cd /home/pengwyn/Documents/u-boot-configuration
pengwyn@pengwyn-desktop:~/Documents/u-boot-configuration$ cp ../../yocto/poky/meta-silica/recipes-bsp/u-boot/u-boot-pengwyn-2013.01/* .
pengwyn@pengwyn-desktop:~/Documents/u-boot-configuration$ tar -xzf u-boot-pengwyn-2013.01.tar.gz
pengwyn@pengwyn-desktop:~/Documents/u-boot-configuration$ mv u-boot-pengwyn-2013.01 a
pengwyn@pengwyn-desktop:~/Documents/u-boot-configuration$ patch -p1 -d a/ < u-boot-pengwyn-2013.01.patch
patching file arch/arm/cpu/armv7/am33xx/board.c
patching file arch/arm/include/asm/arch-am33xx/cpu.h
patching file arch/arm/include/asm/arch-am33xx/omap_gpmc.h
patching file board/silica/pengwyn/Makefile
patching file board/silica/pengwyn/mux.c
patching file boards.cfg
patching file common/miiphyutil.c
patching file common/spl/spl_nand.c
patching file drivers/mtd/nand/nand_base.c
patching file drivers/mtd/nand/nand_bbt.c
patching file drivers/mtd/nand/nand_ids.c
patching file drivers/mtd/nand/omap_gpmc.c
patching file drivers/net/cpsw.c
patching file drivers/net/phy/Makefile
patching file drivers/net/phy/phy.c
patching file drivers/net/phy/ti.c
patching file include/configs/pengwyn.h
patching file include/linux/mtd/mtd-abi.h
pengwyn@pengwyn-desktop:~/Documents/u-boot-configuration$ cp -r a/ b/
Directory b contains the sources that you can modify. Typically, you will want to modify u-boot settings, in which case you should edit file ~/Documents/u-boot-configuration/ b /include/configs/pengwyn.h with your preferred editor. When you are done with your modifications, type:
pengwyn@pengwyn-desktop:~/Documents/u-boot-configuration$ diff -Naur a/ b/ > u-boot-pengwyn-2013.01.mine.patch
pengwyn@pengwyn-desktop:~/Documents/u-boot-configuration$ cp u-boot-pengwyn-2013.01.mine.patch /home/pengwyn/yocto/poky/meta-silica/recipes-bsp/u-boot/u-boot-pengwyn-2013.01/
Create a file named u-boot-pengwyn_2013.01.bbappend inside directory /home/pengwyn/yocto/poky/meta-silica/recipes-bsp/u-boot/ and write the following text inside the .bbappend file:
SRC_URI += "file://u-boot-pengwyn-2013.01.mine.patch \
"
You are now ready to build (actually, rebuild) your customized version of u-boot:
pengwyn@pengwyn-desktop:~/yocto/build$ bitbake u-boot-pengwyn -c cleanall
...
pengwyn@pengwyn-desktop:~/yocto/build$ bitbake u-boot-pengwyn
Once the build process finished, the output files (MLO and u-boot-pengwyn.img) will be placed under tmp/deploy/images/ inside your build directory, so, if you are building your system from the default directory, the destination directory will be /home/pengwyn/yocto/build/tmp/deploy/images.
If you want to modify the Linux kernel sources instead, insert the following commands to create an image of the actual used sources:
pengwyn@pengwyn-desktop:~$ mkdir -p /home/pengwyn/Documents/linux-kernel
pengwyn@pengwyn-desktop:~$ cd /home/pengwyn/Documents/linux-kernel
pengwyn@pengwyn-desktop:~/Documents/linux-kernel$ cp /home/pengwyn/yocto/poky/meta-silica/recipes-kernel/linux/linux-pengwyn-3.2/linux-pengwyn* .
pengwyn@pengwyn-desktop:~/Documents/linux-kernel$ tar -xzf linux-pengwyn_3.2.tar.gz
pengwyn@pengwyn-desktop:~/Documents/linux-kernel$ mv linux-pengwyn_3.2 a
pengwyn@pengwyn-desktop:~/Documents/linux-kernel$ patch -p1 -d a/ < linux-pengwyn_3.2.patch
patching file ...
...
pengwyn@pengwyn-desktop:~/Documents/linux-kernel$ cp -r a/ b/
Modify the sources contained inside directory b, than create your patch
pengwyn@pengwyn-desktop:~/Documents/linux-kernel$ diff -Naur a/ b/ > linux-pengwyn_3.2.mine.patch
pengwyn@pengwyn-desktop:~/Documents/linux-kernel$ cp linux-pengwyn_3.2.mine.patch /home/pengwyn/yocto/poky/meta-silica/recipes-kernel/linux/linux-pengwyn-3.2/
Create a file named linux-pengwyn_3.2.bbappend inside directory /home/pengwyn/yocto/poky/meta-silica/recipes-kernel/linux/ and write the following text inside the .bbappend file:
SRC_URI += "file://linux-pengwyn_3.2.mine.patch \
"
Clean and build:
bitbake linux-pengwyn -c cleanall
bitbake linux-pengwyn
This section describes the steps to be followed to create a standalone bootable system on SD card.
Ensure that the following is available:
Warning
Not all computer built-in readers can be used, use USB connected devices instead.
Warning
Your sd-card will be formatted and all the data contained in it will be lost forever!
run_sdcard /home/pengwyn/custom-dir
Otherwise you can run it with run_sdcard command or use the icon on desktop:
pengwyn@pengwyn-desktop:~$ sudo fdisk -l
Disk /dev/sdb: 1971 MB, 1971322880 bytes
255 heads, 63 sectors/track, 239 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9bfa2153
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 9 72261 c W95 FAT32 (LBA)
/dev/sdb2 11 239 1839442+ 83 Linux
1 ) double click on desktop icon:
2 ) execute the following script:
run_sdcard
3 ) click on the splash screen sd card icon, after having clicked the develop icon.
+------------------------------------------------------------------------------+
| |
| This script will create a bootable SD card. |
| The script must be run with root permissions. |
| |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
| LIST OF AVAILABLE DRIVES: |
+------------------------------------------------------------------------------+
# major minor size name
1: 8 16 1927168 sdb
Enter Device Number #:
[sudo] password for pengwyn:
+------------------------------------------------------------------------------+
| |
| This script will create a bootable SD card. |
| The script must be run with root permissions. |
| |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
| LIST OF AVAILABLE DRIVES: |
+------------------------------------------------------------------------------+
# major minor size name
1: 8 16 1927168 sdb
Enter Device Number #: 1
sdb was selected
sdb1 sdb2
72261 1839442
Mount the partitions
Emptying partitions
Syncing....
+------------------------------------------------------------------------------+
| Copying files now... will take minutes |
+------------------------------------------------------------------------------+
Copying boot partition
Copying file system partition
Copying modules
Syncing....
Un-mount the partitions
Remove created temp directories
Operation Finished
Press ENTER to finish
This section will explain how to transfer the data from the sd card to the Pengwyn board flash memory.
Follow these steps:
nand erase.chip
run nandupdate
reset
./create-nand-fs.sh
shutdown -h now
The system will now restart from NAND flash with the new operating system.
HOB is a graphical interface for bitbake. To run it, prepare the environment than run run_hob command or click icon from desktop,
HOB window will appear.
When you imported the virtual machine you might have changed the number of processors made available to the virtual machine itself. If you did that, you can optimize the build time in this way:
This modification will be available just for the current build directory, to make it permanent please refer to Poky’s guide on How to speedup the build process.
It is possible to choose between the following formats:
by clicking on Settings → Output
choosing your preferred package format, and saving.
Select pengwyn from the combo-box, after the recipes have been parsed the section Select a base image will appear and you can choose your preferred image.
Click on Build image
than the build process will start.
Please note that the build process can last several hours till it finishes.
It might happen that a fetch task gives an error, if so, double check that the virtual machine has a proper network configuration. If the network configuration has been proved correct, the error might mean that the needed server is down for some reason, in that case the only option you have is to wait and try again later.
There are two possible ways to customize an image to build:
Once you selected a predefined image, you can click on View recipes to add/remove recipes and tasks or you can click on View packages to add/remove previously built packages. After the image has been customized you can build your image. If you want to customize every detail you can choose Create your own image from the drop down menu of section Select a base image, than, as previously stated, you can customize the content of your file system and build it.
Remote boot can work like in the following figure:
To boot from remote the host machine must share the kernel image through a tftp server and the root filesystem through an NFS server. Since the target will look for a dhcp during the boot, the host machine needs to have a dhcp server up and running as well.
This guide will present an example of configuration for booting the pengwyn board with a remote kernel and a remote filesystem. To make things work you need to be sure the target can reach the host machine and all the required services (dhcp, tftp, NFS) are properly configured and up and running.
The operating system that runs the needed network services (like dhcp, tftp and NFS) will be named host machine, the board that downloads from the host machine the kernel image and the root file system will be named target machine. When the target machine power on, the first program that runs is the bootloader u-boot. First, u-boot reads uEnv.txt which contains information about the server IP address, the name of the kernel image and where is located the root file system, after that downloads through tftp the kernel image and runs it with the arguments loaded before. When Linux boots it sends DHCP requests to acquire his IP address before to load the network filesystem (NFS) and runs the boot manager (systemd or init) found in root file system.
The target must know the host ip address, so it is suggestible to assign a fixed IP address to the host machine (in this example we will use 192.168.0.20).
You need configure your DHCP server to return a fixed IP address for the target board. Set the correct IP addresses in /etc/dhcp3/dhcpd.conf:
subnet X.Y.Z.0 netmask 255.255.255.0 {
interface eth0;
range X.Y.Z.T X.Y.Z.T;
option subnet-mask 255.255.255.0;
option broadcast-address X.Y.Z.255;
option routers X.Y.0.1;
}
Finally, the dhcp demon must be restarted:
/etc/init.d/dhcp3-server restart
You need to have a bootable SD-CARD with u-boot and MLO installed in the FAT partition. Refer to How to create the SD card page on how to create the SD card.
Copy uEnv.txt file located in /home/pengwyn/yocto/remote/uEnv.txt to the boot partition. The file has the following structure:
ipaddr=X.Y.Z.T
serverip=X.Y.Z.H
gatewayip=X.Y.Z.G
netmask=255.255.255.0
hostname=pengwyn
rootpath=/home/pengwyn/yocto/remote/nfs-eclipse-rootfs
bootfile=uImage
net_args=run bootargs_defaults;setenv bootargs ${bootargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=${ipaddr}:${serverip}::${netmask}:${hostname}:${nfsdevice};
tftp_nfs_boot=echo Booting from network...; tftp ${loadaddr} ${serverip}:${bootfile}; run net_args; bootm ${loadaddr};
uenvcmd=run tftp_nfs_boot;
You must connect target and host machines together by means of a network interface, one possible network schema is to connect both of them with the same ethernet cable through a point to point connection, the other possible schema is to connect them to the same LAN. With the last connection schema, double check that the IP addresses specified within file1, file2, file3 are compliant with your network address space. To get all the console messages at boot and, at the end of the boot process, a command prompt, connect the Pengwyn board via USB to your computer.
On your Host Operating System (not on guest operating system running with the Virtual Machine) you need to have a serial communication program like minicom (for Linux as host operating systems) or HyperTerminal (for Windows as host operating system). In this document only the setup of minicom program will be treated.
The required steps to get the usb-serial link work are:
sudo dmesg -c
dmesg | grep ttyUSB
on the standard output you will see something like:
[11401.006607] usb 1-1.1: FTDI USB Serial Device converter now attached to ttyUSB0
In such an example, ttyUSB0 is the serial device name, and /dev/ttyUSB0 is the serial device
3. run command (sudo password is pengwyn)
sudo minicom -w -s
A - Serial Device : /dev/ttyUSB0
B - Lockfile Location : /var/lock
C - Callin Program :
D - Callout Program :
E - Bps/Par/Bits : 115200 8N1
F - Hardware Flow Control : No
G - Software Flow Control : No
Booting from network...
link up on port 0, speed 100, full duplex
link up on port 1, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.0.20; our IP address is 192.168.0.101
Filename 'uImage'.
Load address: 0x80200000
Loading: #################################################################
[ 5.791564] Sending DHCP and RARP requests . OK
[ 5.802032] IP-Config: Got DHCP answer from 192.168.0.20, my address is 192.168.0.101
[ 5.813079] IP-Config: Complete:
[ 5.816436] device=eth0, addr=192.168.0.101, mask=255.255.255.0, gw=255.255.255.255,
[ 5.824951] host=pengwyn, domain=, nis-domain=(none),
[ 5.830657] bootserver=126.126.126.136, rootserver=192.168.0.20, rootpath=
[ 5.848632] VFS: Mounted root (nfs filesystem) on device 0:16.
Yocto (Built by Poky 7.0.1) 1.2.1
ttyO0
pengwyn login:
Login with username root, no password is required.
Hereafter, the operating system that runs the IDE/debugger will be named host machine, and the board being debugged will be named target machine. The host machine could be running as a virtual machine guest operating system, anyway, the documentation for the host machine running as a guest operating system and as host operating system is exactly the same.
Pay attention before to start writing your application you need:
You can create two types of projects: Autotools-based, or Makefile-based. This section describes how to create Autotools-based projects from within the Eclipse IDE. Launch Eclipse using Architech Launcher or use run_eclipse command or just click on the desktop icon.
To create a project based on a Yocto template and then display the source code, follow these steps:
Note: If the “open perspective” prompt appears, click Yes so that you enter in the C/C++ perspective. The left-hand navigation pane shows your project. You can display your source by double clicking the project’s source file.
To build the project, select Project→Build Project. The console should update with messages from the cross-compiler. To add more libraries to compile:
Note: All libraries are located in ~/yocto/remote/nfs-eclipse-rootfs subdirectories.
Connect the Pengwyn board to the PC by means of a usb cable to power the board and to have the serial console
Once you built the project and the board is running the image, use minicom (refer to section Usb-Serial to know how to configure minicom) to run tcf-agent program in target board:
Yocto (Built by Poky 7.0.1) 1.2.1
ttyO0
pengwyn login: root
root@pengwyn:~# /etc/init.d/tcf-agent restart
On the Host machine, follow these steps to let Eclipse deploy and debug your application:
Important
If debug does not works, check if tcf-agent is running on the board and gdbserver is present.
Note
Before reading this Chapter you should be able to use HOB, bitbake, NFS and minicom (or a similar program).
cd /home/pengwyn/yocto/remote/nfs-eclipse-rootfs/
sudo rm -rf *
cp /home/pengwyn/yocto/build/tmp/deploy/images/qt4e-demo-image-pengwyn.tar.gz .
sudo tar -xzf qt4e-demo-image-pengwyn.tar.gz
# 1:2345:respawn:/sbin/getty 38400 tty1
this allows a USB keyboard to be seen by your Qt application.
sudo rm /home/pengwyn/yocto/remote/nfs-eclipse-rootfs/etc/init.d/qt4demo
The purpose of this example project is to generate a form with an “Hello World” label in it, at the beginning on the x86 virtual machine and than on the Pengwyn board.
To create the project follow these steps:
or from the Desktop icon
or from the command line
run_qtcreator
In the next section we will debug our Hello World! application directly on Pengwyn.
sudo cp ~/workspace/qt/QtHelloWorld-build-desktop-Qt_4_7_4__Qt-4_7_4-arm__Debug/QtHelloWorld ~/yocto/remote/nfs-eclipse-rootfs/home/root
gdbserver :10000 QtHelloWorld -qws
Press OK button to start the debug.
Jumper settings
boot sequence | ||||||
---|---|---|---|---|---|---|
J1 | J2 | J3 | 1st | 2nd | 3rd | 4th |
open | open | open | UART0 | SPI0 | XIP MUX2 | MMC0 |
open | open | close | EMAC1 | MMC0 | XIP MUX2 | NAND |
open | close | open | USB0 | NAND | SPI0 | MMC0 |
open | close | close | Fast ext | UART0 | EMAC1 | reserved |
close | open | open | NAND | NANDI2C | MMC0 | UART0 |
close | open | close | MMC0 | SPI0 | UART0 | USB0 |
close | close | open | XIP MUX2 | UART0 | SPI0 | MMC0 |
close | close | close | Fast ext | EMAC1 | UART0 | reserved |
Link to Assembly
Link to BOM
Link to Schematic
Useful commands:
opkg list-installed
opkg search name_packet
opkg whatdepends name_packet
opkg remove name_packet
for this command there are important options:
-force-depends
-force-removal-of-dependent-packages
opkg install name_packet
Install a web server in the virtual machine, e.g.:
sudo apt-get install apache2
Copy the built packages inside the web server directory, e.g.:
Create a file named <something>.conf (e.g. mine-repositories.conf) under /etc/opkg/ of the Pengwyn file system and fill it with the following lines:
src/gz arm http://192.168.0.20/ipk/armv7a-vfp-neon
src/gz all http://192.168.0.20/ipk/all
src/gz pengwyn http://192.168.0.20/ipk/pengwyn
Note
192.168.0.20 is the server IP where there is the web server with repository
after that run the following command from Pengwyn’s shell:
opkg update
Now you are ready to download and install the packages from the network.
With “opkg list | wc -l” you can know approximately how many packets there are in repository
opkg list | wc -l
opkg update
opkg list | wc -l
If the updating got success with the last command you see the number of packets incremented.
This procedure will guide you to the installation of the display on the Pengwyn board and the configuration of the software to test it.
cd /home/pengwyn
tar xvf linux-pengwyn_3.2.display.patch.tar.gz
cd yocto
source poky/oe-init-build-env
bitbake linux-pengwyn -c cleanall
bitbake linux-pengwyn -c menuconfig
bitbake linux-pengwyn
This document will guide you from importing the virtual machine to the debugging of an Hello World! example on a customized Linux distribution that you will generate with the Yocto toolchain.
The development environment is provided as a Virtual Machine image.
To be able to use it, you first need to install VirtualBox. The version must be 4.2.10 or above.
Go to:
https://www.virtualbox.org/wiki/Downloads
and download the version that suits your host operating system. You need to download and install the Extension Pack as well.
Important
Make sure that the extension pack has the same version of VirtualBox.
Install the software with all the default options.
Run VirtualBox and follow these steps:
Tip
If you are using Linux double click directly on the .ova file from your file explorer and jump to step 3.
Another important thing to do is to set the IP address of the virtual machine as static. To do this follow the next steps inside the virtual machine:
You can configure the system settings of the virtual machine. This is possible only if the virtual machine is off. First, select the Yocto based SDK virtual machine from the list of virtual machines, click on the Settings icon in the Oracle VM VirtualBox Manager window:
In the left menu, click on System. In the Motherboard tab you can select how much RAM you want to assign to the vm.
Select Processor tab to select how many CPUs you want to assign to the virtual machine:
If you changed the number of processors, you might want to consider reading the guides on how to speedup the build process for Poky and HOB.
The first time you boot the virtual machine you are asked to accept the licence agreement, than you can use the GUI of the welcome screen to easily access to toolchain and documentation.
If you close this application you can relaunch it with the icon on the desktop
The first screen is composed of three icons, if you click on Docs you will be redirected to the documentation page while WebSite will show you a web page where you can find more information about hardware and software tools of ArchiTech. Clicking on Develop will open a second screen also composed of three icons.
From that screen, you can:
By clicking IDEs you will be brought to the last screen where you can finally choose between Eclipse or Qt Creator.
First of all you need to build a system, in this section you will build a predefined Linux image.
Click on HOB icon and wait until the GUI will show.
Important
To run HOB you need a working Internet connection. If internet connection doesn’t work you have to follow this instructions:
If required the sudo password is pengwyn
Select pengwyn as current machine from the drop-down menu.
Select core-image-minimal-dev as base image.
Click on Build image button.
Important
The build process can last hours.
Wait until it finishes.
At the end of the build the images will be automatically saved in /home/pengwyn/yocto/build/tmp/deploy/images folder.
Important
You must have an SD card reader/programmer to build the SD card. The SD card must be at the least 1GB size. VirtualBox will see only USB connected SD card reader/programmer. This guide will assume you have a USB device for such a purpose.
To create your SD card, please follow these steps:
pengwyn@pengwyn-desktop:~$ sudo fdisk -l
Disk /dev/sdb: 1971 MB, 1971322880 bytes
255 heads, 63 sectors/track, 239 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9bfa2153
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 9 72261 c W95 FAT32 (LBA)
/dev/sdb2 11 239 1839442+ 83 Linux
+------------------------------------------------------------------------------+
| |
| This script will create a bootable SD card. |
| The script must be run with root permissions. |
| |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
| LIST OF AVAILABLE DRIVES: |
+------------------------------------------------------------------------------+
# major minor size name
1: 8 16 1927168 sdb
Enter Device Number #:
[sudo] password for pengwyn:
+------------------------------------------------------------------------------+
| |
| This script will create a bootable SD card. |
| The script must be run with root permissions. |
| |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
| LIST OF AVAILABLE DRIVES: |
+------------------------------------------------------------------------------+
# major minor size name
1: 8 16 1927168 sdb
Enter Device Number #: 1
sdb was selected
sdb1 sdb2
72261 1839442
Mount the partitions
Emptying partitions
Syncing....
+------------------------------------------------------------------------------+
| Copying files now... will take minutes |
+------------------------------------------------------------------------------+
Copying boot partition
Copying file system partition
Copying modules
Syncing....
Un-mount the partitions
Remove created temp directories
Operation Finished
Press ENTER to finish
From the splash screen select Develop->IDEs and open Eclipse. Once the IDE is started, the project HelloWorld is opened by default. To build it click Project→Build All. To debug the application connect your Host PC to Pengwyn Board with an Ethernet cable. Connect the Pengwyn board to the PC by means of a usb cable to power the board and to have the serial console
On your Host Operating System open a terminal console (ctrl+alt+t) and run command:
minicom -w -s
choose select port setup and press Enter. Setup the port with the following configuration:
A - Serial Device : /dev/ttyUSB0
B - Lockfile Location : /var/lock
C - Callin Program :
D - Callout Program :
E - Bps/Par/Bits : 115200 8N1
F - Hardware Flow Control : No
G - Software Flow Control : No
once you are done configuring the serial port, you are back to minicom main menu and you can select exit. press the reset button on the Pengwyn board. The login will appear inside the terminal of the Pengwyn board:
Yocto (Built by Poky 7.0.1) 1.2.1
ttyO0
pengwyn login:
Note
sometimes you need press enter to view the login
Insert root and press enter. run command:
ifconfig eth0 192.168.0.101
ping 192.168.0.20
If the output is similar to this one:
64 bytes from 192.168.0.20: icmp_req=1 ttl=64 time=0.946 ms
64 bytes from 192.168.0.20: icmp_req=2 ttl=64 time=0.763 ms
64 bytes from 192.168.0.20: icmp_req=3 ttl=64 time=0.671 ms
64 bytes from 192.168.0.20: icmp_req=4 ttl=64 time=0.793 ms
the ethernet connection is ok, then run command:
/etc/init.d/tcf-agent restart
Enter also in the path the name of the application you want to build. (e.g. HelloWorld)
With F6 key you can execute the application step by step. You can see the target output in the eclipse console view
pengwyn
sudo is a program for Unix-like computer operating systems that allows users to run programs/commands with the security privileges of another user, normally the superuser or root. Not all the users can call sudo, only the sudoers, pengwyn user is a sudoer. When you run a command preceeded by sudo Linux will ask you the user password, for pengwyn user the password is pengwyn.
By default, Ubuntu 10.04 comes with no password defined for roor user, to set it run the following command:
sudo passwd root
Linux will ask you (twice, the second time is just for confirmation) to write the password for user root.
Pengwyn Board can be powered directly from the USB connector, the power consumption is about 250mA without any option installed. When powered from USB, the board can supply enough current to a USB keyboard (or a USB mouse) and to the DVI interface. If you want to connect something more power hungry to the USB port, we suggest you to power the board with an external power supply or to use externally powered USB devices.
Please, refer to:
The simplest reason could be that the SD card is write protected or locked, please double check that.
Commercially licensed recipes are disabled by default. Your conf/local.conf file, contained in your build directory (by default is /home/pengwyn/yocto/build/), has a (commented) line starting with:
# LICENSE_FLAGS_WHITELIST
uncomment it (delete # symbol).
For the details, please refer to the official Yocto Project documentation.
pengwyn@pengwyn-desktop:~$ mkdir -p /home/pengwyn/Documents/linux-kernel
pengwyn@pengwyn-desktop:~$ cd /home/pengwyn/Documents/linux-kernel
pengwyn@pengwyn-desktop:~/Documents/linux-kernel$ cp /home/pengwyn/yocto/poky/meta-silica/recipes-kernel/linux/linux-pengwyn-3.2/linux-pengwyn* .
pengwyn@pengwyn-desktop:~/Documents/linux-kernel$ tar -xzf linux-pengwyn_3.2.tar.gz
pengwyn@pengwyn-desktop:~/Documents/linux-kernel$ patch -p1 -d linux-pengwyn_3.2 < linux-pengwyn_3.2.patch
patching file ...
pengwyn@pengwyn-desktop:~/Documents/linux-kernel$ cd linux-pengwyn_3.2/drivers
In this directory there are all kernel linux drivers.
make menuconfig
Once opened go in Device Drivers.
If you have already built the kernel before modify it, you need purge all file objects. To do this use the following command:
make ARCH=arm mrproper
will cleanup totally the sources. See How to customize the Linux Kernel for details.
If you have modified the options in the kernel then assure that it is enabled “NFS client support” option in File System → Network File Systems
Open your .pro project file and add a new line under QT += core gui:
QT += webkit
If yuor company uses proxy then read this page to configure correctly yocto: Working Behind a Network Proxy page.
Furthermore, we encourage you to read: