Building Freescale’s Community Yocto BSP for the iMX233-OLinuXino

This tutorial is based on https://github.com/Freescale/fsl-community-bsp-platform.

Basics

BSP = Board Support Package

Yocto Project™: http://www.yoctoproject.org/about

The Yocto Project is a Linux Foundation workgroup whose goal is to produce tools and processes that will enable the creation of Linux distributions for embedded software that are independent of the underlying architecture of the embedded software itself. The project was announced by the Linux Foundation in 2010. In March 2011, the project aligned itself with OpenEmbedded, an existing framework with similar goals, with the result being The OpenEmbedded-Core Project.

—Source: https://en.wikipedia.org/wiki/Yocto_Project

OpenEmbedded: http://www.openembedded.org/wiki/Main_Page

OpenEmbedded is a software framework to create Linux distributions aimed for, but not restricted to, embedded devices. The build system is based on BitBake recipes, which behaves like Gentoo’s ebuilds. The OpenEmbedded-Core Project (OE-Core for short) resulted from the merge of the Yocto Project with OpenEmbedded.

—Source: https://en.wikipedia.org/wiki/OpenEmbedded

Step by Step

Install the repo utility

[chris@thinkpad ~]$ curl --create-dirs -o ~/bin/repo https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
[chris@thinkpad ~]$ chmod a+x ~/bin/repo

The ~/bin directory should have been added already to your $PATH, Ubuntu adds it in ~/.profile and Fedora in ~/.bash_profile, if this is not the case you can add the following line in your ~/.bashrc:

PATH=$PATH:$HOME/.local/bin:$HOME/bin

Initialize your working directory

[chris@thinkpad OLinuXino]$ mkdir fsl-community-bsp
[chris@thinkpad OLinuXino]$ cd fsl-community-bsp
[chris@thinkpad fsl-community-bsp]$ repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b daisy
Get https://gerrit.googlesource.com/git-repo
remote: Counting objects: 117, done
remote: Finding sources: 100% (117/117)
remote: Total 2958 (delta 1550), reused 2958 (delta 1550)
Receiving objects: 100% (2958/2958), 2.52 MiB | 95.00 KiB/s, done.
Resolving deltas: 100% (1550/1550), done.
From https://gerrit.googlesource.com/git-repo
 * [new branch]      maint      -> origin/maint
 * [new branch]      master     -> origin/master
 * [new branch]      stable     -> origin/stable
 * [new tag]         v1.0       -> v1.0
...
 * [new tag]         v1.9.4     -> v1.9.4
 * [new tag]         v1.9.5     -> v1.9.5
 * [new tag]         v1.9.6     -> v1.9.6
Get https://github.com/Freescale/fsl-community-bsp-platform
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:05 --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found
Server does not provide clone.bundle; ignoring.
remote: Counting objects: 202, done.
remote: Total 202 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (202/202), 32.40 KiB | 11.00 KiB/s, done.
Resolving deltas: 100% (61/61), done.
From https://github.com/Freescale/fsl-community-bsp-platform
 * [new branch]      daisy      -> origin/daisy
 * [new branch]      danny      -> origin/danny
 * [new branch]      denzil     -> origin/denzil
 * [new branch]      dizzy      -> origin/dizzy
 * [new branch]      dora       -> origin/dora
 * [new branch]      dylan      -> origin/dylan
 * [new branch]      master     -> origin/master
 * [new branch]      master-next -> origin/master-next
 * [new tag]         1.2        -> 1.2
 * [new tag]         1.4        -> 1.4
 * [new tag]         1.5        -> 1.5
 * [new tag]         1.6        -> 1.6
 * [new tag]         1.7        -> 1.7

Your identity is: Christian Jann <christian.jann@ymail.com>
If you want to change this, please re-run 'repo init' with --config-name

repo has been initialized in /mnt/data/data/Projects/OLinuXino/fsl-community-bsp
[chris@thinkpad fsl-community-bsp]$ repo sync
Fetching project poky
Fetching project meta-fsl-arm
Fetching project meta-fsl-arm-extra
Fetching project meta-openembedded
remote: Counting objects: 1972, done.
remote: Compressing objects: 100% (774/774), done.
remote: Counting objects: 8657, done.
remote: Compressing objects: 100% (3203/3203), done.
remote: Counting objects: 43732, done.
remote: Compressing objects: 100% (17472/17472), done.
remote: Total 1972 (delta 1011), reused 1956 (delta 1002)
Receiving objects: 100% (1972/1972), 1.69 MiB | 136.00 KiB/s, done.
Resolving deltas: 100% (1011/1011), done.
From git://github.com/Freescale/meta-fsl-arm-extra
 * [new branch]      daisy      -> freescale/daisy
 * [new branch]      danny      -> freescale/danny
 * [new branch]      denzil     -> freescale/denzil
...
 * [new tag]         1.6        -> 1.6
 * [new tag]         1.7        -> 1.7
Fetching projects:  16% (1/6)  Fetching project fsl-community-bsp-base
remote: Counting objects: 199, done.
remote: Total 199 (delta 0), reused 0 (delta 0)
remote: Counting objects: 252480, done.
remote: Compressing objects: 100% (62766/62766), done.
Receiving objects: 100% (199/199), 35.93 KiB | 8.00 KiB/s, done.
Resolving deltas: 100% (115/115), done.
From git://github.com/Freescale/fsl-community-bsp-base
 * [new branch]      daisy      -> freescale/daisy
 * [new branch]      danny      -> freescale/danny
 * [new branch]      denzil     -> freescale/denzil
...
 * [new tag]         1.5        -> 1.5
 * [new tag]         1.6        -> 1.6
 * [new tag]         1.7        -> 1.7
Fetching projects:  33% (2/6)  Fetching project meta-fsl-demos
remote: Counting objects: 846, done.
remote: Compressing objects: 100% (375/375), done.
remote: Total 846 (delta 419), reused 834 (delta 412)
Receiving objects: 100% (846/846), 228.95 KiB | 33.00 KiB/s, done.
Resolving deltas: 100% (419/419), done.
From git://github.com/Freescale/meta-fsl-demos
 * [new branch]      daisy      -> freescale/daisy
 * [new branch]      danny      -> freescale/danny
 * [new branch]      denzil     -> freescale/denzil
...
 * [new tag]         1.5        -> 1.5
 * [new tag]         1.6        -> 1.6
 * [new tag]         1.7        -> 1.7
remote: Total 43732 (delta 26117), reused 40862 (delta 24220)
Receiving objects: 100% (43732/43732), 21.65 MiB | 55.00 KiB/s, done.
Resolving deltas: 100% (26117/26117), done.MiB | 158.00 KiB/s
From git://git.openembedded.org/meta-openembedded152.00 KiB/s
 * [new branch]      daisy      -> oe/daisy
 * [new branch]      daisy-next -> oe/daisy-next
 * [new branch]      danny      -> oe/danny
...
 * [new branch]      jansa/master -> oe/jansa/master
 * [new branch]      master     -> oe/master
 * [new branch]      master-next -> oe/master-next
remote: Total 8657 (delta 5261), reused 8477 (delta 5081)
Receiving objects: 100% (8657/8657), 37.60 MiB | 140.00 KiB/s, done.
Resolving deltas: 100% (5261/5261), done.
From git://git.yoctoproject.org/meta-fsl-arm43 MiB | 180.00 KiB/s
 * [new branch]      1.4_M3     -> yocto/1.4_M3
 * [new branch]      1.4_M5     -> yocto/1.4_M5
 * [new branch]      daisy      -> yocto/daisy
...
 * [new tag]         1.5        -> 1.5
 * [new tag]         1.6        -> 1.6
 * [new tag]         1.7        -> 1.7
remote: Total 252480 (delta 184881), reused 252025 (delta 184427)
Receiving objects: 100% (252480/252480), 106.79 MiB | 274.00 KiB/s, done.
Resolving deltas: 100% (184881/184881), done.
From git://git.yoctoproject.org/poky
 * [new branch]      1.1_M1     -> yocto/1.1_M1
 * [new branch]      1.1_M2     -> yocto/1.1_M2
 * [new branch]      1.1_M3     -> yocto/1.1_M3
...
 * [new tag]         yocto-1.6.2 -> yocto-1.6.2
 * [new tag]         yocto-1.7  -> yocto-1.7
 * [new tag]         yocto_1.5_M5.rc8 -> yocto_1.5_M5.rc8
Fetching projects: 100% (6/6), done.
Syncing work tree: 100% (6/6), done.

[chris@thinkpad fsl-community-bsp]$

Setup the build environment

Have a look at the fsl-community-bsp/sources/meta-fsl-arm-extra/conf/machine/ directory, there are some example configurations, to use the configuration for the OLinuXino-Micro we have to run the following command:

[chris@thinkpad fsl-community-bsp]$ MACHINE=imx233-olinuxino-micro . ./setup-environment build
Configuring for imx233-olinuxino-micro

Some BSPs depend on libraries and packages which are covered by Freescale's
End User License Agreement (EULA). To have the right to use these binaries in
your images, you need to read and accept the following...

LA_OPT27 v4 June 2013

FREESCALE SEMICONDUCTOR SOFTWARE LICENSE AGREEMENT

IMPORTANT. Read the following Freescale Semiconductor Software
License Agreement ("Agreement") completely. By selecting the
"I Accept" button at the end of this page, you indicate that
you accept the terms of this Agreement. You may then
download the file.

...

Do you accept the EULA you just read? (y/n) y
EULA has been accepted.

Welcome to Freescale Community BSP

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 can now run 'bitbake <target>'

Common targets are:
    core-image-minimal
    meta-toolchain
    meta-toolchain-sdk
    adt-installer
    meta-ide-support

Your build environment has been configured with:

    MACHINE=imx233-olinuxino-micro
    SDKMACHINE=i686
    DISTRO=poky
    EULA=1
[chris@thinkpad build]$

Prefetch all the packages

You can fetch all packages at once if you have a fast internet connection at work/university and then build it at home:

[chris@thinkpad build]$ bitbake -c fetchall core-image-minimal
Loading cache: 100% |#########################################| ETA:  00:00:00
Loaded 1827 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.22.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Fedora-20"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "imx233-olinuxino-micro"
DISTRO            = "poky"
DISTRO_VERSION    = "1.6.2"
TUNE_FEATURES     = "armv5 thumb dsp"
TARGET_FPU        = "soft"
meta
meta-yocto        = "(nobranch):1e668ccf1a05c5d730de9747bc1c2b0446bda556"
meta-oe           = "(nobranch):d3d14d3fcca7fcde362cf0b31411dc4eea6d20aa"
meta-fsl-arm      = "(nobranch):9bc540eec9a7e280af13371ea70650fcc47ea627"
meta-fsl-arm-extra = "(nobranch):e1085deb3d915d2a95a65cceadc77c6de0dadfb6"
meta-fsl-demos    = "(nobranch):f141c7d1158b8addbd6f1ed047a1b47c2ed85f8f"

NOTE: Preparing runqueue
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 170 tasks of which 168 didn't need to be rerun and all succeeded.
[chris@thinkpad build]$

You can do the same for the base image bitbake -c fetchall core-image-base.

Sometimes not all packages get fetched and will be downloaded later, u-boot and elftosb for example.

You may also want to specify the maximum number of concurrent tasks in build/conf/local.conf, if you have a slow network connection you may get download failures with the default of 4 concurrent downloads.

[chris@thinkpad build]$ tail -n2 conf/local.conf
PARALLEL_MAKE     = "-j2"
BB_NUMBER_THREADS = "1"
[chris@thinkpad build]$

Build the SD card image

Now we can build the SD card image, this needs around 15 GB of disk space and takes nearly 2 hours:

[chris@thinkpad build]$ bitbake -v core-image-minimal 2>&1 | tee output-bitbake.txt
Loading cache...done.
Loaded 1827 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies
NOTE: selecting pigz-native to satisfy gzip-native due to PREFERRED_PROVIDERS
NOTE: selecting pseudo-native to satisfy virtual/fakeroot-native due to PREFERRED_PROVIDERS
NOTE: selecting linux-fslc to satisfy virtual/kernel due to PREFERRED_PROVIDERS
NOTE: selecting opkg-native to satisfy opkg-native due to PREFERRED_PROVIDERS
NOTE: selecting opkg-utils-native to satisfy virtual/update-alternatives-native due to PREFERRED_PROVIDERS
NOTE: selecting u-boot-fslc to satisfy u-boot due to PREFERRED_PROVIDERS
NOTE: selecting eglibc to satisfy runtime libsegfault due to PREFERRED_PROVIDER_virtual/libc = eglibc
NOTE: selecting eglibc to satisfy runtime eglibc-dev due to PREFERRED_PROVIDER_virtual/libc = eglibc
NOTE: selecting eglibc to satisfy runtime eglibc due to PREFERRED_PROVIDER_virtual/libc = eglibc
NOTE: selecting linux-fslc to satisfy runtime kernel-base due to PREFERRED_PROVIDER_virtual/kernel = linux-fslc
NOTE: selecting linux-fslc to satisfy runtime kernel-image due to PREFERRED_PROVIDER_virtual/kernel = linux-fslc
NOTE: selecting u-boot-fslc to satisfy runtime u-boot-fslc-dev due to PREFERRED_PROVIDER_virtual/bootloader = u-boot-fslc
NOTE: selecting u-boot-fslc to satisfy runtime u-boot-fslc due to PREFERRED_PROVIDER_virtual/bootloader = u-boot-fslc
NOTE: selecting eglibc-locale to satisfy runtime glibc-gconv-ibm850-native due to PREFERRED_PROVIDER_virtual/libc-locale = eglibc-locale
NOTE: selecting eglibc-locale to satisfy runtime glibc-gconv-ibm437-native due to PREFERRED_PROVIDER_virtual/libc-locale = eglibc-locale
...
NOTE: recipe core-image-minimal-1.0-r0: task do_rootfs: Succeeded
NOTE: Running noexec task 1837 of 1837 (ID: 10, /mnt/data/data/Projects/OLinuXino/fsl-community-bsp/sources/poky/meta/recipes-core/images/core-image-minimal.bb, do_build)
NOTE: Tasks Summary: Attempted 1837 tasks of which 189 didn't need to be rerun and all succeeded.
[chris@thinkpad build]$

The file output-bitbake.txt contains the full build log and has a size of around 95 MB.

The generated SD card image core-image-minimal-imx233-olinuxino-micro-*.rootfs.sdcard is available under tmp/deploy/images/imx233-olinuxino-micro/ and has a size of 80 megabytes, which is a lot smaller than the default Arch Linux ARM image.

[chris@thinkpad build]$ ls -lh tmp/deploy/images/imx233-olinuxino-micro/ | awk '{print $5, $9}'

64M core-image-minimal-imx233-olinuxino-micro-20141208114427.rootfs.ext3
756 core-image-minimal-imx233-olinuxino-micro-20141208114427.rootfs.manifest
80M core-image-minimal-imx233-olinuxino-micro-20141208114427.rootfs.sdcard
2.3M core-image-minimal-imx233-olinuxino-micro-20141208114427.rootfs.tar.bz2
234K core-image-minimal-imx233-olinuxino-micro-20141208114427.rootfs.uboot.mxsboot-sdcard
68 core-image-minimal-imx233-olinuxino-micro.ext3
72 core-image-minimal-imx233-olinuxino-micro.manifest
70 core-image-minimal-imx233-olinuxino-micro.sdcard
71 core-image-minimal-imx233-olinuxino-micro.tar.bz2
84 core-image-minimal-imx233-olinuxino-micro.uboot.mxsboot-sdcard
2.6M modules--3.14+git0+00e472111a-r0-imx233-olinuxino-micro-20141208114427.tgz
74 modules-imx233-olinuxino-micro.tgz
294 README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt
44 u-boot-imx233-olinuxino-micro.sb
232K u-boot-imx233-olinuxino-micro-v2014.01-r0.sb
44 u-boot.sb
73 uImage
3.5M uImage--3.14+git0+00e472111a-r0-imx233-olinuxino-micro-20141208114427.bin
9.1K uImage--3.14+git0+00e472111a-r0-imx23-olinuxino-20141208114427.dtb
73 uImage-imx233-olinuxino-micro.bin
66 uImage-imx23-olinuxino.dtb
[chris@thinkpad build]$

Copy the file system image to the SD card and boot it

Now we can test our newly created image on the hardware, just use dd to write the new image to the SD card:

[chris@thinkpad build]$ sudo dd if=tmp/deploy/images/imx233-olinuxino-micro/core-image-minimal-imx233-olinuxino-micro-20141208114427.rootfs.sdcard of=/dev/mmcblk0 bs=1M
80+0 records in
80+0 records out
83886080 bytes (84 MB) copied, 10.7145 s, 7.8 MB/s
[chris@thinkpad build]$

You can check the partition layout, resize the root partition and create a swap partition if you want.

[chris@thinkpad build]$ sudo fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 3.7 GiB, 3980394496 bytes, 7774208 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00088fff

Device         Boot     Start       End Blocks  Id System
/dev/mmcblk0p1           2048      4095   1024  53 OnTrack DM6 Aux3
/dev/mmcblk0p2           4096     24575  10240  83 Linux
/dev/mmcblk0p3          24576    155647  65536  83 Linux

[chris@thinkpad build]$

And it boots fine:

[chris@thinkpad ~]$ minicom oli
Welcome to minicom 2.6.2

OPTIONS: I18n
Compiled on Aug  7 2013, 13:32:48.
Port /dev/ttyUSB0, 17:30:27

Press CTRL-A Z for help on special keys

HTLCLC

U-Boot 2014.01 (Dec 08 2014 - 14:26:40)

CPU:   Freescale i.MX23 rev1.4 at 454 MHz
BOOT:  SSP SD/MMC #0
DRAM:  64 MiB
MMC:   MXS MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot:  0
mmc0 is current device
reading boot.scr
** Unable to read file boot.scr **
reading uImage
3585504 bytes read in 1069 ms (3.2 MiB/s)
Booting from mmc ...
reading imx23-olinuxino.dtb
9270 bytes read in 28 ms (323.2 KiB/s)
## Booting kernel from Legacy Image at 42000000 ...
   Image Name:   Linux-3.14.19-fslc+g00e4721
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3585440 Bytes = 3.4 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 41000000
   Booting using the fdt blob at 0x41000000
   Loading Kernel Image ... OK
   Loading Device Tree to 43b64000, end 43b69435 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 3.14.19-fslc+g00e4721 (chris@thinkpad) (gcc version 4.8.2 (GCC) ) #1 Mon Dec 8 13:49:20 CET 2014
[    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine model: i.MX23 Olinuxino Low Cost Board
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyAMA0,115200 root=/dev/mmcblk0p3 rw rootwait
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Memory: 52228K/65536K available (4808K kernel code, 295K rwdata, 1820K rodata, 226K init, 5481K bss, 13308K reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xc4800000 - 0xff000000   ( 936 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc4000000   (  64 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0681450   (6630 kB)
[    0.000000]       .init : 0xc0682000 - 0xc06bab94   ( 227 kB)
[    0.000000]       .data : 0xc06bc000 - 0xc0705f90   ( 296 kB)
[    0.000000]        .bss : 0xc0705f90 - 0xc0c60668   (5482 kB)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] of_irq_init: children remain, but no parents
[    0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836480000000ns
[    0.000000] Console: colour dummy device 80x30
[    0.000000] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
[    0.000000] ... MAX_LOCKDEP_SUBCLASSES:  8
[    0.000000] ... MAX_LOCK_DEPTH:          48
[    0.000000] ... MAX_LOCKDEP_KEYS:        8191
[    0.000000] ... CLASSHASH_SIZE:          4096
[    0.000000] ... MAX_LOCKDEP_ENTRIES:     16384
[    0.000000] ... MAX_LOCKDEP_CHAINS:      32768
[    0.000000] ... CHAINHASH_SIZE:          16384
[    0.000000]  memory used by lock dependency info: 3695 kB
[    0.000000]  per task-struct memory footprint: 1152 bytes
[    0.070000] Calibrating delay loop... 226.09 BogoMIPS (lpj=1130496)
[    0.070000] pid_max: default: 32768 minimum: 301
[    0.070000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.070000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.070000] CPU: Testing write buffer coherency: ok
[    0.080000] Setting up static identity map for 0x40493228 - 0x40493280
[    0.100000] devtmpfs: initialized
[    0.110000] pinctrl core: initialized pinctrl subsystem
[    0.120000] regulator-dummy: no parameters
[    0.120000] NET: Registered protocol family 16
[    0.120000] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.190000] Serial: AMBA PL011 UART driver
[    0.190000] 80070000.serial: ttyAMA0 at MMIO 0x80070000 (irq = 17, base_baud = 0) is a PL011 rev2
[    0.390000] console [ttyAMA0] enabled
[    0.440000] bio: create slab <bio-0> at 0
[    0.460000] mxs-dma 80004000.dma-apbh: initialized
[    0.480000] mxs-dma 80024000.dma-apbx: initialized
[    0.480000] usb0_vbus: 5000 mV
[    0.490000] SCSI subsystem initialized
[    0.490000] usbcore: registered new interface driver usbfs
[    0.500000] usbcore: registered new interface driver hub
[    0.500000] usbcore: registered new device driver usb
[    0.510000] pps_core: LinuxPPS API ver. 1 registered
[    0.510000] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.520000] PTP clock support registered
[    0.520000] Advanced Linux Sound Architecture Driver Initialized.
[    0.530000] Switched to clocksource mxs_timer
[    0.960000] NET: Registered protocol family 2
[    0.970000] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.980000] TCP bind hash table entries: 1024 (order: 3, 36864 bytes)
[    0.990000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.990000] TCP: reno registered
[    1.000000] UDP hash table entries: 256 (order: 2, 20480 bytes)
[    1.000000] UDP-Lite hash table entries: 256 (order: 2, 20480 bytes)
[    1.010000] NET: Registered protocol family 1
[    1.020000] RPC: Registered named UNIX socket transport module.
[    1.030000] RPC: Registered udp transport module.
[    1.030000] RPC: Registered tcp transport module.
[    1.040000] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.050000] futex hash table entries: 256 (order: 1, 11264 bytes)
[    1.180000] NFS: Registering the id_resolver key type
[    1.180000] Key type id_resolver registered
[    1.190000] Key type id_legacy registered
[    1.190000] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    1.200000] msgmni has been set to 102
[    1.230000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    1.230000] io scheduler noop registered (default)
[    1.250000] of_dma_request_slave_channel: dma-names property of node '/apb@80000000/apbx@80040000/serial@80070000' missing or empty
[    1.260000] uart-pl011 80070000.serial: no DMA platform data
[    1.270000] 8006c000.serial: ttyAPP0 at MMIO 0x8006c000 (irq = 146, base_baud = 1500000) is a 8006c000.serial
[    1.280000] mxs-auart 8006c000.serial: Found APPUART 3.0.0
[    1.310000] usbcore: registered new interface driver asix
[    1.310000] usbcore: registered new interface driver ax88179_178a
[    1.320000] usbcore: registered new interface driver cdc_ether
[    1.330000] usbcore: registered new interface driver smsc95xx
[    1.330000] usbcore: registered new interface driver net1080
[    1.340000] usbcore: registered new interface driver cdc_subset
[    1.350000] usbcore: registered new interface driver zaurus
[    1.350000] usbcore: registered new interface driver cdc_ncm
[    1.360000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.370000] usbcore: registered new interface driver usb-storage
[    1.390000] mousedev: PS/2 mouse device common for all mice
[    1.410000] stmp3xxx-rtc 8005c000.rtc: rtc core: registered 8005c000.rtc as rtc0
[    1.410000] i2c /dev entries driver
[    1.420000] stmp3xxx_rtc_wdt stmp3xxx_rtc_wdt: initialized watchdog with heartbeat 19s
[    1.430000] 80010000.ssp supply vmmc not found, using dummy regulator
[    1.490000] mxs-mmc 80010000.ssp: initialized
[    1.510000] usbcore: registered new interface driver usbhid
[    1.510000] usbhid: USB HID core driver
[    1.550000] TCP: cubic registered
[    1.550000] NET: Registered protocol family 17
[    1.560000] Key type dns_resolver registered
[    1.570000] registered taskstats version 1
[    1.580000] mmc0: host does not support reading read-only switch. assuming write-enable.
[    1.590000] mmc0: new high speed SDHC card at address 0007
[    1.600000] usb0_vbus: disabling
[    1.600000] regulator-dummy: disabling
[    1.610000] mmcblk0: mmc0:0007 SD4GB 3.70 GiB
[    1.620000] stmp3xxx-rtc 8005c000.rtc: setting system clock to 1970-01-01 00:00:07 UTC (7)
[    1.650000]  mmcblk0: p1 p2 p3
[    1.690000] ALSA device list:
[    1.690000]   No soundcards found.
[    1.710000] kjournald starting.  Commit interval 5 seconds
[    1.730000] EXT3-fs (mmcblk0p3): using internal journal
[    1.740000] EXT3-fs (mmcblk0p3): mounted filesystem with ordered data mode
[    1.740000] VFS: Mounted root (ext3 filesystem) on device 179:3.
[    1.760000] devtmpfs: mounted
[    1.760000] Freeing unused kernel memory: 224K (c0682000 - c06ba000)
INIT: version 2.88 booting
Starting udev
[    2.950000] udevd[60]: starting version 182
Starting Bootlog daemon: bootlogd: cannot allocate pseudo tty: No such file or directory
bootlogd.
[    8.630000] random: dd urandom read with 104 bits of entropy available
Populating dev cache
[   11.480000] random: nonblocking pool is initialized
Mon Dec  8 13:30:00 UTC 2014
INIT: Entering runlevel: 5
Configuring network interfaces... ifconfig: SIOCGIFFLAGS: No such device
Starting syslogd/klogd: done
Stopping Bootlog daemon: bootlogd.

Poky (Yocto Project Reference Distro) 1.6.2 imx233-olinuxino-micro /dev/ttyAMA0

imx233-olinuxino-micro login: root
root@imx233-olinuxino-micro:~# ls /bin/
ash                  grep                 ps
busybox              gunzip               pwd
busybox.nosuid       gzip                 rm
busybox.suid         hostname             rmdir
cat                  kill                 run-parts
chattr               ln                   sed
chgrp                login                sh
chmod                ls                   sleep
chown                mkdir                stat
cp                   mknod                stty
cpio                 mktemp               su
date                 more                 sync
dd                   mount                tar
df                   mountpoint           touch
dmesg                mountpoint.sysvinit  true
dnsdomainname        mv                   umount
dumpkmap             netstat              uname
echo                 pidof                usleep
egrep                pidof.sysvinit       vi
false                ping                 watch
fgrep                ping6                zcat
root@imx233-olinuxino-micro:~# ls /usr/bin/
[                    last                 tee
[[                   last.sysvinit        telnet
ar                   lastb                test
awk                  less                 tftp
basename             logger               time
bunzip2              logname              top
bzcat                md5sum               tr
chvt                 mesg                 traceroute
clear                mesg.sysvinit        tty
cmp                  microcom             udevadm
cut                  mkfifo               uniq
dc                   nc                   unzip
deallocvt            nohup                update-alternatives
diff                 nslookup             uptime
dirname              od                   users
du                   openvt               utmpdump
dumpleases           passwd               utmpdump.sysvinit
env                  patch                vlock
expr                 printf               wall
find                 readlink             wall.sysvinit
flock                realpath             wc
free                 renice               wget
fuser                reset                which
groups               seq                  who
head                 sha3sum              whoami
hexdump              sort                 xargs
id                   strings              yes
killall              tail
root@imx233-olinuxino-micro:~# top
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
  305   301 root     R     2244   4%  23% top
   60     1 root     S     2796   5%   0% /lib/udev/udevd -d
  129    60 root     S     2792   5%   0% /lib/udev/udevd -d
  130    60 root     S     2792   5%   0% /lib/udev/udevd -d
  301     1 root     S     2424   5%   0% -sh
  302     1 root     S     2248   4%   0% /sbin/getty 38400 tty1
  294     1 root     S     2244   4%   0% /sbin/syslogd -n -O /var/log/messages
  297     1 root     S     2244   4%   0% /sbin/klogd -n
    1     0 root     S     1716   3%   0% init [5]
   34     2 root     SW       0   0%   0% [mmcqd/0]
    3     2 root     SW       0   0%   0% [ksoftirqd/0]
   21     2 root     SW       0   0%   0% [kworker/u2:1]
    9     2 root     SW       0   0%   0% [kdevtmpfs]
    2     0 root     SW       0   0%   0% [kthreadd]
    7     2 root     SW       0   0%   0% [watchdog/0]
   10     2 root     SW<      0   0%   0% [writeback]
   15     2 root     SW       0   0%   0% [kworker/0:1]
    4     2 root     SW       0   0%   0% [kworker/0:0]
    5     2 root     SW<      0   0%   0% [kworker/0:0H]
    6     2 root     SW       0   0%   0% [kworker/u2:0]
root@imx233-olinuxino-micro:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                58.0M      6.7M     48.1M  12% /
devtmpfs                 25.5M         0     25.5M   0% /dev
tmpfs                    25.6M     40.0K     25.6M   0% /run
tmpfs                    25.6M     36.0K     25.6M   0% /var/volatile
root@imx233-olinuxino-micro:~# echo 1 > /sys/class/leds/green/brightness
root@imx233-olinuxino-micro:~# echo 0 > /sys/class/leds/green/brightness
root@imx233-olinuxino-micro:~# echo heartbeat >  /sys/class/leds/green/trigger
root@imx233-olinuxino-micro:~# echo 0 > /sys/class/leds/green/brightness
root@imx233-olinuxino-micro:~# dmesg |tail -n20
[  262.320000] ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in 11
[  262.320000] ci_hdrc ci_hdrc.0: EHCI Host Controller
[  262.330000] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[  262.360000] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[  262.380000] hub 1-0:1.0: USB hub found
[  262.380000] hub 1-0:1.0: 1 port detected
[  262.400000] ci_hdrc ci_hdrc.0: remove, state 1
[  262.400000] usb usb1: USB disconnect, device number 1
[  262.440000] ci_hdrc ci_hdrc.0: USB bus 1 deregistered
[  267.450000] ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in 11
[  272.460000] ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in 11
[  272.460000] ci_hdrc ci_hdrc.0: EHCI Host Controller
[  272.470000] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[  272.500000] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[  272.520000] hub 1-0:1.0: USB hub found
[  272.520000] hub 1-0:1.0: 1 port detected
[  272.540000] ci_hdrc ci_hdrc.0: remove, state 1
[  272.540000] usb usb1: USB disconnect, device number 1
[  272.580000] ci_hdrc ci_hdrc.0: USB bus 1 deregistered
[  277.590000] ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in 11
root@imx233-olinuxino-micro:~#

Note

Something strange is happening here, turning on and off the green status LED seems to effect the USB port. This is not the case with older versions of Yocto, e.g. dylan and Linux-3.8.13-fslc+g8a197c1.

Customize the kernel

Refer to the Yocto Project Linux Kernel Development Manual for more detailed information.

Use menuconfig to create a custom kernel configuration

[chris@thinkpad fsl-community-bsp]$ bitbake -c menuconfig linux-fslc
bash: bitbake: command not found
[chris@thinkpad fsl-community-bsp]$ MACHINE=imx233-olinuxino-micro . ./setup-environment build

Welcome to Freescale Community BSP

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 can now run 'bitbake <target>'

Common targets are:
    core-image-minimal
    meta-toolchain
    meta-toolchain-sdk
    adt-installer
    meta-ide-support

Your configuration files at build have not been touched.
[chris@thinkpad build]$ bitbake -c menuconfig linux-fslc
Loading cache: 100% |#########################################| ETA:  00:00:00
Loaded 1827 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.22.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Fedora-20"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "imx233-olinuxino-micro"
DISTRO            = "poky"
DISTRO_VERSION    = "1.6.2"
TUNE_FEATURES     = "armv5 thumb dsp"
TARGET_FPU        = "soft"
meta
meta-yocto        = "(nobranch):1e668ccf1a05c5d730de9747bc1c2b0446bda556"
meta-oe           = "(nobranch):d3d14d3fcca7fcde362cf0b31411dc4eea6d20aa"
meta-fsl-arm      = "(nobranch):9bc540eec9a7e280af13371ea70650fcc47ea627"
meta-fsl-arm-extra = "(nobranch):e1085deb3d915d2a95a65cceadc77c6de0dadfb6"
meta-fsl-demos    = "(nobranch):f141c7d1158b8addbd6f1ed047a1b47c2ed85f8f"

NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 254 tasks of which 253 didn't need to be rerun and all succeeded.
[chris@thinkpad build]$
Screenshot "bitbake -c menuconfig linux-fslc"

Screenshot “bitbake -c menuconfig linux-fslc”

You can also try:

[chris@thinkpad build]$ bitbake -c devshell linux-fslc

And then run make menuconfig in the devshell.

Screenshot "bitbake -c devshell linux-fslc"

Screenshot “bitbake -c devshell linux-fslc”

Note

If you are running Fedora and menuconfig and devshell aren’t working have a look at the following bugs:

I went with applying the patch from this commit manually:

[chris@thinkpad fsl-community-bsp]$ cd sources/poky/
[chris@thinkpad poky]$ curl http://git.yoctoproject.org/cgit/cgit.cgi/poky/patch/?id=95bd7731f6e12d58a4ebf2cfe7190263a000007d > bash_func.patch
[chris@thinkpad poky]$ cat bash_func.patch
From 95bd7731f6e12d58a4ebf2cfe7190263a000007d Mon Sep 17 00:00:00 2001
From: Richard Purdie <richard.purdie@linuxfoundation.org>
Date: Mon, 8 Dec 2014 16:37:26 +0000
Subject: bitbake: data: Handle BASH_FUNC shellshock implication

The shellshock patches changed the way bash functions are exported.
Unfortunately different distros used slightly different formats,
Fedora went with BASH_FUNC_XXX()=() { echo foo; } and Ubuntu went with
BASH_FUNC_foo%%=() {  echo foo; }.

The former causes errors in dealing with out output from emit_env,
the functions are not exported in either case any more.

This patch handles things so the functions work as expected in either
case.

[YOCTO #6880]

(Bitbake rev: e21c4aae37d1205b641021401c2860745e143f06)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index 91b1eb1..eb628c7 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -219,6 +219,13 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False):

     val = str(val)

+    if varExpanded.startswith("BASH_FUNC_"):
+        varExpanded = varExpanded[10:-2]
+        val = val[3:] # Strip off "() "
+        o.write("%s() %s\n" % (varExpanded, val))
+        o.write("export -f %s\n" % (varExpanded))
+        return 1
+
     if func:
         # NOTE: should probably check for unbalanced {} within the var
         o.write("%s() {\n%s\n}\n" % (varExpanded, val))
--
cgit v0.10.2

[chris@thinkpad poky]$ patch -p1 < bash_func.patch
patching file bitbake/lib/bb/data.py
[chris@thinkpad poky]$

Load an alternate configuration file

Now you have the chance to load an alternate configuration file. To do this select Load an Alternate Configuration File in menuconfig and specify the path to the kernel configuration file.

Adding WiFi support

At the moment my network adapter doesn’t gets recognized:

root@imx233-olinuxino-micro:~#
[  372.300000] ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in 11
[  372.300000] ci_hdrc ci_hdrc.0: EHCI Host Controller
[  372.310000] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[  372.340000] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[  372.360000] hub 1-0:1.0: USB hub found
[  372.360000] hub 1-0:1.0: 1 port detected

root@imx233-olinuxino-micro:~# dmesg |tail
[  359.780000] ci_hdrc ci_hdrc.0: remove, state 1
[  359.800000] usb usb1: USB disconnect, device number 1
[  359.830000] ci_hdrc ci_hdrc.0: USB bus 1 deregistered
[  364.850000] ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in 11
[  372.300000] ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in 11
[  372.300000] ci_hdrc ci_hdrc.0: EHCI Host Controller
[  372.310000] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[  372.340000] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[  372.360000] hub 1-0:1.0: USB hub found
[  372.360000] hub 1-0:1.0: 1 port detected
root@imx233-olinuxino-micro:~# tail /var/log/messages
Dec  8 13:54:49 imx233-olinuxino-micro user.info kernel: [  359.780000] ci_hdrc ci_hdrc.0: remove, state 1
Dec  8 13:54:49 imx233-olinuxino-micro user.info kernel: [  359.800000] usb usb1: USB disconnect, device number 1
Dec  8 13:54:49 imx233-olinuxino-micro user.info kernel: [  359.830000] ci_hdrc ci_hdrc.0: USB bus 1 deregistered
Dec  8 13:54:54 imx233-olinuxino-micro user.err kernel: [  364.850000] ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in 11
Dec  8 13:55:01 imx233-olinuxino-micro user.err kernel: [  372.300000] ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in 11
Dec  8 13:55:01 imx233-olinuxino-micro user.info kernel: [  372.300000] ci_hdrc ci_hdrc.0: EHCI Host Controller
Dec  8 13:55:01 imx233-olinuxino-micro user.info kernel: [  372.310000] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
Dec  8 13:55:01 imx233-olinuxino-micro user.info kernel: [  372.340000] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
Dec  8 13:55:01 imx233-olinuxino-micro user.info kernel: [  372.360000] hub 1-0:1.0: USB hub found
Dec  8 13:55:01 imx233-olinuxino-micro user.info kernel: [  372.360000] hub 1-0:1.0: 1 port detected
root@imx233-olinuxino-micro:~# lsusb
-sh: lsusb: not found
root@imx233-olinuxino-micro:~#

I need to enable the driver in menuconfig:

[*] Networking support  --->
    [*]   Wireless (NEW)  --->
    --- Wireless
      <*>   cfg80211 - wireless configuration API
      [ ]     nl80211 testmode command (NEW)
      [ ]     enable developer warnings
      [ ]     cfg80211 regulatory debugging
      [*]     enable powersave by default (NEW)
      [ ]     cfg80211 DebugFS entries (NEW)
      [*]     cfg80211 wireless extensions compatibility
      <*>   Generic IEEE 802.11 Networking Stack (mac80211)
            Default rate control algorithm (Minstrel)  --->
      [ ]   Enable mac80211 mesh networking (pre-802.11s) support (NEW)
      [*]   Enable LED triggers
      [ ]   Export mac80211 internals in DebugFS (NEW)
      [ ]   Trace all mac80211 debug messages (NEW)
      [ ]   Select mac80211 debugging features  --->

Device Drivers  --->
  [*] Network device support  --->
    [*]   Wireless LAN  --->
      <*>   Realtek 8187 and 8187B USB support
      <*>   Atheros Wireless Cards  --->
       --- Atheros Wireless Cards
          [ ]   Atheros wireless debugging
          [ ]   Atheros bluetooth coexistence support (NEW)
          <*>   Atheros 802.11n wireless cards support
          [ ]     Atheros ath9k AHB bus support
          [ ]     Atheros ath9k debugging (NEW)
          [*]   Atheros ath9k rate control (NEW)
          <*>   Atheros HTC based wireless cards support
          [ ]     Atheros ath9k_htc debugging
          < >   Linux Community AR9170 802.11n USB support (NEW)
          < >   Atheros mobile chipsets support (NEW)
          <*>   Atheros AR5523 wireless driver support (NEW)
      <*>   Ralink driver support  --->
       --- Ralink driver support
          <*>   Ralink rt2500 (USB) support
          <*>   Ralink rt2501/rt73 (USB) support
          <*>   Ralink rt27xx/rt28xx/rt30xx (USB) support
          [*]     rt2800usb - Include support for rt33xx devices (NEW)
          [*]     rt2800usb - Include support for rt35xx devices (EXPERIMENTAL) (NEW)
          [*]     rt2800usb - Include support for rt3573 devices (EXPERIMENTAL)
          [*]     rt2800usb - Include support for rt53xx devices (EXPERIMENTAL)
          [*]     rt2800usb - Include support for rt55xx devices (EXPERIMENTAL)
          [ ]     rt2800usb - Include support for unknown (USB) devices (NEW)
          [ ]   Ralink debug output (NEW
      <*>   Realtek rtlwifi family of devices (NEW)  --->
       --- Realtek rtlwifi family of devices
          <*>   Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter
          [ ]   Debugging output for rtlwifi driver family

Have a look at my kernel building tutorial for other options that you may want to enable.

Save it

Exit menuconfig and save the configuration.

Now copy it into the source directory and override the old configuration so that this configuration gets used next time when building the kernel:

[chris@thinkpad build]$ cp ../sources/meta-fsl-arm/recipes-kernel/linux/linux-fslc/mxs/defconfig ../sources/meta-fsl-arm/recipes-kernel/linux/linux-fslc/mxs/defconfig.bak
[chris@thinkpad build]$ cp tmp/work/imx233_olinuxino_micro-poky-linux-gnueabi/linux-fslc/3.14+gitAUTOINC+00e472111a-r0/git/.config ../sources/meta-fsl-arm/recipes-kernel/linux/linux-fslc/mxs/defconfig
[chris@thinkpad build]$ diff ../sources/meta-fsl-arm/recipes-kernel/linux/linux-fslc/mxs/defconfig ../sources/meta-fsl-arm/recipes-kernel/linux/linux-fslc/mxs/defconfig.bak |more

Rebuild the kernel

[chris@thinkpad build]$ bitbake -c cleansstate linux-fslc
Loading cache: 100% |#########################################| ETA:  00:00:00
Loaded 1827 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.22.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Fedora-20"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "imx233-olinuxino-micro"
DISTRO            = "poky"
DISTRO_VERSION    = "1.6.2"
TUNE_FEATURES     = "armv5 thumb dsp"
TARGET_FPU        = "soft"
meta
meta-yocto        = "(nobranch):1e668ccf1a05c5d730de9747bc1c2b0446bda556"
meta-oe           = "(nobranch):d3d14d3fcca7fcde362cf0b31411dc4eea6d20aa"
meta-fsl-arm      = "(nobranch):9bc540eec9a7e280af13371ea70650fcc47ea627"
meta-fsl-arm-extra = "(nobranch):e1085deb3d915d2a95a65cceadc77c6de0dadfb6"
meta-fsl-demos    = "(nobranch):f141c7d1158b8addbd6f1ed047a1b47c2ed85f8f"

NOTE: Preparing runqueue
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 2 tasks of which 0 didn't need to be rerun and all succeeded.
[chris@thinkpad build]$ bitbake core-image-minimal
Loading cache: 100% |#########################################| ETA:  00:00:00
Loaded 1827 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.22.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Fedora-20"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "imx233-olinuxino-micro"
DISTRO            = "poky"
DISTRO_VERSION    = "1.6.2"
TUNE_FEATURES     = "armv5 thumb dsp"
TARGET_FPU        = "soft"
meta
meta-yocto        = "(nobranch):1e668ccf1a05c5d730de9747bc1c2b0446bda556"
meta-oe           = "(nobranch):d3d14d3fcca7fcde362cf0b31411dc4eea6d20aa"
meta-fsl-arm      = "(nobranch):9bc540eec9a7e280af13371ea70650fcc47ea627"
meta-fsl-arm-extra = "(nobranch):e1085deb3d915d2a95a65cceadc77c6de0dadfb6"
meta-fsl-demos    = "(nobranch):f141c7d1158b8addbd6f1ed047a1b47c2ed85f8f"

NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 1837 tasks of which 1817 didn't need to be rerun and all succeeded.
[chris@thinkpad build]$

Copy the new image to the SD card and boot it

[chris@thinkpad build]$ sudo dd if=tmp/deploy/images/imx233-olinuxino-micro/core-image-minimal-imx233-olinuxino-micro-20141209145359.rootfs.sdcard of=/dev/mmcblk0 bs=1M
80+0 records in
80+0 records out
83886080 bytes (84 MB) copied, 10.9944 s, 7.6 MB/s
[chris@thinkpad build]$

Booting...

INIT: Entering runlevel: 5
Configuring network interfaces... ifconfig: SIOCGIFFLAGS: No such device
Starting syslogd/klogd: done
Stopping Bootlog daemon: bootlogd.

Poky (Yocto Project Reference Distro) 1.6.2 imx233-olinuxino-micro /dev/ttyAMA0

imx233-olinuxino-micro login: root
root@imx233-olinuxino-micro:~# echo 1 > /sys/class/leds/green/brightness
[   50.450000] ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in 11
[   50.450000] ci_hdrc ci_hdrc.0: EHCI Host Controller
[   50.460000] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[   50.500000] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[   50.530000] hub 1-0:1.0: USB hub found
[   50.550000] hub 1-0:1.0: 1 port detected
[   50.870000] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[   51.050000] usb 1-1: ath9k_htc: Firmware htc_7010.fw requested
[   51.060000] usb 1-1: Direct firmware load failed with error -2
[   51.070000] usb 1-1: Falling back to user helper
[   51.140000] usb 1-1: ath9k_htc: Failed to get firmware htc_7010.fw
[   51.180000] usb 1-1: ath9k_htc: USB layer deinitialized
root@imx233-olinuxino-micro:~# tail /var/log/messages
Dec  9 15:05:37 imx233-olinuxino-micro user.info kernel: [   50.460000] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
Dec  9 15:05:37 imx233-olinuxino-micro user.info kernel: [   50.500000] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
Dec  9 15:05:38 imx233-olinuxino-micro user.info kernel: [   50.530000] hub 1-0:1.0: USB hub found
Dec  9 15:05:38 imx233-olinuxino-micro user.info kernel: [   50.550000] hub 1-0:1.0: 1 port detected
Dec  9 15:05:38 imx233-olinuxino-micro user.info kernel: [   50.870000] usb 1-1: new high-speed USB device number 2 using ci_hdrc
Dec  9 15:05:38 imx233-olinuxino-micro user.info kernel: [   51.050000] usb 1-1: ath9k_htc: Firmware htc_7010.fw requested
Dec  9 15:05:38 imx233-olinuxino-micro user.warn kernel: [   51.060000] usb 1-1: Direct firmware load failed with error -2
Dec  9 15:05:38 imx233-olinuxino-micro user.warn kernel: [   51.070000] usb 1-1: Falling back to user helper
Dec  9 15:05:38 imx233-olinuxino-micro user.err kernel: [   51.140000] usb 1-1: ath9k_htc: Failed to get firmware htc_7010.fw
Dec  9 15:05:38 imx233-olinuxino-micro user.info kernel: [   51.180000] usb 1-1: ath9k_htc: USB layer deinitialized
root@imx233-olinuxino-micro:~# dmesg |tail
[   50.460000] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[   50.500000] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[   50.530000] hub 1-0:1.0: USB hub found
[   50.550000] hub 1-0:1.0: 1 port detected
[   50.870000] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[   51.050000] usb 1-1: ath9k_htc: Firmware htc_7010.fw requested
[   51.060000] usb 1-1: Direct firmware load failed with error -2
[   51.070000] usb 1-1: Falling back to user helper
[   51.140000] usb 1-1: ath9k_htc: Failed to get firmware htc_7010.fw
[   51.180000] usb 1-1: ath9k_htc: USB layer deinitialized
root@imx233-olinuxino-micro:~# cat /proc/version
Linux version 3.14.19-fslc+g00e4721 (chris@thinkpad) (gcc version 4.8.2 (GCC) ) #1 Tue Dec 9 15:59:38 CET 2014
root@imx233-olinuxino-micro:~# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@imx233-olinuxino-micro:~# iwconfig
-sh: iwconfig: not found
root@imx233-olinuxino-micro:~# shutdown -h now

So the wifi device gets detected but the firmware is missing.

Extending the WiFi support

Copy the missing firmware to the SD card

Since we have already enabled the WiFi drivers for our WiFi dongle we only need to copy the missing firmware to the root filesystem.

I’ve inserted the SD card into my laptop and will now copy the firmware from my Linux distribution to the SD card which is kind of a hack but should work:

[chris@thinkpad ~]$ sudo mount /dev/mmcblk0p3 /mnt/olinuxino/
[chris@thinkpad ~]$ ls /mnt/olinuxino/
bin  boot  dev  etc  home  lib  lost+found  media  mnt  proc  run  sbin  sys  tmp  usr  var
[chris@thinkpad ~]$ df -h /mnt/olinuxino/
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p3   58M  6.8M   49M  13% /mnt/olinuxino
[chris@thinkpad ~]$ sudo mkdir /mnt/olinuxino/lib/firmware/
[chris@thinkpad ~]$ sudo cp /lib/firmware/htc_7010.fw /mnt/olinuxino/lib/firmware/
[chris@thinkpad ~]$ sudo umount /mnt/olinuxino
[chris@thinkpad ~]$

So now after booting the wifi device is available but the iwconfig command is still missing:

INIT: version 2.88 booting
Starting udev
[    3.570000] udevd[61]: starting version 182
Starting Bootlog daemon: bootlogd: cannot allocate pseudo tty: No such file or directory
bootlogd.
[    8.120000] random: dd urandom read with 110 bits of entropy available
[    9.540000] random: nonblocking pool is initialized
Tue Dec  9 15:14:00 UTC 2014
INIT: Entering runlevel: 5
Configuring network interfaces... ifconfig: SIOCGIFFLAGS: No such device
Starting syslogd/klogd: done
Stopping Bootlog daemon: bootlogd.

Poky (Yocto Project Reference Distro) 1.6.2 imx233-olinuxino-micro /dev/ttyAMA0

imx233-olinuxino-micro login: root
root@imx233-olinuxino-micro:~# df -h /
Filesystem                Size      Used Available Use% Mounted on
/dev/root                58.0M      6.8M     48.0M  12% /
root@imx233-olinuxino-micro:~# echo 1 > /sys/class/leds/green/brightness
[   57.900000] ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in 11
[   57.900000] ci_hdrc ci_hdrc.0: EHCI Host Controller
[   57.910000] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[   57.940000] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[   57.980000] hub 1-0:1.0: USB hub found
[   58.000000] hub 1-0:1.0: 1 port detected
[   58.320000] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[   58.500000] usb 1-1: ath9k_htc: Firmware htc_7010.fw requested
[   58.660000] usb 1-1: ath9k_htc: Transferred FW: htc_7010.fw, size: 72992
[   58.730000] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 45 credits
[   59.100000] ath9k_htc 1-1:1.0: ath9k_htc: FW Version: 1.3
[   59.140000] ieee80211 phy0: Atheros AR9287 Rev:2

root@imx233-olinuxino-micro:~# tail /var/log/messages
Dec  9 15:14:49 imx233-olinuxino-micro user.info kernel: [   58.660000] usb 1-1: ath9k_htc: Transferred FW: htc_7010.fw, size: 72992
Dec  9 15:14:49 imx233-olinuxino-micro user.info kernel: [   58.730000] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 45 credits
Dec  9 15:14:49 imx233-olinuxino-micro user.info kernel: [   59.100000] ath9k_htc 1-1:1.0: ath9k_htc: FW Version: 1.3
Dec  9 15:14:49 imx233-olinuxino-micro user.debug kernel: [   59.100000] ath: EEPROM regdomain: 0x809c
Dec  9 15:14:49 imx233-olinuxino-micro user.debug kernel: [   59.100000] ath: EEPROM indicates we should expect a country code
Dec  9 15:14:49 imx233-olinuxino-micro user.debug kernel: [   59.100000] ath: doing EEPROM country->regdmn map search
Dec  9 15:14:49 imx233-olinuxino-micro user.debug kernel: [   59.100000] ath: country maps to regdmn code: 0x52
Dec  9 15:14:49 imx233-olinuxino-micro user.debug kernel: [   59.100000] ath: Country alpha2 being used: CN
Dec  9 15:14:49 imx233-olinuxino-micro user.debug kernel: [   59.100000] ath: Regpair used: 0x52
Dec  9 15:14:49 imx233-olinuxino-micro user.info kernel: [   59.140000] ieee80211 phy0: Atheros AR9287 Rev:2
root@imx233-olinuxino-micro:~# dmesg |tail
[   58.660000] usb 1-1: ath9k_htc: Transferred FW: htc_7010.fw, size: 72992
[   58.730000] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 45 credits
[   59.100000] ath9k_htc 1-1:1.0: ath9k_htc: FW Version: 1.3
[   59.100000] ath: EEPROM regdomain: 0x809c
[   59.100000] ath: EEPROM indicates we should expect a country code
[   59.100000] ath: doing EEPROM country->regdmn map search
[   59.100000] ath: country maps to regdmn code: 0x52
[   59.100000] ath: Country alpha2 being used: CN
[   59.100000] ath: Regpair used: 0x52
[   59.140000] ieee80211 phy0: Atheros AR9287 Rev:2
root@imx233-olinuxino-micro:~# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@imx233-olinuxino-micro:~# ifconfig wlan0 up
root@imx233-olinuxino-micro:~# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 60:76:42:05:24:44
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@imx233-olinuxino-micro:~# iwconfig
-sh: iwconfig: not found
root@imx233-olinuxino-micro:~#

Add wireless tools to the SD card image

To add more complete WiFi support to the core-image-minimal we have to edit the file build/conf/local.conf and add the line IMAGE_INSTALL_append = " wpa-supplicant wireless-tools dhcp-client linux-firmware" and rebuild the image.

[chris@thinkpad build]$ vim conf/local.conf
[chris@thinkpad build]$ tail -n2 conf/local.conf

IMAGE_INSTALL_append = " wpa-supplicant wireless-tools dhcp-client linux-firmware"
[chris@thinkpad build]$ bitbake core-image-minimal
Parsing recipes: 100% |#######################################| Time: 00:00:58
Parsing of 1398 .bb files complete (0 cached, 1398 parsed). 1826 targets, 119 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.22.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Fedora-20"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "imx233-olinuxino-micro"
DISTRO            = "poky"
DISTRO_VERSION    = "1.6.2"
TUNE_FEATURES     = "armv5 thumb dsp"
TARGET_FPU        = "soft"
meta
meta-yocto        = "(nobranch):1e668ccf1a05c5d730de9747bc1c2b0446bda556"
meta-oe           = "(nobranch):d3d14d3fcca7fcde362cf0b31411dc4eea6d20aa"
meta-fsl-arm      = "(nobranch):9bc540eec9a7e280af13371ea70650fcc47ea627"
meta-fsl-arm-extra = "(nobranch):e1085deb3d915d2a95a65cceadc77c6de0dadfb6"
meta-fsl-demos    = "(nobranch):f141c7d1158b8addbd6f1ed047a1b47c2ed85f8f"

NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
Currently 4 running tasks (1433 of 1945):
0: linux-firmware-1_0.0+gitAUTOINC+600caefd83-r0 do_fetch (pid 10972)
1: gnutls-2.12.23-r8.4 do_configure (pid 25736)
2: lzo-2.06-r1 do_package_write_rpm (pid 26764)
3: libgcrypt-1.5.3-r0 do_package_write_rpm (pid 26914)
WARNING: linux-firmware: NOT adding alternative provide /lib/firmware/brcm/brcmfmac-sdio.bin: /lib/firmware/brcm/brcmfmac4329.bin does not exist
WARNING: linux-firmware: NOT adding alternative provide /lib/firmware/brcm/brcmfmac-sdio.bin: /lib/firmware/brcm/brcmfmac4330.bin does not exist
NOTE: Tasks Summary: Attempted 1945 tasks of which 1842 didn't need to be rerun and all succeeded.

Summary: There were 2 WARNING messages shown.
[chris@thinkpad build]$

Write the image to the SD card:

[chris@thinkpad build]$  sudo dd if=tmp/deploy/images/imx233-olinuxino-micro/core-image-minimal-imx233-olinuxino-micro-20141209192355.rootfs.sdcard of=/dev/mmcblk0 bs=1M
112+0 records in
112+0 records out
117440512 bytes (117 MB) copied, 14.9876 s, 7.8 MB/s
[chris@thinkpad build]$

Boot it:

INIT: version 2.88 booting
Starting udev
[    3.160000] udevd[59]: starting version 182
Starting Bootlog daemon: bootlogd: cannot allocate pseudo tty: No such file or directory
bootlogd.
[    9.190000] random: dd urandom read with 97 bits of entropy available
Populating dev cache
[   13.330000] random: nonblocking pool is initialized
Tue Dec  9 15:40:00 UTC 2014
INIT: Entering runlevel: 5
Configuring network interfaces... ifconfig: SIOCGIFFLAGS: No such device
Starting system message bus: dbus.
Starting syslogd/klogd: done
Stopping Bootlog daemon: bootlogd.

Poky (Yocto Project Reference Distro) 1.6.2 imx233-olinuxino-micro /dev/ttyAMA0

imx233-olinuxino-micro login: root
root@imx233-olinuxino-micro:~#
[   44.440000] ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in 11
[   44.440000] ci_hdrc ci_hdrc.0: EHCI Host Controller
[   44.460000] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[   44.490000] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[   44.530000] hub 1-0:1.0: USB hub found
[   44.540000] hub 1-0:1.0: 1 port detected
[   44.870000] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[   45.060000] usb 1-1: ath9k_htc: Firmware htc_7010.fw requested
[   45.760000] usb 1-1: ath9k_htc: Transferred FW: htc_7010.fw, size: 72992
[   45.830000] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 45 credits
[   46.190000] ath9k_htc 1-1:1.0: ath9k_htc: FW Version: 1.3
[   46.260000] ieee80211 phy0: Atheros AR9287 Rev:2

root@imx233-olinuxino-micro:~# ls -w 100 /lib/firmware/
3com                                        iwlwifi-7260-7.ucode
GPL-3                                       kaweth
LICENCE.Marvell                             keyspan
LICENCE.OLPC                                keyspan_pda
LICENCE.agere                               korg
LICENCE.atheros_firmware                    lbtf_usb.bin
LICENCE.broadcom_bcm43xx                    lgs8g75.fw
LICENCE.ca0132                              libertas
LICENCE.chelsio_firmware                    matrox
LICENCE.ene_firmware                        moxa
LICENCE.go7007                              mrvl
LICENCE.i2400m                              mt7650.bin
LICENCE.ibt_firmware                        mts_cdma.fw
LICENCE.iwlwifi_firmware                    mts_edge.fw
LICENCE.mwl8335                             mts_gsm.fw
LICENCE.myri10ge_firmware                   mts_mt9234mu.fw
LICENCE.phanfw                              mts_mt9234zba.fw
LICENCE.qla2xxx                             mwl8k
LICENCE.ralink-firmware.txt                 myri10ge_eth_z8e.dat
LICENCE.ralink_a_mediatek_company_firmware  myri10ge_ethp_z8e.dat
LICENCE.rtlwifi_firmware.txt                myri10ge_rss_eth_z8e.dat
LICENCE.tda7706-firmware.txt                myri10ge_rss_ethp_z8e.dat
LICENCE.ti-connectivity                     myricom
LICENCE.ueagle-atm4-firmware                ositech
LICENCE.via_vt6656                          phanfw.bin
LICENCE.xc5000                              ql2100_fw.bin
LICENSE.amd-ucode                           ql2200_fw.bin
LICENSE.dib0700                             ql2300_fw.bin
LICENSE.radeon                              ql2322_fw.bin
README                                      ql2400_fw.bin
RTL8192E                                    ql2500_fw.bin
TDA7706_OM_v2.5.1_boot.txt                  qlogic
TDA7706_OM_v3.0.2_boot.txt                  r128
TIInit_7.2.31.bts                           radeon
WHENCE                                      rp2.fw
acenic                                      rt2561.bin
adaptec                                     rt2561s.bin
advansys                                    rt2661.bin
agere_ap_fw.bin                             rt2860.bin
agere_sta_fw.bin                            rt2870.bin
amd-ucode                                   rt3070.bin
ar3k                                        rt3071.bin
ar5523.bin                                  rt3090.bin
ar7010.fw                                   rt3290.bin
ar7010_1_1.fw                               rt73.bin
ar9170-1.fw                                 rtl_nic
ar9170-2.fw                                 rtlwifi
ar9271.fw                                   s2250.fw
ath3k-1.fw                                  s2250_loader.fw
ath6k                                       s5p-mfc
atmsar11.fw                                 sb16
av7110                                      sd8686.bin
bnx2                                        sd8686_helper.bin
bnx2x                                       slicoss
bnx2x-e1-4.8.53.0.fw                        sun
bnx2x-e1-5.2.13.0.fw                        sxg
bnx2x-e1-5.2.7.0.fw                         tehuti
bnx2x-e1h-4.8.53.0.fw                       ti-connectivity
bnx2x-e1h-5.2.13.0.fw                       ti_3410.fw
bnx2x-e1h-5.2.7.0.fw                        ti_5052.fw
brcm                                        tigon
carl9170-1.fw                               tlg2300_firmware.bin
cis                                         tr_smctr.bin
cpia2                                       ttusb-budget
ctefx.bin                                   ueagle-atm
ctspeq.bin                                  usbdux
cxgb3                                       usbdux_firmware.bin
cxgb4                                       usbduxfast_firmware.bin
dabusb                                      usbduxsigma_firmware.bin
dsp56k                                      v4l-cx231xx-avcore-01.fw
dvb-fe-xc5000-1.6.114.fw                    v4l-cx23418-apu.fw
dvb-usb-dib0700-1.20.fw                     v4l-cx23418-cpu.fw
dvb-usb-terratec-h5-drxk.fw                 v4l-cx23418-dig.fw
e100                                        v4l-cx23885-avcore-01.fw
edgeport                                    v4l-cx25840.fw
emi26                                       vicam
emi62                                       vntwusb.fw
ene-ub6250                                  vxge
ess                                         whiteheat.fw
f2255usb.bin                                whiteheat_loader.fw
go7007                                      wl1271-fw-2.bin
htc_7010.fw                                 wl1271-fw-ap.bin
htc_9271.fw                                 wl1271-fw.bin
i2400m-fw-usb-1.4.sbcf                      wl1271-nvs.bin
i2400m-fw-usb-1.5.sbcf                      wl127x-fw-3.bin
i6050-fw-usb-1.5.sbcf                       wl127x-fw-4-mr.bin
intel                                       wl127x-fw-4-plt.bin
intelliport2.bin                            wl127x-fw-4-sr.bin
isci                                        wl127x-fw-5-mr.bin
iwlwifi-100-5.ucode                         wl127x-fw-5-plt.bin
iwlwifi-1000-3.ucode                        wl127x-fw-5-sr.bin
iwlwifi-1000-5.ucode                        wl127x-fw-plt-3.bin
iwlwifi-105-6.ucode                         wl127x-nvs.bin
iwlwifi-135-6.ucode                         wl128x-fw-3.bin
iwlwifi-2000-6.ucode                        wl128x-fw-4-mr.bin
iwlwifi-2030-6.ucode                        wl128x-fw-4-plt.bin
iwlwifi-3160-7.ucode                        wl128x-fw-4-sr.bin
iwlwifi-3945-2.ucode                        wl128x-fw-5-mr.bin
iwlwifi-4965-2.ucode                        wl128x-fw-5-plt.bin
iwlwifi-5000-1.ucode                        wl128x-fw-5-sr.bin
iwlwifi-5000-2.ucode                        wl128x-fw-ap.bin
iwlwifi-5000-5.ucode                        wl128x-fw-plt-3.bin
iwlwifi-5150-2.ucode                        wl128x-fw.bin
iwlwifi-6000-4.ucode                        wl128x-nvs.bin
iwlwifi-6000g2a-5.ucode                     wl12xx-nvs.bin
iwlwifi-6000g2a-6.ucode                     wl18xx-conf.bin
iwlwifi-6000g2b-5.ucode                     wl18xx-fw-2.bin
iwlwifi-6000g2b-6.ucode                     wl18xx-fw.bin
iwlwifi-6050-4.ucode                        yam
iwlwifi-6050-5.ucode                        yamaha
root@imx233-olinuxino-micro:~#

Connect to a WPA2-PSK network

I’m using a TP-LINK TL-WN821N WiFi adapter to connect to an WPA2-PSK secured network created by my Android phone.

TP-LINK TL-WN821N

TP-LINK TL-WN821N (ath9k_htc)

Another working adapter is for example the EDIMAX EW-7811UN (rtl8192cu).

EDIMAX EW-7811UN

EDIMAX EW-7811UN (rtl8192cu)

root@imx233-olinuxino-micro:~# echo 1 > /sys/class/leds/green/brightness
root@imx233-olinuxino-micro:~# wpa_passphrase AndroidAP xc34653c3633 > /wpa.conf
root@imx233-olinuxino-micro:~# cat /wpa.conf
network={
        ssid="AndroidAP"
        #psk="xc34653c3633"
        psk=3652639232636436426390364328460938569326091690263940263846398467

}
root@imx233-olinuxino-micro:~# wpa_supplicant -B -i wlan0 -c /wpa.conf
Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL control device
root@imx233-olinuxino-micro:~#
[ 1234.860000] wlan0: authenticate with 02:1a:11:f2:6c:21
[ 1235.780000] wlan0: send auth to 02:1a:11:f2:6c:21 (try 1/3)
[ 1235.790000] wlan0: authenticated
[ 1235.810000] wlan0: associate with 02:1a:11:f2:6c:21 (try 1/3)
[ 1235.820000] wlan0: RX AssocResp from 02:1a:11:f2:6c:21 (capab=0x411 status=0 aid=1)
[ 1235.850000] wlan0: associated
root@imx233-olinuxino-micro:~# dhclient wlan0
root@imx233-olinuxino-micro:~# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 60:76:42:05:24:44
          inet addr:192.168.43.21  Bcast:192.168.43.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1481 (1.4 KiB)  TX bytes:1374 (1.3 KiB)

root@imx233-olinuxino-micro:~# ping google.de
PING google.de (173.194.39.15): 56 data bytes
64 bytes from 173.194.39.15: seq=0 ttl=52 time=91.094 ms
64 bytes from 173.194.39.15: seq=1 ttl=52 time=84.000 ms
64 bytes from 173.194.39.15: seq=2 ttl=52 time=92.375 ms
^C
--- google.de ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 84.000/89.156/92.375 ms
root@imx233-olinuxino-micro:~#

For more information about wpa_supplicant have a look here: https://wiki.archlinux.org/index.php/WPA_supplicant.

Connect to a WEP network

Create a shared WiFi connection on your laptop:

../../../_images/olinuxino_conf_yocto_1.png ../../../_images/olinuxino_conf_yocto_2.png ../../../_images/olinuxino_conf_yocto_3.png

Configure the WiFi connection on the OlinuXino:

root@imx233-olinuxino-micro:~# echo 1 > /sys/class/leds/green/brightness
[  201.190000] ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in 11
[  201.190000] ci_hdrc ci_hdrc.0: EHCI Host Controller
[  201.200000] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[  201.230000] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[  201.260000] hub 1-0:1.0: USB hub found
[  201.280000] hub 1-0:1.0: 1 port detected
[  201.600000] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[  201.780000] usb 1-1: ath9k_htc: Firmware htc_7010.fw requested
[  201.970000] usb 1-1: ath9k_htc: Transferred FW: htc_7010.fw, size: 72992
[  202.040000] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 45 credits
[  202.400000] ath9k_htc 1-1:1.0: ath9k_htc: FW Version: 1.3
[  202.450000] ieee80211 phy0: Atheros AR9287 Rev:2
root@imx233-olinuxino-micro:~# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:73 errors:0 dropped:0 overruns:0 frame:0
          TX packets:73 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:8056 (7.8 KiB)  TX bytes:8056 (7.8 KiB)

root@imx233-olinuxino-micro:~# iwconfig
lo        no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off

root@imx233-olinuxino-micro:~# ping google.de
ping: bad address 'google.de'
root@imx233-olinuxino-micro:~# ifconfig wlan0 down
root@imx233-olinuxino-micro:~# iwconfig wlan0 mode ad-hoc
root@imx233-olinuxino-micro:~# iwconfig wlan0 channel 4
root@imx233-olinuxino-micro:~# iwconfig wlan0 essid yocto
root@imx233-olinuxino-micro:~# iwconfig wlan0 key 73598253812539275395295235
root@imx233-olinuxino-micro:~# ifconfig wlan0 up
[  242.040000] wlan0: Trigger new scan to find an IBSS to join
root@imx233-olinuxino-micro:~# dhclient wlan0
root@imx233-olinuxino-micro:~# ping google.de
PING google.de (173.194.32.215): 56 data bytes
64 bytes from 173.194.32.215: seq=0 ttl=50 time=351.219 ms
64 bytes from 173.194.32.215: seq=1 ttl=50 time=1095.375 ms
64 bytes from 173.194.32.215: seq=2 ttl=50 time=114.438 ms
^C
--- google.de ping statistics ---
4 packets transmitted, 3 packets received, 25% packet loss
round-trip min/avg/max = 114.438/520.344/1095.375 ms
root@imx233-olinuxino-micro:~# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 60:76:42:05:24:44
          inet addr:10.42.0.48  Bcast:10.42.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1558 (1.5 KiB)  TX bytes:5881 (5.7 KiB)

root@imx233-olinuxino-micro:~# iwconfig
lo        no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:"yocto"
          Mode:Ad-Hoc  Frequency:2.427 GHz  Cell: 92:76:1B:20:D6:33
          Tx-Power=20 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:7359-8253-8125-3927-5395-2952-35
          Power Management:off

root@imx233-olinuxino-micro:~#

It’s also possible to manually configure the network settings:

root@imx233-olinuxino-micro:~# ifconfig wlan0 10.42.0.2
root@imx233-olinuxino-micro:~# route add -net default gw 10.42.0.1
root@imx233-olinuxino-micro:~# echo 'nameserver 208.67.222.222' >> /etc/resolv.conf
root@imx233-olinuxino-micro:~# ping google.de
PING google.de (173.194.35.87): 56 data bytes
64 bytes from 173.194.35.87: seq=0 ttl=55 time=335.406 ms
64 bytes from 173.194.35.87: seq=1 ttl=55 time=334.125 ms
64 bytes from 173.194.35.87: seq=2 ttl=55 time=313.531 ms
64 bytes from 173.194.35.87: seq=3 ttl=55 time=331.562 ms
^C
--- google.de ping statistics ---
5 packets transmitted, 4 packets received, 20% packet loss
round-trip min/avg/max = 313.531/328.656/335.406 ms
root@imx233-olinuxino-micro:~#

Finally we have a working network connection, this should be enough for this introduction. The next step is to get familiar with the Yocto build system, read the documentation and create your own bitbake recipes.

Working with Yocto

Layers

The Yocto Project build system is composed of layers.

A layer is a logical collection of recipes representing the core, a BSP, an application stack, patches, or other functionality.

All layers have a priority and can override policy and config settings of layers of lower priority.

Create a Custom Layer

Create the layer:

[chris@thinkpad build]$ yocto-layer create meta-janncc-mx233-olinuxino -o ../sources/meta-janncc-mx233-olinuxino 5

New layer created in ../sources/meta-janncc-mx233-olinuxino.

Don't forget to add it to your BBLAYERS (for details see ../sources/meta-janncc-mx233-olinuxino\README).
[chris@thinkpad build]$

Add it to the build directory:

[chris@thinkpad build]$ vim conf/bblayers.conf
  LCONF_VERSION = "6"

  BBPATH = "${TOPDIR}"
  BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"

  BBFILES ?= ""
  BBLAYERS = " \
    ${BSPDIR}/sources/poky/meta \
    ${BSPDIR}/sources/poky/meta-yocto \
    \
    ${BSPDIR}/sources/meta-openembedded/meta-oe \
    \
    ${BSPDIR}/sources/meta-fsl-arm \
    ${BSPDIR}/sources/meta-fsl-arm-extra \
    ${BSPDIR}/sources/meta-fsl-demos \
+   ${BSPDIR}/sources/meta-janncc-mx233-olinuxino \
  "

Change to the layer’s sources directory:

[chris@thinkpad build]$ cd ../sources/meta-janncc-mx233-olinuxino/
[chris@thinkpad meta-janncc-mx233-olinuxino]$

Create the recipe directory:

[chris@thinkpad meta-janncc-mx233-olinuxino]$ mkdir -p recipes-janncc/hello-janncc

Create the directory to store the code for the application:

[chris@thinkpad meta-janncc-mx233-olinuxino]$ mkdir recipes-janncc/hello-janncc/hello-janncc

Write the application code:

[chris@thinkpad meta-janncc-mx233-olinuxino]$ echo 'int main() { puts("Hello jann.cc");}'> recipes-janncc/hello-janncc/hello-janncc/hello-janncc.c

Create a recipe file:

[chris@thinkpad meta-janncc-mx233-olinuxino]$ vim recipes-janncc/hello-janncc/hello-janncc_1.0.bb
[chris@thinkpad meta-janncc-mx233-olinuxino]$ cat recipes-janncc/hello-janncc/hello-janncc_1.0.bb

DESCRIPTION = "Simple helloworld application"
SECTION = "console/utils"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
PR = "r0"

SRC_URI = "file://hello-janncc.c"

S = "${WORKDIR}"

do_compile() {
             ${CC} hello-janncc.c -o hello-janncc
}

do_install() {
             install -d ${D}${bindir}
                     install -m 0755 hello-janncc ${D}${bindir}
}
[chris@thinkpad meta-janncc-mx233-olinuxino]$

Generate the package for the recipe:

[chris@thinkpad meta-janncc-mx233-olinuxino]$ cd ../../build/
[chris@thinkpad build]$ bitbake hello-janncc
Parsing recipes: 100% |#######################################| Time: 00:00:58
Parsing of 1399 .bb files complete (0 cached, 1399 parsed). 1827 targets, 119 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.22.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Fedora-20"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "imx233-olinuxino-micro"
DISTRO            = "poky"
DISTRO_VERSION    = "1.6.2"
TUNE_FEATURES     = "armv5 thumb dsp"
TARGET_FPU        = "soft"
meta
meta-yocto        = "(nobranch):1e668ccf1a05c5d730de9747bc1c2b0446bda556"
meta-oe           = "(nobranch):d3d14d3fcca7fcde362cf0b31411dc4eea6d20aa"
meta-fsl-arm      = "(nobranch):9bc540eec9a7e280af13371ea70650fcc47ea627"
meta-fsl-arm-extra = "(nobranch):e1085deb3d915d2a95a65cceadc77c6de0dadfb6"
meta-fsl-demos    = "(nobranch):f141c7d1158b8addbd6f1ed047a1b47c2ed85f8f"
meta-janncc-mx233-olinuxino = "<unknown>:<unknown>"

NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 365 tasks of which 353 didn't need to be rerun and all succeeded.
[chris@thinkpad build]$

Check the generated package:

[chris@thinkpad build]$ rpm -qlp tmp/deploy/rpm/armv5te/hello-janncc-1.0-r0.armv5te.rpm
warning: tmp/deploy/rpm/armv5te/hello-janncc-1.0-r0.armv5te.rpm: Header V4 DSA/SHA1 Signature, key ID 8cbb2aea: NOKEY
/usr
/usr/bin
/usr/bin/hello-janncc
[chris@thinkpad build]$ mkdir test
[chris@thinkpad build]$ cd test
[chris@thinkpad test]$ rpm2cpio ../tmp/deploy/rpm/armv5te/hello-janncc-1.0-r0.armv5te.rpm |cpio -i --make-directories
7 blocks
[chris@thinkpad test]$ file usr/bin/hello-janncc
usr/bin/hello-janncc: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=e370e1aea4a2178b9becc99c4a7b5b05f525aeac, stripped
[chris@thinkpad test]$

Creating a patch

[chris@thinkpad test]$ cd ../../sources/meta-janncc-mx233-olinuxino/recipes-janncc/hello-janncc/
[chris@thinkpad hello-janncc]$ cp hello-janncc/hello-janncc.c hello-janncc/hello-janncc.c.orig
[chris@thinkpad hello-janncc]$ sed -i 's/Hello jann.cc/Hello jann.cc!\\n/' hello-janncc/hello-janncc.c
[chris@thinkpad hello-janncc]$ diff -u hello-janncc/hello-janncc.c.orig hello-janncc/hello-janncc.c > hello-janncc/fix.patch
[chris@thinkpad hello-janncc]$ mv hello-janncc/hello-janncc.c.orig hello-janncc/hello-janncc.c
[chris@thinkpad hello-janncc]$

Add fix.patch to SRC_URI in the reipe file:

[chris@thinkpad hello-janncc]$ vim hello-janncc_1.0.bb
  DESCRIPTION = "Simple helloworld application"
  SECTION = "console/utils"
  LICENSE = "MIT"
  LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
  PR = "r0"

- SRC_URI = "file://hello-janncc.c"
+ SRC_URI = "file://hello-janncc.c file://fix.patch"

  S = "${WORKDIR}"

  do_compile() {
               ${CC} hello-janncc.c -o hello-janncc
  }

  do_install() {
               install -d ${D}${bindir}
                       install -m 0755 hello-janncc ${D}${bindir}
  }

Build the package:

[chris@thinkpad hello-janncc]$ cd ../../../../build/
[chris@thinkpad build]$ bitbake hello-janncc

Check the patch application:

[chris@thinkpad build]$ cat tmp/work/armv5te-poky-linux-gnueabi/hello-janncc/1.0-r0/temp/log.do_patch
DEBUG: Executing python function do_patch
DEBUG: Executing python function patch_do_patch
DEBUG: Searching for hello-janncc.c in paths:
/mnt/data/data/Projects/OLinuXino/fsl-community-bsp/sources/meta-janncc-mx233-olinuxino/recipes-janncc/hello-janncc/hello-janncc-1.0/poky
...
DEBUG: Searching for fix.patch in paths:
/mnt/data/data/Projects/OLinuXino/fsl-community-bsp/sources/meta-janncc-mx233-olinuxino/recipes-janncc/hello-janncc/hello-janncc-1.0/poky
  ...
NOTE: Applying patch 'fix.patch' (../sources/meta-janncc-mx233-olinuxino/recipes-janncc/hello-janncc/hello-janncc/fix.patch)
DEBUG: Python function patch_do_patch finished
DEBUG: Python function do_patch finished
[chris@thinkpad build]$

Creating an image

To create an image you just need to create a recipe. New images can inherit characteristics from base images e.g. core-image.

Create the image recipe:

[chris@thinkpad build]$ mkdir -p ../sources/meta-janncc-mx233-olinuxino/recipes-janncc/images
[chris@thinkpad build]$ vim ../sources/meta-janncc-mx233-olinuxino/recipes-janncc/images/mx233-olinuxino-janncc.bb
[chris@thinkpad build]$ cat ../sources/meta-janncc-mx233-olinuxino/recipes-janncc/images/mx233-olinuxino-janncc.bb
DESCRIPTION = "Testimage with WiFi Support"
LICENSE = "MIT"
inherit core-image
CORE_IMAGE_EXTRA_INSTALL +=" hello-janncc wpa-supplicant wireless-tools dhcp-client linux-firmware"

[chris@thinkpad build]$

Try to build the new image:

[chris@thinkpad build]$ bitbake mx233-olinuxino-janncc

Adding our kernel configuration to the layer

Also see here:

[chris@thinkpad build]$ mkdir -p ../sources/meta-janncc-mx233-olinuxino/recipes-kernel/linux/linux-fslc/mxs
[chris@thinkpad build]$ cd ../sources/meta-janncc-mx233-olinuxino/recipes-kernel/linux/
[chris@thinkpad linux]$ cp ../../../../build/tmp/work/imx233_olinuxino_micro-poky-linux-gnueabi/linux-fslc/3.14+gitAUTOINC+00e472111a-r0/git/.config linux-fslc/mxs/defconfig
[chris@thinkpad linux]$ vim linux-fslc_3.14.bbappend
[chris@thinkpad linux]$ cat linux-fslc_3.14.bbappend
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

SRC_URI += "file://defconfig"
[chris@thinkpad linux]$

Now revert the fslc kernel configuration to it’s original state, rebuild the image and see whether our changes have been applied.

[chris@thinkpad linux]$ cd ../../../../build/
[chris@thinkpad build]$ mv ../sources/meta-fsl-arm/recipes-kernel/linux/linux-fslc/mxs/defconfig.bak ../sources/meta-fsl-arm/recipes-kernel/linux/linux-fslc/mxs/defconfig
[chris@thinkpad build]$ bitbake -c cleansstate linux-fslc
[chris@thinkpad build]$ bitbake -c menuconfig linux-fslc
[chris@thinkpad build]$ bitbake mx233-olinuxino-janncc

Copy it to the SD card:

[chris@thinkpad build]$ sudo dd if=tmp/deploy/images/imx233-olinuxino-micro/mx233-olinuxino-janncc-imx233-olinuxino-micro.sdcard of=/dev/mmcblk0 bs=1M
152+0 records in
152+0 records out
159383552 bytes (159 MB) copied, 19.184 s, 8.3 MB/s
[chris@thinkpad build]$

Boot and test it:

INIT: Entering runlevel: 5
Configuring network interfaces... ifconfig: SIOCGIFFLAGS: No such device
Starting system message bus: dbus.
Starting rpcbind daemon...rpcbind: cannot create socket for udp6
rpcbind: cannot create socket for tcp6
done.
Starting advanced power management daemon: No APM support in kernel
(failed.)
Starting syslogd/klogd: done
 * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon
   ...done.
Starting Telephony daemon
Starting Linux NFC daemon
Stopping Bootlog daemon: bootlogd.

Poky (Yocto Project Reference Distro) 1.6.2 imx233-olinuxino-micro /dev/ttyAMA0

imx233-olinuxino-micro login: root
root@imx233-olinuxino-micro:~#
root@imx233-olinuxino-micro:~# cat /proc/version
Linux version 3.14.19-fslc+g00e4721 (chris@thinkpad) (gcc version 4.8.2 (GCC) ) #1 Wed Dec 10 08:06:20 CET 2014
root@imx233-olinuxino-micro:~# ls /lib/firmware/*.fw |tail
/lib/firmware/ti_5052.fw
/lib/firmware/v4l-cx231xx-avcore-01.fw
/lib/firmware/v4l-cx23418-apu.fw
/lib/firmware/v4l-cx23418-cpu.fw
/lib/firmware/v4l-cx23418-dig.fw
/lib/firmware/v4l-cx23885-avcore-01.fw
/lib/firmware/v4l-cx25840.fw
/lib/firmware/vntwusb.fw
/lib/firmware/whiteheat.fw
/lib/firmware/whiteheat_loader.fw
root@imx233-olinuxino-micro:~# ls /lib/firmware/htc_*
/lib/firmware/htc_7010.fw  /lib/firmware/htc_9271.fw
root@imx233-olinuxino-micro:~# hello-janncc
Hello jann.cc!

root@imx233-olinuxino-micro:~# echo 1 > /sys/class/leds/green/brightness
[  157.470000] ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in 11
[  157.470000] ci_hdrc ci_hdrc.0: EHCI Host Controller
[  157.480000] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[  157.510000] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[  157.540000] hub 1-0:1.0: USB hub found
[  157.560000] hub 1-0:1.0: 1 port detected
[  157.880000] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[  158.060000] usb 1-1: ath9k_htc: Firmware htc_7010.fw requested
[  158.240000] usb 1-1: ath9k_htc: Transferred FW: htc_7010.fw, size: 72992
[  158.300000] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 45 credits
[  158.670000] ath9k_htc 1-1:1.0: ath9k_htc: FW Version: 1.3
[  158.720000] ieee80211 phy0: Atheros AR9287 Rev:2

root@imx233-olinuxino-micro:~# tail /var/log/messages
Dec 10 07:14:20 imx233-olinuxino-micro user.info kernel: [  158.240000] usb 1-1: ath9k_htc: Transferred FW: htc_7010.fw, size: 72992
Dec 10 07:14:20 imx233-olinuxino-micro user.info kernel: [  158.300000] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 45 credits
Dec 10 07:14:21 imx233-olinuxino-micro user.info kernel: [  158.670000] ath9k_htc 1-1:1.0: ath9k_htc: FW Version: 1.3
Dec 10 07:14:21 imx233-olinuxino-micro user.debug kernel: [  158.680000] ath: EEPROM regdomain: 0x809c
Dec 10 07:14:21 imx233-olinuxino-micro user.debug kernel: [  158.680000] ath: EEPROM indicates we should expect a country code
Dec 10 07:14:21 imx233-olinuxino-micro user.debug kernel: [  158.680000] ath: doing EEPROM country->regdmn map search
Dec 10 07:14:21 imx233-olinuxino-micro user.debug kernel: [  158.680000] ath: country maps to regdmn code: 0x52
Dec 10 07:14:21 imx233-olinuxino-micro user.debug kernel: [  158.680000] ath: Country alpha2 being used: CN
Dec 10 07:14:21 imx233-olinuxino-micro user.debug kernel: [  158.680000] ath: Regpair used: 0x52
Dec 10 07:14:21 imx233-olinuxino-micro user.info kernel: [  158.720000] ieee80211 phy0: Atheros AR9287 Rev:2
root@imx233-olinuxino-micro:~# iwconfig
lo        no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off

root@imx233-olinuxino-micro:~#

Conclusion

The Yocto stuff (Poky build system) is nice if you want to build really small and clean Linux systems/images for a specific task (e.g. hardware that should be sold) but it is quite time consuming.

If you want fast results then its easier to use Arch Linux ARM, Arch’s package manager pacman to install extra programs and follow Building a kernel 3.x for the iMX233-OLinuXino to build a new kernel and later port your software to Yocto.

You will find my SD card images under https://sourceforge.net/projects/janncc/files/fsl-community-bsp/ if you want to test something without building your own image.