Skip to content

gitMelk/viggen-two

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Viggen Two Build Yocto release

ViggenTwo - Yocto fsl-4.1.15-1.2.0 Jethro Build Yocto release


Contents

1 Build host setup

In order to setup a Linux-based host check the following link and install all required packages on your machine:

www.yoctoproject.org/docs/latest/yocto-project-qs/yocto-project-qs.html

For Ubuntu machine the following commands could be issued:

sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev xterm lib32ncurses5-dev
sudo apt-get install uuid-dev

Please note that Bluewind Yocto Project was tested with Ubuntu 15.10 only.

2 V2-DevKit

The V2-DevKit is designed specifically to accommodate the Viggen Two SOM and offers a wide range of connectivity through the standard radio and wired interfaces. The board allows the developer to program and debug the Viggen TWO SOM through μUSB interface or standard JTAG connector, while the power supply is fed via a standard AC/DC adapter with μUSB connector (mobile phone standard).

Please refer to the following picture for the connector's names.

V2-Carrier

2.1 Boot configuration

SW4 DIP SWITCH

D1/MODE1 D2/MODE0 BOOT MODE
OFF OFF Boot From Fuses
OFF ON Serial Downloader
ON OFF Internal Boot
ON ON Reserved

SW3 DIP SWITCH

D1 D2 D3 D4 BOOT DEVICE
OFF OFF OFF OFF QSPI
OFF ON ON OFF eMMC

3 Environment setup

3.1 Git and repo utility setup

git config --global user.name "Your Name"
git config --global user.email "Your Email"

mkdir ~/bin (this step may not be needed if the bin folder already exists)
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
export PATH=~/bin:$PATH

3.2 Yocto Jethro source download

mkdir bw-release-bsp
cd bw-release-bsp
repo init -u https://github.com/bluewind-embedded-systems/bw-arm-yocto-bsp.git -b imx-4.1.15-1.0.0_ga_viggentwo
repo sync

3.3 Source patching

Qemo build could fail depending on used Linux flavour (e.g. Ubuntu 15.10 beta).

In case of build failure due to the following error:

| ERROR: User requested feature sdl
|        configure was not able to find it.
|        Install SDL devel

go to bw-release-bsp/sources/poky/meta/recipes-devtools/qemu and replace it with qemu.inc

For more info about this bug see the Bug 8553 - qemu-native to build on Ubuntu 15.10

4 Yocto setup and build

Yocto distribution allows the development of several image configurations, from light minimal to full-featured system image.

Following paragraphs depict required steps to build:

4.1 Local configuration tuning

Several local.conf parameters can be tuned to properly optimize build resources: refer to the Yocto Reference Manual for detailed explanations.

Take the following hints as rule of thumb to boost the build process.

  • Edit you local.conf file:
gedit conf/local.conf
  • Change parallel build and download directory. Set the build parameters to fully utilize your host machine's resources
BB_NUMBER_THREADS = '4'
PARALLEL_MAKE = '-j 6'

BB_NUMBER_THREADS should be your host machine's number of threads minus 2 or same.
PARALLEL_MAKE should be the number of threads your host machine has plus two.

  • Change packages download directory. By default it is set to:
DL_DIR ?= "${BSPDIR}/downloads/"

change it to a global folder like

DL_DIR ?= "/opt/yocto_dl/".
  • Don't forget to create the folder and make it available without a sudo permissions.

4.2 Setup to build Yocto Minimal Image

Setup the environment and use build_var folder
Please note: Run only once!

cd bw-release-bsp
DISTRO=fsl-imx-fb MACHINE=imx6ulviggentwo source fsl-setup-release.sh -b build-minimal-viggentwo
bitbake core-image-minimal

The full fsl-setup-release.sh is not needed in case of terminal or host restart. To properly setup and build Yocto, you should execute:

source setup-environment build-minimal-viggentwo
bitbake core-image-minimal

4.3 Setup to build Yocto X11 Image

Setup the environment and use build_var folder
Please note: Run only once!

DISTRO=fsl-imx-x11 MACHINE=imx6ulviggentwo source fsl-setup-release.sh -b build-x11-viggentwo
bitbake fsl-image-gui 

In case of terminal or host restart please use setup-environment setup script.

4.4 Setup to build Yocto Java Test Image

4.4.1 Prerequisites

Go to bw-release-bsp/sources , right click on a blank space of this folder and click on "Open in Terminal"

 git clone git://git.yoctoproject.org/meta-java

Close this Terminal now, we won't need it anymore.

In bw-release-bsp/sources/poky/meta/classes please create a new file named "remove-libtool.bbclass" with this content:

# This class removes libtool .la files after do_install

REMOVE_LIBTOOL_LA ?= "1"

remove_libtool_la() {
   if [ "${REMOVE_LIBTOOL_LA}" != "0" ]; then
      find "${D}" -ignore_readdir_race -name "*.la" -delete
   fi
}

do_install[postfuncs] += "remove_libtool_la"

Go to bw-release-bsp/build-Java-test-Image-viggentwo/conf, open bblayers.conf and add this line at the end of it:

 BBLAYERS += " ${BSPDIR}/sources/meta-java "

4.4.2 Image build

Setup the environment and use build_var folder
Please note: Run only once!

DISTRO=fsl-imx-x11 MACHINE=imx6ulviggentwo source fsl-setup-release.sh -b build-Java-test-Image-viggentwo
bitbake java-test-image

In case of terminal or host restart please use setup-environment setup script.

4.5 Setup to build Yocto Qt4 Demo Image

Setup the environment and use build_var folder
Please note: Run only once!

DISTRO=fsl-imx-x11 MACHINE=imx6ulviggentwo source fsl-setup-release.sh -b build-Qt4-demo-image
bitbake qt4e-demo-image

In case of terminal or host restart please use setup-environment setup script.

4.6 Useful Bitbake commands

Bitbake Cheat Sheet

Useful bitbake commands

i.MX Yocto Project: ltib versus bitbake

5 Build outputs

Images resulting from the build process are located in tmp/deploy/images/imx6ulviggentwo/.

Looking at this folder you will find five main files:

  • depending on your build version:
Version Image Name How to use
Yocto Minimal Image core-image-minimal-imx6ulviggentwo.sdcard See the mfgtool guide, or use the command dd to mount it on a sd card.
core-image-minimal-imx6ulviggentwo.tar.bz2 Used to create an root file system on the host.
Yocto X11 fsl-image-gui-imx6ulviggentwo.sdcard See the mfgtool guide, or use the command dd to mount it on a sd card.
fsl-image-gui-imx6ulviggentwo.tar.bz2 Used to create an root file system on the host.
Java Test Image java-test-image-imx6ulviggentwo.sdcard See the mfgtool guide, or use the command dd to mount it on a sd card.
java-test-image-imx6ulviggentwo.tar.bz2 Used to create an root file system on the host.
Yocto Qt4 Demo Image qt4e-demo-image-imx6ulviggentwo.sdcard See the mfgtool guide, or use the command dd to mount it on a sd card
qt4e-demo-image-imx6ulviggentwo.tar.bz2 Used to create an root file system on the host.
  • Kernel and boot
Image Name How to use
zImage Linux kernel image
u-boot-emmc-2015.04-r0.img u-boot built for eMMC boot.
Device Tree Name Boot Device
zImage-imx6ul-viggentwo.dtb Device tree with default setup of ViggenTwo eval board.

6 Image deploy

6.1 eMMC programming

6.1.1 MFGTool download

NXP's Manufacturing Tool can be used to flash the device.

Download the mfgtool and unzip it to whatever folder.

Please note that Bluewind Yocto build was tested on Windows 10 Edu x64.

6.1.2 Hardware setup

Please refer to the V2-DevKit block diagram for the connector's names used in the following instructions.

In order to download the images to the eMMC with MFGTOOL, it's necessary to change the boot option of the iMX processor from internal to serial downloader.

  • Move pin 1 of SW4 in ON position and pin 2 of SW4 in OFF position.
  • Power on the board connecting a 5V 2A µUSB power supply adapter on PWRIN connector.
  • Connect the manufacturing host PC to the V2-DevKit through a µUSB cable. Connect the µUSB side to USB-OTG connector and the other side to PC’s USB host port.
  • Check if the ViggenTwo board is recognized as “HID compatible device”.

HID-Device

6.1.3 MFGTool setup

Rename the generated images here and copy them following the table:

Original file name Renamed Where to copy
u-boot-emmc-2015.04-r0.imx u-boot-imx6ulviggentwo_emmc.imx Profiles\Linux\OS Firmware\files
zImage--4.1.15-r0-imx6ulviggentwo-xxxxxxxxxxxxxx.bin zImage (Yes, without extension) Profiles\Linux\OS Firmware\files
zImage--4.1.15-r0-imx6ul-viggentwo-xxxxxxxxxxxxxx.dtb zImage-imx6ul-viggentwo-emmc.dtb Profiles\Linux\OS Firmware\files
core-image-minimal-imx6ulviggentwo-xxxxxxxxxxxxxx.rootfs.tar.bz2 rootfs.tar.bz2 Profiles\Linux\OS Firmware\files

NOTE 1: xxxxxxxxxxxxxx is the date of the day you compiled
NOTE 2: core-image-minimal-imx6ulviggentwo-xxxxxxxxxxxxxx.rootfs.tar.bz2 is just an example, required files depend on your image build:
java-test-image-imx6ulviggentwo-xxxxxxxxxxxxxx.rootfs.tar.bz2
fsl-image-gui-imx6ulviggentwo-xxxxxxxxxxxxxx.rootfs.tar.bz2
qt4e-demo-image-imx6ulviggentwo-xxxxxxxxxxxxxx.rootfs.tar.bz2

6.1.4 Image programming

MFGTOOLS

  • Search for the mfgtool2-yocto-mx-viggentwo-sd2_eMMC.vbs script and execute it.
  • Press the GUI "Start" button.
  • Wait until the end of process.
  • Detach the USB-Device cable.
  • Power off the board disconnecting the power supply cable.
  • Change the boot configuration into "Internal boot" by moving pin 1 of SW4 in OFF position and pin 2 of SW4 in ON position.
  • Connect a USB cable into "DEBUG UART uUSB Connector" to a terminal host PC.
  • Open a terminal client application (e.g. Putty, minicom, TeraTerm). Setup the proper COM port with 115200-8-N-1 standard settings.
  • Power on the board.

If the device has been properly flashed, boot process output and Linux console should be visible. Depending on the deployed images, proper GUI or graphical content could be displayed on the LCD screen.

About

Viggen Two Resource Guide

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%