Version: | 1.0.1A |
---|---|
Copyright: | Architech |
Date: | 28/01/2014 |
This documentation is old, you can find the last release: Here
Hachiko board is a deeply embedded board based on Renesas’s RZ/A1 processor, which has a huge internal random access memory, enough to run a Linux distribution directly without the help of memory external to the SoC. The distribution you can run from within the internal RAM must be custom tailored for the final application. If you want to have more flexibility, the board allows you to mount an external memory chip so you can extend the amount of system memory. From the point of view of the SDK, there are differences regarding Linux kernel configuration, cross-toolchain, how the Linux distribution has to be composed, etc., hence there are two different SDKs for the two different configurations and two different documentations.
Important
We will call Hachiko/SDRAM the configuration that employs external memory, while we will call Hachiko the configuration without it.
This documentation is about Hachiko/SDRAM.
Have you just received your Hachiko/SDRAM board? Then you sure want to read the Unboxing chapter first.
If you are a new user of the Yocto based SDK we suggest you to read the Quick start guide chapter, otherwise, if you want to have a better understanding of specific topics, just jump directly to the chapter that interests you the most.
Furthermore, we encourage you to read the official Yocto Project documentation.
Throughout this guide, there are commands, file system paths, etc., that can either refer to the machine (real or virtual) you use to run the SDK or to the board.
Host
This box will be used to refer to the machine running the SDK
Board
This box will be used to refer to Hachiko/SDRAM board
However, the previous notations can make you struggle with long lines. In such a case, the following notation is used.
This Box will be used where long lines need to be displayed, as well as with system paths, commands, configuration files, etc.
All related to the host.
It will be used to display code example as well.
The same facility will be used, when needed, for the board.
If you click on select on the top right corner of these two last boxes, you will get the text inside the box selected. We have to warn you that your browser might select the line numbers as well, so, the first time you use such a feature, you are invited to check it.
Sometimes, when referring to file system paths, the path starts with /path/to. In such a case, the documentation is NOT referring to a physical file system path, it just means you need to read the path, understand what it means, and understand what is the proper path on your system. For example, when referring to the device file associated to your USB flash memory you could read something like this in the documentation:
/path/to/your/USB/device
Since things are different from one machine to another, you need to understand its meaning and corresponding value for your machine, like for example:
/dev/sdb
This amazing board gets the power directly from the USB, so it comes with no external power supply.
This is what the box looks like
And this is the content of box
The board itself has been programmed to boot to a Linux console of a really tiny distribution, custom tailored to fit the 10MB of internal ram of Renesas’s SoC.
Shall we power on the board for the first time? Of course!
On Hachiko/SDRAM there is the dedicated serial console connector CN2
which you can connect, by means of a mini-USB 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 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:
Host
sudo dmesg -c
Host
dmesg
[ 2912.634893] usb 3-4: >new full-speed USB device number 6 using xhci_hcd
[ 2912.658153] usb 3-4: >New USB device found, idVendor=0403, idProduct=6001
[ 2912.658160] usb 3-4: >New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2912.658164] usb 3-4: >Product: Hachiko Rev. B
[ 2912.658167] usb 3-4: >Manufacturer: AVNET EMG ITALY
[ 2912.658169] usb 3-4: >SerialNumber: A6XGP6WP
[ 2912.660753] ftdi_sio 3-4:1.0: >FTDI USB Serial Device converter detected
[ 2912.660801] usb 3-4: >Detected FT232RL
[ 2912.660805] usb 3-4: >Number of endpoints 2
[ 2912.660809] usb 3-4: >Endpoint 1 MaxPacketSize 64
[ 2912.660812] usb 3-4: >Endpoint 2 MaxPacketSize 64
[ 2912.660815] usb 3-4: >Setting MaxPacketSize 64
[ 2912.661102] usb 3-4: >FTDI USB Serial Device converter now attached to ttyUSB0
As you can see, here the device has been recognized as ttyUSB0.
Now that you know the device name, run minicom:
Host
sudo minicom -ws
If minicom is not installed, you can install it with:
Host
sudo apt-get install minicom
then you can setup your port with these parameters:
+-----------------------------------------------------------------------+
| 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 |
| |
| 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 ttyUSB0, just replace ttyUSB0 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
hachiko64 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.
Enjoy!
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, Hachiko/SDRAM 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
Important
A working internet connection, several GB of free disk space and several hours are required by the build process
gedit conf/local.conf
EXTRA_IMAGE_FEATURES_append = " tools-debug debug-tweaks"
IMAGE_INSTALL_append = " tcf-agent"
This will trigger the installation of a features set onto the final root file system, like tcf-agent and gdbserver.
bitbake core-image-minimal-dev
At the end of the build process, the image will be saved inside directory:
/home/architech/architech_sdk/architech/hachiko/yocto/build/tmp/deploy/images/hachiko64
sudo tar -xjf /home/architech/architech_sdk/architech/hachiko/yocto/build/tmp/deploy/images/hachiko64/core-image-minimal-dev-hachiko64.tar.bz2 -C /home/architech/architech_sdk/architech/hachiko/sysroot/
Note
sudo password is: “architech“
To deploy the root file system, you are going to need an USB flash drive.
Warning
The USB flash drive content will be lost forever!
sfdisk /path/to/your/USB/device << EOF
0,
EOF
mkfs.ext2 /path/to/your/USB/device/partition
sudo tar -xjf /home/architech/architech_sdk/architech/hachiko/yocto/build/tmp/deploy/images/hachiko64/core-image-minimal-dev-hachiko.tar.bz2 -C /path/to/usb/media
cp /home/architech/architech_sdk/architech/hachiko/yocto/build/tmp/deploy/images/hachiko64/uImage /path/to/usb/media/boot
cp /home/architech/architech_sdk/architech/hachiko/yocto/build/tmp/deploy/images/hachiko64/uImage-rza1-hachiko.dtb /path/to/usb/media/boot/rza1-hachiko.dtb
On Hachiko/SDRAM there is the dedicated serial console connector CN2
which you can connect, by means of a mini-USB 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 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:
Host
sudo dmesg -c
Host
dmesg
[ 2912.634893] usb 3-4: >new full-speed USB device number 6 using xhci_hcd
[ 2912.658153] usb 3-4: >New USB device found, idVendor=0403, idProduct=6001
[ 2912.658160] usb 3-4: >New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2912.658164] usb 3-4: >Product: Hachiko Rev. B
[ 2912.658167] usb 3-4: >Manufacturer: AVNET EMG ITALY
[ 2912.658169] usb 3-4: >SerialNumber: A6XGP6WP
[ 2912.660753] ftdi_sio 3-4:1.0: >FTDI USB Serial Device converter detected
[ 2912.660801] usb 3-4: >Detected FT232RL
[ 2912.660805] usb 3-4: >Number of endpoints 2
[ 2912.660809] usb 3-4: >Endpoint 1 MaxPacketSize 64
[ 2912.660812] usb 3-4: >Endpoint 2 MaxPacketSize 64
[ 2912.660815] usb 3-4: >Setting MaxPacketSize 64
[ 2912.661102] usb 3-4: >FTDI USB Serial Device converter now attached to ttyUSB0
As you can see, here the device has been recognized as ttyUSB0.
Now that you know the device name, run minicom:
Host
sudo minicom -ws
If minicom is not installed, you can install it with:
Host
sudo apt-get install minicom
then you can setup your port with these parameters:
+-----------------------------------------------------------------------+
| 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 |
| |
| 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 ttyUSB0, just replace ttyUSB0 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
hachiko64 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.
CN2 is used also to provide the power to the board, so, as soon as your serial terminal emulator is ready you start getting messages from the board.
The time to create a simple HelloWorld! application using Eclipse has come.
Use an ethernet cable to connect the board (connector XF1) 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 Hachiko/SDRAM 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/hachiko/toolchain/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb
/home/architech/architech_sdk/architech/hachiko/sysroot/lib
/home/architech/architech_sdk/architech/hachiko/sysroot/usr/lib
Important
If debug does not work, check on the board if tcf-agent is running and gdbserver has been installed.
This chapter gives an overview on how the SDK has been composed and where to find the tools on the virtual machine.
The SDK provided by Architech to support Hachiko/SDRAM is composed by several components, the most important of which are:
Regarding the installation and configuration of these tools, you have many options:
The method you choose depends on your level of expertise and the results you want to achieve.
If you are new to Yocto and/or Linux, or simply you don’t want to read tons of documentation right now, we suggest you to download and install the virtual machine because it is the simplest solution (have a look at VM content), everything inside the virtual machine has been thought to work out of the box, plus you will get support.
If performances are your greatest concerns, consider reading Chapter Create SDK.
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, Hachiko/SDRAM 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 virtual machine provided by Architech contains:
All the aforementioned tools are installed under directory /home/architech/architech_sdk, its sub-directories main layout is the following:
architech_sdk
|
|_ splashscreen
|
|_ spashscreen-interface
|
|_ architech-manifest
|
|_ architech
|
|_ ...
|
|_ hachiko
|
|_ eclipse
|
|_ java
|
|_ qtcreator
|
|_ splashscreen
|
|_ sysroot
|
|_ toolchain
|
|_ workspace
| |
| |_ eclipse
| |
| |_ qt
|
|_ yocto
|
|_ build
|
|_ poky
|
|_ meta-hachiko
|
|_ ...
hachiko directory contains all the tools composing the ArchiTech SDK for Hachiko/SDRAM board, along with all the information needed by the splash screen application. In particular:
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 Hachiko/SDRAM, choose ArchiTech.
A list of all available Architech’s boards will open, select Hachiko/SDRAM.
A list of actions related to Hachiko/SDRAM that can be activated will appear.
If you have speed in mind, it is possible to install the SDK on a native Ubuntu machine (other Linux distributions may support this SDK with minor changes but won’t be supported). This chapter will guide you on how to clone the entire SDK, to setup the SDK for one board or just OpenEmbedded/Yocto for Hachiko/SDRAM board.
Architech’s Yocto based SDK is built on top of Ubuntu 12.04 32bit, hence all the scripts provided are proven to work on such a system.
If you wish to use another distribution/version you might need to change some script option and/or modify the scripts yourself, remember that you won’t get any support in doing so.
To install the same tools you get inside the virtual machine on your native machine you need to download and run a system wide installation script:
git clone -b dora https://github.com/architech-boards/machine_installer.git
cd machine_installer
./machine_install -g -p
where -g option asks the script to install and configure a few graphic customization, while -p option asks the script to install the required packages on the machine. If you want to install the toolchain on a machine not equal to Ubuntu 12.04 32bit then you may want to read the script, install the required packages by hand, and run it without options. You might need to recompile the Qt application used to render the splashscreen.
At the end of the installation process, you will get the same tools installed within the virtual machine, that is, all the tools necessary to work with Architech’s boards.
If you don’t want to install the tools for all the boards, you can install just the subset of tools related to Hachiko/SDRAM:
git clone -b dora https://github.com/architech-boards/hachiko-splashscreen.git
cd hachiko-splashscreen
./run_install
This script needs the same tools/packages required by machine_install
The easiest way to setup and keep all the necessary meta-layers in sync with upstream repositories is achieved by means of Google’s repo tool. The following steps are necessary for a clean installation:
mkdir -p ~/bin
sudo apt-get install curl
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
echo $PATH
export PATH="$PATH:${HOME}/bin"
repo init -u https://github.com/architech-boards/hachiko-manifest.git -b dora -m manifest.xml
repo sync
By the end of the last step, all the necessary meta-layers should be in place, anyway, you still need to edit your local.conf and bblayers.conf to compile for hachiko64 machine and using all the downloaded meta-layers.
When you want your local repositories to be updated, just:
repo sync
If you really want to download everything by hand, just clone branch dora of meta-hachiko:
git clone -b dora https://github.com/architech-boards/meta-hachiko.git
and have a look at the README file.
To install Eclipse, Qt Creator, cross-toolchain, NFS, TFTP, etc., read Yocto/OpenEmbedded documentation, along with the other tools one.
The Board Support Package is composed by a set files, patches, recipes, configuration files, etc. This chapter gives you the information you need when you want to customize something, fix a bug, or simply learn how the all thing has been assembled.
The bootloader used by Hachiko/SDRAM board is U-Boot. If you need to modify the bootloader or to recompile it you have two ways to get the sources:
Anyway, we will assume in this giude that u-boot sources will be copied to:
/home/architech/Documents/u-boot
and such directory does not yet exists on your PC. Of course, you are free to choose the path you like the most for u-boot sources, just remember to replace the path used in this guide with your custom path.
The first way is based on the sources set up by the Yocto build system. However, it is never advisable to work with the sources in the Yocto build directory, if you really want to modify the source code inside the Yocto environment we strongly suggest to refer to the official Yocto documentation. To avoid messing up Yocto recipes and installation, it is desirable to copy the patched u-boot sources you find in the build directory elsewhere. The directory we are talking about is this one:
/home/architech/architech_sdk/architech/hachiko/yocto/build/tmp/work/hachiko64-poky-linux-gnueabi/u-boot/2013.04-r0/u-boot-2013.04/
Replace:
/home/architech/architech_sdk/architech/hachiko/yocto/build/
all over this chapter with your custom build directory path if you are not working with the default SDK build directory.
The second way is to get the official U-Boot sources and patch them with Hachiko/SDRAM BSP patches. Hachiko/SDRAM board uses U-Boot version 2013.04, which can be downloaded from:
ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2.
otherwise a git repository is available for cloning:
cd /home/architech/Documents
git clone -b v2013.04 http://git.denx.de/u-boot.git
Patches are to be found in the Yocto meta-layer meta-hachiko. You can use them right away if you are working with the SDK:
patch -p1 -d /home/architech/Documents/u-boot < /home/architech/architech_sdk/architech/hachiko/yocto/meta-hachiko/recipes-bsp/u-boot/files/*.patch
However, if you are not working with the official SDK the most general solution to check them out and patch the sources is:
cd /home/architech/Documents
git clone -b dora https://github.com/architech-boards/meta-hachiko.git
patch -p1 -d /home/architech/Documents/u-boot < /home/architech/Documents/meta-hachiko/recipes-bsp/u-boot/files/*.patch
Configuration and board files for Hachiko/SDRAM board are in:
/home/architech/Documents/u-boot/board/renesas/hachiko/*
/home/architech/Documents/u-boot/include/configs/hachiko.h
Suppose you modified something and you wanted to recompile the sources to test your patches, well, you need a cross-toolchain (see Cross compiler Section). Luckily, the SDK already contains the proper cross-toolchain. To use it to compile the bootloader or the operating system kernel, just run:
source /home/architech/architech_sdk/architech/hachiko/toolchain/environment-nofs
then you can run these commands to compile it:
cd /home/architech/Documents/u-boot/
make mrproper
make hachiko64
make
Once the build process completes, you can find u-boot.bin file inside directory /home/architech/Documents/u-boot.
If you are not working with the virtual machine, you need to get the toolchain from somewhere. The most comfortable way to get the toolchain is to ask Bitbake for it:
cd /path/to/yocto/directory
source poky/oe-init-build-env
bitbake meta-toolchain
When Bitbake finishes, you find an installer script under directory:
/path/to/yocto/directory/build/tmp/deploy/sdk/
Run the script and you get, under the installation directory, a script to source to get your environment almost in place for compiling. The name of the script is:
environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
Anyway, the environment is not quite right for compiling the bootloader and the Linux kernel, you need to unset a few variables first to get it ready:
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
Here you go, you now have the proper working environment to compile u-boot (or the Linux kernel).
As seen for U-Boot in the previous section, the first step is to get the kernel sources, which in this guide we assume that they will be copied to directory:
/home/architech/Documents/kernel
You are free to choose the path you like the most for the kernel sources, just remember to replace the path used in this guide with your custom path. The suggested way, even for the kernel, to get the sources is to take them from the Yocto build directory (copying them in the aforementioned directory to avoid messing up Yocto):
/home/architech/architech_sdk/architech/hachiko/yocto/build/tmp/work/hachiko64-poky-linux-gnueabi/linux/3.8.13-r2/linux-3.8.13/
or from the vanilla kernel tarball at this URL:
and patch it using the patches found in Hachiko/SDRAM BSP meta-layer:
patch -p1 -d /home/architech/Documents/kernel < /home/architech/architech_sdk/architech/hachiko/yocto/meta-hachiko/recipes-kernel/linux/files/*.patch
If you are not developing from within the official SDK, the most general solution to check them out and patch the sources is:
cd /home/architech/Documents
git clone -b dora https://github.com/architech-boards/meta-hachiko.git
patch -p1 -d /home/architech/Documents/kernel < /home/architech/Documents/meta-hachiko/recipes-kernel/linux/files/*.patch
To compile the kernel just execute these commands:
cd /home/architech/Documents/kernel
source /home/architech/architech_sdk/architech/hachiko/toolchain/environment-nofs
make hachiko64_defconfig
make uImage dtbs
If you are not developing from within the original SDK, you are going to need to install the cross toolchain. The output of the compilation process is:
/home/architech/Documents/kernel/arch/arm/boot/uImage
/home/architech/Documents/kernel/arch/arm/boot/dts/rza1-hachiko.dtb
A Yocto/OpenEmbedded meta-layer is a directory that contains recipes, configuration files, patches, and others things all needed by Bitbake to properly “see” and build a BSP, a distrubution, and a (set of) package(s).
meta-hachiko is stored in a git repository that can be cloned with:
git clone -b dora https://github.com/architech-boards/meta-hachiko.git
For information about Yocto, Bitbake and the directories tree inside the meta-layer, please refer to the Yocto documentation.
Hachiko/SDRAM meta-layer defines two different machines: hachiko and hachiko64, the latter to be used when an external SDRAM is available on the board. Whereas hachiko64 machine can be used for virtually any distro and image available on Yocto, hachiko machine must use a custom tailored distro and image to be able to fit in the limited amount of SRAM available on-chip. This documentation is about hachiko64 machine.
To manually select board and distribution for Bitbake, make sure that file local.conf, that in the SDK has this path:
/home/architech/architech_sdk/architech/hachiko/yocto/build/conf/local.conf
contains the assignment of these variables:
MACHINE = "hachiko64"
DISTRO = "poky"
When asked to build an image, Bitbake/Hob produces several files as output, of which these are needed to build the whole system:
Within the SDK, the files will be emitted to directory:
/home/architech/architech_sdk/architech/hachiko/yocto/build/tmp/deploy/images/hachiko64/
If you are not working with the SDK, just replace:
/home/architech/architech_sdk/architech/hachiko/yocto/build/
with your build directory path.
By default, Hachiko/SDRAM Yocto/OpenEmbedded SDK will generate two different types of files when you build an image:
The .tar.bz2 file can be expanded in your final medium partition (flash memory or USB stick) or on your host development system and used for build purposes with the Yocto Project. File .jffs2 can be written out “as is” on the final medium (usually flash NOR partition) with, for example, dd program:
sudo dd if=/path/to/image.jffs2 of=/path/to/your/USB/device
or
flashcp -v /path/to/image.jffs2 /dev/mtd4
Important
Be very careful when you use dd or flashcp to write to a device to pick up the right device
Once your (virtual/)machine has been set up you can compile, customize the BSP for your board, write and debug applications, change the file system on-the-fly directly on the board, etc. This chapter will guide you to the basic use of the most important tools you can use to build customize, develop and tune your board.
Bitbake is the most important and powerful tool available inside Yocto/OpenEmbedded. It takes as input configuration files and recipes and produces what it is asked for, that is, it can build a package, the Linux kernel, the bootloader, an entire operating system from scratch, etc.
A recipe (.bb file) is a collection of metadata used by BitBake to set variables or define additional build-time tasks. By means of 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) that executed one after the other get the job done, but a recipe can always add custom ones or override/modify existing ones. The most fine-graned operation that Bitbake can execute is, in fact, a single task.
To properly run Bitbake, the first thing you need to do is setup the shell environment. Luckily, there is a script that takes care of it, all you need to do is:
source /path/to/oe-init-build-env /path/to/build/directory
Inside the virtual machine, you can find oe-init-build-env script inside:
/home/architech/architech_sdk/architech/hachiko/yocto/poky
If you omit the build directory path, a directory named build will be created under your current working directory.
By default, with the SDK, the script is used like this:
source /home/architech/architech_sdk/architech/hachiko/yocto/poky/oe-init-build-env
Your current working directory changes to such a directory and you can customize configurations files (that the environment script put in place for you when creating the directory), run Bitbake to build whatever pops to your mind as well run hob. If you specify a custom directory, the script will setup all you need inside that directory and will change your current working directory to that specific directory.
Important
The build directory contains all the caches, builds output, temporary files, log files, file system images... everything!
The default build directory for Hachiko/SDRAM is located under:
/home/architech/architech_sdk/architech/hachiko/yocto/build
and the splash screen has a facility (a button located under Hachiko/SDRAM’s page) that can take you there with the right environment already in place so you are productive right away.
Configuration files are used by Bitbake to define variables value, preferences, etc..., there are a lot of them. At the beginning you should just worry about two of them, both located under conf directory inside your build directory, we are talking about local.conf and bblayers.conf.
local.conf contains your customizations for the build process, the most important variables you should be interested about are: MACHINE, DISTRO, BB_NUMBER_THREADS and PARALLEL_MAKE. MACHINE defines the target machine you want compile against. The proper value for Hachiko/SDRAM is hachiko64:
MACHINE ??= "hachiko64"
DISTRO let you choose which distribution to use to build the root file systems for the board. The default distribution to use with the board is:
DISTRO ?= "poky"
BB_NUMBER_THREADS and PARALLEL_MAKE can help you speed up the build process. BB_NUMBER_THREADS is used to tell Bitbake how many tasks can be executed at the same time, while PARALLEL_MAKE contains the -j option to give to make program when issued. Both BB_NUMBER_THREADS and PARALLEL_MAKE are related to the number of processors of your (virtual) machine, and should be set with a number that is two times the number of processors on your (virtual) machine. If for example, your (virtual) machine has/sees four cores, then you should set those variables like this:
BB_NUMBER_THREADS ?= "8"
PARALLEL_MAKE ?= "-j 8"
bblayers.conf is used to tell Bitbake which meta-layers to take into account when parsing/looking for recipes, machine, distributions, configuration files, bbclasses, and so on. The most important variable contained inside bblayers.conf is BBLAYERS, it’s the variable where the actual meta-layers layout get specified.
All the variables value we just spoke about are taken care of by Architech installation scripts.
With your shell setup with the proper environment and your configuration files customized according to your board and your will, you are ready to use Bitbake. The first suggestion is to run:
bitbake -h
Bitbake will show you all the options it can be run with. During normal activity you will need to simply run a command like:
bitbake <recipe name>
for example:
bitbake core-image-minimal-dev
Such a comman will build bootloader, Linux kernel and a root file system. core-image-minimal-dev tells Bitbake to execute whatever recipe
/home/architech/architech_sdk/architech/hachiko/yocto/poky/meta/recipes-extended/images/core-image-minimal-dev.bb
tells it to do, so, you just place the name of the recipe without the extension.
Of course, there are times when you want more control over Bitbake, for example, you want to execute just one task like recompiling the Linux kernel, no matter what. That action can be achieved with:
bitbake -c compile -f virtual/kernel
where -c compile states the you want to execute the do_compile task and -f forces Bitbake to execute the command even if it thinks that there are no modifications and hence there is no need to to execute the same command again.
Another useful option is -e which gets Bitbake to print the environment state for the command you ran.
The last option we want to introduce is -D, which can be in fact repeated more than once and asks Bitbake to emit debug print. The amount of debug output you get depend on many times you repeated the option.
Of course, there are other options, but the ones introduced here should give you an head start.
Hob is a graphical interface for Bitbake. It can be called once Bitbake environment has been setup (see Bitbake) like this:
Host
hob
once open, you are required to select the machine you want to compile against
after that, you can select the image you want to build and, of course, you can customize it.
Eclipse is an integrated development environment (IDE). It contains a base workspace and the Yocto plug-in system to compile and debug a program for Hachiko/SDRAM. 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.
To write your application you need:
- your board has ip address 192.168.0.10 on interface eth0, and
- your PC has an ip address in the same family of addresses, e.g. 192.168.0.100.
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 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 C/C++ perspective. The left-hand navigation panel shows your project. You can display your source by double clicking on the project 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 must be located in /home/architech/architech_sdk/architech/hachiko/sysroot subdirectories.
Connect Hachiko/SDRAM console to your PC and power-on the board. Once you built the project and the board is running the image, use minicom to run tcf-agent program in target board:
hachiko login: root
/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/hachiko/toolchain/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb
/home/architech/architech_sdk/architech/hachiko/sysroot/lib
/home/architech/architech_sdk/architech/hachiko/sysroot/usr/lib
Important
If debug does not work, check on the board if tcf-agent is running and gdbserver has been installed.
The Qt Framework used by this SDK is composed of libraries for your host machine and your target. To compile the libraries for x86 you only need your distribution toolchain, while to compile the libraries for Hachiko/SDRAM board you need the proper cross-toolchain (see Chapter Cross compiler for further information on how to get it).
This section just wants to show you how the framework has been generated.
Before to begin, keep in mind you might need to install the following package to compile yourself the libraries under Ubuntu
sudo apt-get install libxrender-dev
So, to install qt-everywhere for x86 from sources, the usual drill of download, uncompress, configure, make and make install is required:
wget http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.zip
unzip qt-everywhere-opensource-src-4.8.5.zip
cd qt-everywhere-opensource-src-4.8.5
./configure /*Choose Open source Edition when asked, and accept the license*/
make
make install
The installation of the libraries for Hachiko/SDRAM from sources is sligthly more complicated. Once you downloaded and uncompressed the sources
wget http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.zip
unzip qt-everywhere-opensource-src-4.8.5.zip
cd qt-everywhere-opensource-src-4.8.5
cp -r mkspecs/qws/linux-arm-g++/ mkspecs/qws/linux-hachiko-g++
cd mkspecs/qws/linux-hachiko-g++/
gedit qmake.conf
you need to customize qmake configuration
#
# qmake configuration for building with arm-linux-g++
#
include(../../common/linux.conf)
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
include(../../common/qws.conf)
# modifications to g++.conf
QMAKE_CC = arm-poky-linux-gnueabi-gcc --sysroot=/home/architech/architech_sdk/architech/hachiko/toolchain/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
QMAKE_CXX = arm-poky-linux-gnueabi-g++ --sysroot=/home/architech/architech_sdk/architech/hachiko/toolchain/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
QMAKE_LINK = arm-poky-linux-gnueabi-g++ --sysroot=/home/architech/architech_sdk/architech/hachiko/toolchain/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
QMAKE_LINK_SHLIB = arm-poky-linux-gnueabi-g++ --sysroot=/home/architech/architech_sdk/architech/hachiko/toolchain/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
# modifications to linux.conf
QMAKE_AR = arm-poky-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = arm-poky-linux-gnueabi-objcopy
QMAKE_STRIP = arm-poky-linux-gnueabi-strip
load(qt_config)
save the file and exit from gedit, then configure, make and make install
cd ../../../
./configure -no-pch -opensource -confirm-license -prefix /usr/local/Trolltech/Hachiko -no-qt3support -embedded arm -nomake examples -nomake demo -little-endian -xplatform qws/linux-hachiko-g++ -qtlibinfix E
make
make install
A comfortable tool to get your job done with Qt is Qt Creator, which its use will be introduced in Section Qt Creator. You can download it from here:
Note
You could build qt4e-demo-image if you want to see the demo of Qt. Just remember to complete its file system with tcf-agent, gdbserver and openssh.
/home/architech/architech_sdk/architech/hachiko/sysroot
sudo mkdir -p /path/to/board/sysroot/usr/local/Trolltech/
sudo cp -r /usr/local/Trolltech/Hachiko/* /path/to/board/sysroot/usr/local/Trolltech/
sudo mkdir -p ~/architech_sdk/architech/hachiko/sysroot/usr/local/Trolltech/
sudo cp -r /usr/local/Trolltech/Hachiko/* ~/architech_sdk/architech/hachiko/sysroot/usr/local/Trolltech
If you based your root file system on qt4e-demo-image, be sure you execute this command
/etc/init.d/qtdemo stop
to stop the execution of the demo application.
- your board has ip address 192.168.0.10 on interface eth0, and
- your PC has an ip address in the same family of addresses, e.g. 192.168.0.100.
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 Hachiko/SDRAM board.
To create the project follow these steps:
In the next section we will debug our Hello World! application directly on Hachiko/SDRAM.
scp /home/architech/architech_sdk/architech/hachiko/workspace/qt/build-QtHelloWorld-Hachiko-Debug/QtHelloWorld root@192.168.0.10:/home/root
gdbserver :10000 QtHelloWorld -qws
/home/architech/architech_sdk/architech/hachiko/workspace/qt/build-QtHelloWorld-hachiko-Debug/QtHelloWorld
Press OK button to start the debug.
Yocto/OpenEmbedded can be driven to generate the cross-toolchain for your platform. There are two common ways to get that:
bitbake meta-toolchain
or
bitbake <image recipe name> -c populate_sdk
The first method provides you the toolchain, you need to provide the file system to compile against, the second method provides both the toolchain and the file system along with -dev and -dbg packages installed.
Both ways you get an installation script.
The virtual machine has a cross-toolchain installed for each board, each generated with meta-toolchain. To use it just do:
source /home/architech/architech_sdk/architech/hachiko/toolchain/environment
to compile Linux user-space stuff. If you want to compile kernel or bootloader then do:
source /home/architech/architech_sdk/architech/hachiko/toolchain/environment-nofs
and you are ready to go.
Useful commands:
opkg update
opkg list
opkg list-installed
opkg install <package 1> <package 2> ... <package n>
opkg search <file>
opkg info <package>
opkg whatdepends <package>
opkg remove <package 1> <package 2> ... <package n>
With some images, Bitbake (e.g. core-image-minimal) does not install the package management system in the final target. To force Bitbake to include it in the next build, edit your configuration file
/home/architech/architech_sdk/architech/hachiko/yocto/build/conf/local.conf
and add this line to it:
IMAGE_FEATURES_append = " package-management"
opkg reads the list of packages repositories in configuration files located under /etc/opkg/. You can easily setup a new repository for your custom builds:
sudo apt-get install apache2
sudo ln -s /home/architech/architech_sdk/architech/hachiko/yocto/build/tmp/deploy/ipk/ /var/www/hachiko-ipk
src/gz hachiko64 http://192.168.0.100:8000/hachiko-ipk/hachiko64
To actually reach the virtual machine we set up a port forwarding mechanism in Chapter Virtual Machine so that every time the board communicates with the workstation on port 8000, VirtualBox actually turns the communication directly to the virtual machine operating system on port 80 where it finds apache waiting for it.
opkg update
This chapter introduces the board, its hardware and how to boot it.
The hardware documentation of Hachiko/SDRAM can be found here:
http://downloads.architechboards.com/doc/Hachiko/download.html
Hachiko/SDRAM takes the power from the micro-USB connector CN11 and/or the mini-USB connector CN2.
On connector CN2 you can also have the serial console, so, during your daily development use, you would just connect your workstation to the board using a mini-USB to connector CN2. If you connect some power ungry device to the board, you can give more power to the board by connecting your workstation (or a smartphone-like battery charger for example) to the board by means of a micro-USB cable to board connector CN11.
On Hachiko/SDRAM there is the dedicated serial console connector CN2
which you can connect, by means of a mini-USB 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 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:
Host
sudo dmesg -c
Host
dmesg
[ 2912.634893] usb 3-4: >new full-speed USB device number 6 using xhci_hcd
[ 2912.658153] usb 3-4: >New USB device found, idVendor=0403, idProduct=6001
[ 2912.658160] usb 3-4: >New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2912.658164] usb 3-4: >Product: Hachiko Rev. B
[ 2912.658167] usb 3-4: >Manufacturer: AVNET EMG ITALY
[ 2912.658169] usb 3-4: >SerialNumber: A6XGP6WP
[ 2912.660753] ftdi_sio 3-4:1.0: >FTDI USB Serial Device converter detected
[ 2912.660801] usb 3-4: >Detected FT232RL
[ 2912.660805] usb 3-4: >Number of endpoints 2
[ 2912.660809] usb 3-4: >Endpoint 1 MaxPacketSize 64
[ 2912.660812] usb 3-4: >Endpoint 2 MaxPacketSize 64
[ 2912.660815] usb 3-4: >Setting MaxPacketSize 64
[ 2912.661102] usb 3-4: >FTDI USB Serial Device converter now attached to ttyUSB0
As you can see, here the device has been recognized as ttyUSB0.
Now that you know the device name, run minicom:
Host
sudo minicom -ws
If minicom is not installed, you can install it with:
Host
sudo apt-get install minicom
then you can setup your port with these parameters:
+-----------------------------------------------------------------------+
| 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 |
| |
| 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 ttyUSB0, just replace ttyUSB0 with the proper device.
Once you are done configuring the serial port, you are back to minicom main menu and you can select exit.
In the latest release only bootmode 3 is supported by Hachiko/SDRAM board. That is the board boots from the serial flash memory connected to the SPI multi I/O bus. To enable bootmode 3 the jumpers J4, J5 and J6 must be respectively in position 0, 1 and 1. When set for bootmode 3, the bootloader (U-Boot) must be flashed on the serial NOR at address 0x18000000 (SPI multi I/O bus space). Hachiko/SDRAM boards already have the latest version of U-Boot flashed on SPI NOR at factory time.
For more information:
To use ULINK2, DS-5 from ARM Ltd. and binary writing tool provided from Renesas are needed. As for the way to obtain these tools, please ask Renesas electronics sales representative. After the installation of DS5 and binary writing tool, please go to the next step.
For a more detailed description of the entire process, see:
Note
To check if the board is correctly programmed, connect the board to a terminal emulator on your computer. To see how this can be achieved please refer to section serial_console_label.
If everything is setup correctly you should be able to see the bootstrap process and the U-Boot output. In particular, as soon as the board is powered a countdown is started and displayed on the serial output. If a key is pressed before the countdown expires the autoboot stops, otherwise Linux is loaded from USB or SPI NOR.
On Hachiko/SDRAM board you can boot using the USB or the serial NOR. During the boot process, if U-Boot detects a correct kernel and rootfs on the USB drive it will boot from this USB device, otherwise it will switch to SPI NOR. In case no correct linux kernel is detected, the boot stops in the U-Boot console.
For a brief documentation about U-Boot:
Booting from USB requires that an USB pen drive is prepared with all the files needed for booting Linux and that it is correctly partitioned.
Important
The only USB port that it is possible to use for booting is the USB port at the bottom of the USB connector.
The USB pen driver is required to have one single EXT2 partition with a start sector of the partition below the 63rd sector. It is possible to use tools as fdisk or cfdisk to partition the USB drive.
cfdisk /path/to/your/USB/device
As alternative it is possible to use the sfdisk tools to have the partition correctly aligned to the first sector:
sfdisk /path/to/your/USB/device << EOF
0,
EOF
mkfs.ext2 /path/to/your/USB/device/partition
When booting from USB, U-Boot expects to find a valid single EXT2 partition in the USB pen drive containing the rootfs. Moreover U-Boot needs to find in /boot directory a valid kernel image and a valid DTB file respectively named uImage and rza1-hachiko.dtb.
When using Yocto to generate the rootfs we need to extract the compressed rootfs found in
/home/architech/architech_sdk/architech/hachiko/yocto/build/tmp/deploy/images/hachiko64
in the partition on the USB and copy the kernel in /boot/uImage and DTB file in /boot/rza1-hachiko.dtb.
Briefly, to have a bootable USB stick after having compiled an image with Yocto:
- Create one EXT2 partition in the USB stick
- Extract the content of your .tar.bz2 rootfs tarball file in the EXT2 partition
- Copy uImage to /boot
- Copy uImage-rza1-hachiko.dtb to /boot and rename it as rza1-hachiko.dtb
At this point it is possible to boot Linux by inserting the USB pen drive in the correct USB port and power on the board.
When no USB device is attached or the kernel image is not valid, U-Boot tries to boot from SPI NOR. In Hachiko/SDRAM board the NOR is required to contain all the needed files in the first serial flash memory on channel 0.
Note
A valid NOR Linux image is programmed at factory time in Hachiko/SDRAM NOR, so it is possible to start using Hachiko/SDRAM board right away.
The serial flash memory is divided into 5 partitions according to the following scheme (the base address is 0x18000000):
0x18000000-0x18080000 spibsc0_loader (offset: 0x00000000)
0x18080000-0x180c0000 spibsc0_bootenv (offset: 0x00080000)
0x180c0000-0x184c0000 spibsc0_kernel (offset: 0x000c0000)
0x184c0000-0x18500000 spibsc0_dtb (offset: 0x004c0000)
0x18500000-0x1c000000 spibsc0_rootfs (offset: 0x00500000)
spibsc0_loader: contains u-boot (u-boot.bin)
spibsc0_bootenv: contains u-boot environment
spibsc0_kernel: contains the Linux kernel (uImage)
spibsc0_dtb: contains the DTB file (rza1-hachiko.dtb)
spibsc0_rootfs: contains the rootfs
To write in NOR and replace or update the content of the NOR partitions you can go through U-Boot or Linux. It is strongly recommended to use Linux for writing new data in NOR partitions, especially when no external SDRAM is available.
Using U-Boot for writing or updating data in SPI NOR is not advisable especially when no external SDRAM is available.
Warning
The operation is prone to failure, use it at your own risk.
The process of writing data in serial NOR using U-Boot goes through 3 main steps: 1) load the file to write in a temporary RAM location, 2) erase data on the NOR partition and 3) write the new data.
usb start
ext2load usb 0 0x0c000000 /path/to/your/u-boot.bin
The output from the command is also the size of the file loaded, info useful for step (3).
RAM ranges:
0x0c000000 - 0x10000000
Please, note that while spibsc0_loader, spibsc0_kernel, and spibsc0_dtb partitions of the flash memory contain raw data respectively for u-boot.bin, uImage and rza1-hachiko.dtb, whereas partition spibsc0_rootfs contains raw data for the filesystem that, in our case, is a JFFS2 image. That is, when writing a new rootfs in spibsc0_rootfs partition it is needed to use the image file .jffs2 generated by Yocto.
sf erase $OFFSET $SIZE
where $OFFSET is the partition offset and $SIZE its size in bytes.
sf write $RAM_ADDR $OFFSET $SIZE
where $RAM_ADDR is the temporary RAM location holding our file (tipically 0x0c000000), $OFFSET is the partition offset and $SIZE is the file size in bytes as obtained by the output of the comman ext2load in step (1).
For more informations about flash managing with U-Boot refer to:
To use linux for writing or updating data on the serial NOR you are going to need MTD utils. It is possible to compile a small image containing the MTD utils with Yocto by means, for example, of image core-image-minimal-mtdutils that can be generated by Bitbake with this command line:
bitbake core-image-minimal-mtdutils
In Linux, the process is made easier by the MTD framework that remap each NOR partition to a different device file. In particular:
/dev/mtd0: spibsc0_loader
/dev/mtd1: spibsc0_bootenv
/dev/mtd2: spibsc0_kernel
/dev/mtd3: spibsc0_dtb
/dev/mtd4: spibsc0_rootfs
Again the process goes through 2 steps: (1) erasing the content of the serial NOR partition and (2) write the new data.
flash_erase /path/to/your/mtd/device 0 0
This command completely erases the content of the partition. For the root file system the command is slightly different, since being spibsc0_rootfs a JFFS2 partition, it requires proper formatting, so for mtd4 device you need to run this command:
flash_erase -j /dev/mtd4 0 0
flashcp -v /path/to/your/file /path/to/your/mtd/device
For rootfs we have two different ways to write data in spibsc0_rootfs partition:
flashcp -v /path/to/your/image/file.jffs2 /dev/mtd4
mount -t jffs2 mtd4 /mnt/
tar xv -C /mnt/ -f /path/to/your/image/file.tar.bz2
umount /mnt/
For more information on how to manage flash storage with Linux:
The network PHY is provided by Renesas’s chip 60610 (U6). Within Linux, you can see the network interface as eth0.
The password for the default user, that is architech, is:
Host
architech
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, architech (the default user of the virtual machine) user is a sudoer. When you run a command preceeded by sudo Linux will ask you the user password, for architech user the password is architech.
By default, Ubuntu 12.04 32bit comes with no password defined for roor user, to set it run the following command:
Host
sudo passwd root
Linux will ask you (twice, the second time is just for confirmation) to write the password for user root.
Switching from hachiko to hachiko/SDRAM or viceversa (adding or removing the external SDRAM) is a delicate operation that involves flashing a new U-Boot and using a new Kernel. To flash a new U-Boot it is needed to follow Section Write to NOR, writing the new U-Boot from the U-Boot itself or from Linux. After the first boot with the new U-Boot it is always suggested to give the following commands to reset the U-Boot environment stored in the second partition of the serial NOR:
env default -a
saveenv
and reboot the board.
Also the Linux kernel must be recompiled for the new configuration and substituted to the old one in the USB pend drive or in the NOR.
Hachiko kernel uses two parameters passed by U-Boot at boot time to enable / disable / configure the framebuffer. These two parameters are vdc5fb0 for channel 0 and vdc5fb1 for channel 1 of the video display controller.
The default value for these parameters is:
hachiko/SDRAM:
Board
vdc5fb0=3 vdc5fb1=4
Hachiko:
Board
vdc5fb0=0 vdc5fb1=0
The meaning of the values are here reported:
Channel 0 (vdc5fb0):
- (0) unuse
- (1) / (2) reserved for RZARSK dev board
- (3) LCD parallel out enabled
Channel 1 (vdc5fb1):
- (0) unuse
- (1) / (2) / (3) reserved for RZARSK dev board
- (4) LVDS output
It is possible to modify the default setting in U-Boot with the command:
Board
env set fbparam vdc5fb0=$B vdc5fb1=$A
with $A and $B the new set of parameters. To make the configuration permanent:
Board
saveenv
Note
For the hachiko board without external SDRAM the usage of framebuffer can result in instability if not used with care.
The default kernel shipped has the following default resolutions:
LCD parallel out:
480x272
LVDS output:
800x480
to change them the file arch/arm/mach-shmobile/rskrza1-vdc5fb.c must be modified. Specifically the two structures containing the screen timings are:
Channel 0 (parallel LCD):
struct fb_videomode videomode_wqvga_lcd_kit
Channel 1 (LVDS):
struct fb_videomode videomode_lvds