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 disk (to be used by a VirtualBox virtual machine) which you can download from this page:
Important
Compute the MD5SUM value of the zip file you downloaded and compare it to the golden one you find in the download page.
Uncompress the file, and you will get a .vdi file that is our virtual disk image. The environment contains the SDK for all the boards provided by Architech, Pengwyn included.
For being able to use it, you first need to install VirtualBox (version 4.2.10 or higher). You can get VirtualBox installer from here:
https://www.virtualbox.org/wiki/Downloads
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.
We need to setup a port forwarding rule to let you (later) use the virtual machine as a local repository of packages.
Note
The virtual machine must be off
Building an entire system from the ground up is a business that can take up to several hours. To improve the performances of the overall build process, you can, if your computer has enough resources, assign more than one processor to the virtual machine.
Note
The virtual machine must be off
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 splash screen application has been designed to facilitate the access to the boards tools. It can be opened by clicking on its Desktop icon.
Once started, you can can choose if you want to work with Architech’s boards or with partners’ ones. For Pengwyn, choose ArchiTech.
A list of all available Architech’s boards will open, select Pengwyn.
A list of actions related to Pengwyn that can be activated will appear.
First of all you need to build a system, in this section you will build a predefined Linux image.
By clicking Run hob you will launch HOB.
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:
tar -jxf pengwyn-tools.tar.bz2 -C /home/architech/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
cd /home/architech/Desktop/pengwyn-tools
sudo ./fast-create-sdcard.sh
+------------------------------------------------------------------------------+
| |
| 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 #:
+------------------------------------------------------------------------------+
| |
| 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
Launch Eclipse using Architech Splashscreen just click on Develop with Eclipse.
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 ~/architech_sdk/architech/pengwyn/sysroot 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:~# ifconfig eth0 192.168.0.10
Test the ethernet:
ping 192.168.0.100
If the output is similar to this one:
64 bytes from 192.168.0.100: icmp_req=1 ttl=64 time=0.946 ms
64 bytes from 192.168.0.100: icmp_req=2 ttl=64 time=0.763 ms
64 bytes from 192.168.0.100: icmp_req=3 ttl=64 time=0.671 ms
64 bytes from 192.168.0.100: icmp_req=4 ttl=64 time=0.793 ms
the ethernet connection is ok, then run command:
/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.
With F6 key you can execute the application step by step. You can see the target output in the eclipse console view