This document will guide you from importing the virtual machine to debugging an Hello World! example on a customized Linux distribution you will generate with OpenEmbedded/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, Galileo 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
The VBox addictions add functionalities to the virtual machine such as better graphic driver and more. It is already installed in the SDK but is important re-install it to configuring correctly the virtual machine with your operating system.
2. Click on the virtual box menu to the voice Devices and select Insert Guest Additions CD Images.... A message box will appear at the start of the installation, click on run button
Important
A working internet connection, several GB of free disk space and several hours are required by the build process
gedit conf/local.conf
IMAGE_INSTALL_append = " tcf-agent gdbserver"
This will trigger the installation of a features set onto the final root file system, like tcf-agent and gdbserver.
Now set BB_NUMBER_THREADS and PARALLEL_MAKE values:
BB_NUMBER_THREADS = X
PARALLEL_MAKE = X
Warning
bitbake image-full-galileo
At the end of the build process, the image will be saved inside directory:
/home/architech/architech_sdk/architech/galileo/yocto/meta-clanton_v1.0.1/yocto_build/tmp/deploy/images/
cd /home/architech/architech_sdk/architech/galileo/yocto/meta-clanton_v1.0.1/yocto_build/tmp/deploy/images/
mkdir rootfs
sudo mount -o loop image-full-galileo-clanton.ext3 rootfs/
cd rootfs
sudo cp -r * ~/architech_sdk/architech/galileo/sysroot
cd ..
sudo umount rootfs
cd /home/architech/architech_sdk/architech/galileo/toolchain/sysroots/i586-poky-linux-uclibc
sudo cp -r * /home/architech/architech_sdk/architech/galileo/sysroot/
sudo chown -R architech:architech ~/architech_sdk/architech/galileo/sysroot
Note
sudo password is: “architech“
Important
To deploy the root file system, you need a micro SD card (or USB device).
Warning
Warning
cp -r ~/architech_sdk/architech/galileo/yocto/meta-clanton_v1.0.1/yocto_build/tmp/deploy/images/boot /path/to/your/sd/card/device
cp ~/architech_sdk/architech/galileo/yocto/meta-clanton_v1.0.1/yocto_build/tmp/deploy/images/bzImage /path/to/your/sd/card/device
cp ~/architech_sdk/architech/galileo/yocto/meta-clanton_v1.0.1/yocto_build/tmp/deploy/images/core-image-minimal-initramfs-clanton.cpio.gz /path/to/your/sd/card/device
cp ~/architech_sdk/architech/galileo/yocto/meta-clanton_v1.0.1/yocto_build/tmp/deploy/images/image-full-galileo-clanton.ext3 /path/to/your/sd/card/device
Important
Important
The first time you boot the board may take several minutes. This is expected behavior due to the SSH component creating cryptographic keys on the first boot.
Warning
To boot from SD/USB, the grub instance embedded in the SPI flash is hardcoded to search for a boot/grub/grub.conf file in partition 1 on the SD/USB card. This is compatible with the factory formatting of most SD/USB devices. By default, the UEFI firmware does not try to boot from SD or USB, it is handled by grub
Warning
If you use an SD or USB device that has been reformatted after manufacturing, you might experience problems booting from it. First, try to boot with a different memory device and see if the problem goes away.
Take the power socket adapter compatible with your country, plug it in the power adapter. When in position, you should hear a slight click. Power on the board connecting the external power adapter to Galileo jack 5V PWR.
Now it’s time to start the serial console.
On Galileo there is the dedicated serial console connector UART (audio mini-jack)
which you can connect, by the serial to mini-jack UART port cable, to your personal computer.
Note
Every operating system has its own killer application to give you a serial terminal interface. In this guide, we are assuming your host operating system is Ubuntu.
On a Linux (Ubuntu) host machine, the console is seen as a ttyUSBX or ttySX device and you can access to it by means of an application like minicom.
Minicom needs to know the name of the serial device. The simplest way for you to discover the name of the device is by looking to the kernel messages, so:
sudo dmesg -c
dmesg
[ 2614.290675] usb 3-4: >new full-speed USB device number 4 using xhci_hcd
[ 2614.313854] usb 3-4: >New USB device found, idVendor=0403, idProduct=6015
[ 2614.313861] usb 3-4: >New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2614.313865] usb 3-4: >Product: FT230X Basic UART
[ 2614.313868] usb 3-4: >Manufacturer: FTDI
[ 2614.313870] usb 3-4: >SerialNumber: DN002OZI
[ 2614.379284] usbcore: registered new interface driver usbserial
[ 2614.379298] usbcore: registered new interface driver usbserial_generic
[ 2614.379306] USB Serial support registered for generic
[ 2614.379310] usbserial: USB Serial Driver core
[ 2614.387899] usbcore: registered new interface driver ftdi_sio
[ 2614.387914] USB Serial support registered for FTDI USB Serial Device
[ 2614.387997] ftdi_sio 3-4:1.0: >FTDI USB Serial Device converter detected
[ 2614.388029] usb 3-4: >Detected FT-X
[ 2614.388031] usb 3-4: >Number of endpoints 2
[ 2614.388034] usb 3-4: >Endpoint 1 MaxPacketSize 64
[ 2614.388035] usb 3-4: >Endpoint 2 MaxPacketSize 64
[ 2614.388037] usb 3-4: >Setting MaxPacketSize 64
[ 2614.388260] usb 3-4: >FTDI USB Serial Device converter now attached to /dev/ttyS0
[ 2614.388288] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
As you can see, here the device has been recognized as /dev/ttyS0.
Now that you know the device name, run minicom:
sudo minicom -ws
If minicom is not installed, you can install it with:
sudo apt-get install minicom
then you can setup your port with these parameters:
+-----------------------------------------------------------------------+
| A - Serial Device : /dev//dev/ttyS0 |
| 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 |
| |
| Change which setting? |
+-----------------------------------------------------------------------+
| Screen and keyboard |
| Save setup as dfl |
| Save setup as.. |
| Exit |
| Exit from Minicom |
+--------------------------+
If on your system the device has not been recognized as /dev/ttyS0, just replace /dev/ttyS0 with the proper device.
Once you are done configuring the serial port, you are back to minicom main menu and you can select exit.
Give root to the login prompt:
Board
galileo login: root
and press Enter.
Note
Sometimes, the time you spend setting up minicom makes you miss all the output that leads to the login and you see just a black screen, press Enter then to get the login prompt.
The time to create a simple HelloWorld! application using Eclipse has come.
Use an ethernet cable to connect the board (connector 10/100 LAN) to your PC. Configure your workstation ip address as 192.168.0.100. Make sure the board can be seen by your host machine:
ifconfig eth0 192.168.0.10
ping 192.168.0.10
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
then the ethernet connection is ok. Enable the remote debug with Yocto by typing this command on Galileo console:
/etc/init.d/tcf-agent restart
On the Host machine, follow these steps to let Eclipse deploy and debug your application:
/home/architech/architech_sdk/architech/galileo/toolchain/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-uclibc/arm-poky-linux-uclibc-gdb
/home/architech/architech_sdk/architech/galileo/sysroot/lib
/home/architech/architech_sdk/architech/galileo/sysroot/usr/lib
Important
If debug does not work, check on the board if tcf-agent is running and gdbserver has been installed. You can ignore the message “Cannot access memory at address 0x0”.