Running Yocto on Pandaboard

Sato on Pandaboard

I just bought a Pandaboard to experiment with Embedded Linux. As mentioned in my last post, OpenEmbedded is my weapon of choice for now, specifically the ‘Poky’ distro from The Yocto Project. Here’s how to get it started.

Download Poky

First, be sure to get the ‘denzil’ release of Poky. Later versions, including the latest drops, do not work on Pandaboard. The going theory is that the new GCC 4.7 botches something when compiling the kernel.

$ cd ~/Source/Yocto
$ wget http://downloads.yoctoproject.org/releases/yocto/yocto-1.2/poky-denzil-7.0.tar.bz2 -O - | tar xjv

Download meta-ti

The BSP for Pandaboard is in a layer called meta-ti. Importantly, you need a specific commit from meta-ti which is compatible with the Poky denzil release. The last line below accomplishes this.

$ cd ~/Source/Yocto/poky-denzil-7.0
$ git clone https://github.com/Angstrom-distribution/meta-ti.git
$ cd meta-ti
$ git checkout 30fb40ebc13614a74c2e237927c60ac43e01d1bc

Configure

First, generate the proper build directory:

$ cd ~/Source/Yocto
$ source poky-denzil-7.0/oe-init-build-env poky-denzil-7.0-build

There are a few tricks to properly configure Poky and meta-ti to play nicely together. Edit the conf/local.conf file and include these lines at the top:

MACHINE=pandaboard
BBMASK=meta-ti/recipes-misc

Then, edit conf/bblayers.conf and add in the meta-ti layer,so BBLAYERS looks like this, obviously changing ‘whatever’ to where you really put the files.

BBLAYERS ?= " \
/home/whatever/Source/Yocto/poky/meta \
/home/whatever/Source/Yocto/poky/meta-yocto \
/home/whatever/Source/Yocto/poky/meta-ti \
"

That’s it, ready to build!

Build Sato

For this example, I want to have a full UI, so we’ll build the ‘Sato’ image. Note that I like to do the fetch and build steps separately to measure my system performance.

$ cd ~/Source/Yocto
$ source poky-denzil-7.0/oe-init-build-env poky-denzil-7.0-build
$ time bitbake -c fetchall core-image-sato
 
real 34m37.854s
user 20m12.412s
sys 3m22.473s
 
$ time bitbake core-image-sato
 
real 117m59.545s
user 300m55.588s
sys 45m30.759s

By the way, the fetch time looks excessive. I suspect it’s because I’ve increased the BB_NUMBER_THREADS too high in conf/local.conf.

Package on SD Card

Finally, we need to take the resulting files and put them on an SD card. Here are the steps I go through. In this example, I’m using an 8GB card with precisely 7,969,177,600 capacity. The SD card on my development machine is located at /dev/sdd. Obviously, make sure you’re using the right value for your machine!

$ pushd tmp/deploy/images/
$ sudo dd if=/dev/zero of=/dev/sdd bs=1024 count=1024
$ sudo fdisk -l /dev/sdd
Disk /dev/sdd: 8029 MB, 7969177600 bytes
 
$ echo 7969177600/255/63/512 | bc
986
 
$ { echo ,9,0x0C,*; echo ,,,-; } | sudo sfdisk -D -H 255 -S 63 -C 986 /dev/sdd
$ sudo kpartx -av /dev/sdd
$ sudo mkfs.vfat -F 32 -n "boot" /dev/mapper/sdd1
$ sudo mke2fs -j -L "root" /dev/mapper/sdd2
$ sudo mount /dev/mapper/sdd1 /mnt/boot
$ sudo mount /dev/mapper/sdd2 /mnt/root
$ sudo cp MLO /mnt/boot
$ sudo cp u-boot.img /mnt/boot
$ sudo cp uImage-pandaboard.bin /mnt/boot/uImage
$ sudo tar -x -C /mnt/root/ -f core-image-sato-pandaboard.tar.bz2
$ sudo umount /mnt/root
$ sudo umount /mnt/boot
$ sudo kpartx -d /dev/sdd

Prepare to Boot

The bootloaders and kernel are configured to spew output messages to the built-in serial connector on the Pandaboard. This is a DB9 connector, which is silly considering that PCs stopped shipping with serial ports some decades ago. So be sure to get yourself a USB Serial Connector, hook it up, and launch a terminal before doing anything else.

$ sudo picocom -b 115200 /dev/ttyUSB0

If you’re using an HDMI monitor, hook that up before booting.

Boot It!

Plug in the SD card, plug in the power, and you’ll see something like the following on the serial output. 7 seconds later, you’ll have Matchbox up and running.

U-Boot 2011.12-dirty (Jul 17 2012 - 22:30:55)
 
CPU : OMAP4430 ES2.3
Board: OMAP4 Panda
I2C: ready
DRAM: 1 GiB
MMC: OMAP SD/MMC: 0
Using default environment
 
In: serial
Out: serial
Err: serial
Hit any key to stop autoboot: 3 ��� 2 ��� 1 ��� 0
reading boot.scr
 
** Unable to read "boot.scr" from mmc 0:1 **
reading uImage
 
4144980 bytes read
Booting from mmc0 ...
## Booting kernel from Legacy Image at 82000000 ...
Image Name: Linux-3.1.0
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4144916 Bytes = 4 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
 
Starting kernel ...
 
Uncompressing Linux... done, booting the kernel.
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.1.0 (gcc version 4.6.4 20120303 (prerelease) (GCC) ) #1 SMP PREEMPT Wed Jul 18 09:03:09 PDT 2012
[ 0.000000] CPU: ARMv7 Processor [411fc093] revision 3 (ARMv7), cr=10c5387f
[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine: OMAP4 Panda board
[ 0.000000] Reserving 16777216 bytes SDRAM for VRAM
[ 0.000000] CMA: reserved 32 MiB at 9e000000
[ 0.000000] Memory policy: ECC disabled, Data cache writealloc
[ 0.000000] OMAP4430 ES2.3
[ 0.000000] SRAM: Mapped pa 0x40300000 to va 0xfe400000 size: 0xd000
[ 0.000000] PERCPU: Embedded 9 pages/cpu @e0003000 s12512 r8192 d16160 u36864
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 255744
[ 0.000000] Kernel command line: console=ttyO2,115200n8 vram=16M root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait
 
...and so on...

Enjoy!

26 Comments

Filed under Linux, Pandaboard

26 responses to “Running Yocto on Pandaboard

  1. Hi, may i know what type SDCARD you use? usually using SDCARD , it’s damn slow…

  2. mac

    When i tried to run following command :
    time bitbake -c fetchall core-image-sato

    It stops the build with following error:
    ERROR: Unable to parse conf/bitbake.conf: ParseError at conf/local.conf:1: unparsed line: ‘MACHINE=pandaboard’

    Any suggestions?

  3. Where can i download BSP support package for pandaboard?

  4. Usman

    I followed the complete procedure and configure the SD card. Now when i insert it into pandaboard, it started booting kernel but instead of an GUI on my HDMI lcd, it shows me CLI mood (root@pandaboard) on my pc screen from where i was running minicom to boot kernel…. noting is displayed on HDMI lcd and no GUI interface. Why this occur ? Is there something that i have skipped ???? Please help

  5. Chris

    > This is a DB9 connector, which is silly considering that PCs stopped shipping with serial ports some decades ago

    It isn’t silly at all – the Pandaboard is built for development work, including Linux kernel development. A serial port is one of the few ways of developing and debugging the kernel on an embedded system (capturing kernel panics, running gdb. etc). The serial port hardware is so simple that the kernel can access it with a single IO instruction, so it is very easy and reliable to use. Most embedded systems actually have a serial port hidden somewhere, it’s just that often the pins aren’t connected to anything that looks like a traditional serial port – the first thing many hardware hackers do when faced with a reverse engineering project is to find the serial port pins and solder them to a proper connector.

  6. hi
    i am building yocto for pandaboard i am using the same steps above but when i enter the command
    time bitbake -c fetchall core-image-sato
    it gives this: http://pastebin.com/udusuvQ5

    the pastebin for local.conf is http://pastebin.com/cv5GXHSM

    pls help me out

  7. Priyank

    Hi, I am using poky-denzil-7.0.1- for my build, used as directed following lines in local.conf
    MACHINE ?=”pandaboard”
    BBMASK ?= “/home//builds/poky-denzil-7.0.1/meta-ti/recipes-misc”

    BBLAYERS ?= ” \
    /home//builds/poky-denzil-7.0.1/meta \
    /home//builds/poky-denzil-7.0.1/meta-yocto \
    /home//builds/poky-denzil-7.0.1/meta-ti \

    Error says
    Please set a valid MACHINE in your local.conf or environment

    ERROR: Execution of event handler ‘check_sanity_eventhandler’ failed

    Do Machine?= “pandaboard” is invalid ??

    • I don’t think I tried it on 7.0.1. I know it works on 7.0, but perhaps something changed between the two. Anyway, this is a good time to hit up the yocto mailing lists for help!

  8. ERROR: Unable to parse conf/bitbake.conf: ParseError at conf/local.conf:13: unparsed line: ‘BBMASK=meta-ti/recipes-misc’
    why this happen?

  9. Hitesh Shah

    Hi All,

    Does the above procedure work well on PandaBoard ES vB1 also? It has OMPA 4460 processor.
    If not, what changes may be required to run it on Pandaboard ES?

    Thanks,
    Hitesh Shah

  10. I got error openjade/openjade-native_1.3.2.bb, do_compile .. how can i solve it?
    http://pastebin.ubuntu.com/1421160/

  11. Peter

    Hi all ,
    I follow your command to build yocto on My CentOS 6.3

    “time bitbake -c fetchall core-image-sato”

    but I have some error message.

    Please help me.

    ERROR: Function failed: Fetcher failure for URL: ‘git://dev.omapzoom.org/pub/scm/integration/kernel-ubuntu.git;protocol=git;branch=ti-ubuntu-3.1-1282’. Unable to fetch URL from any source.
    ERROR: Logfile of failure stored in: /home/peter/project/PandaBoard/Source/Yocto/poky-denzil-7.0-build/tmp/work/pandaboard-poky-linux-gnueabi/linux-omap4-3.1.0-r0/temp/log.do_fetch.12988
    NOTE: package linux-omap4-3.1.0-r0: task do_fetch: Failed
    ERROR: Task 130 (/home/peter/project/PandaBoard/Source/Yocto/poky-denzil-7.0/meta-ti/recipes-kernel/linux/linux-omap4_3.1.0.bb, do_fetch) failed with exit code ‘1’
    NOTE: Tasks Summary: Attempted 471 tasks of which 470 didn’t need to be rerun and 1 failed.

    Best Regards
    Peter

    • Hey, Peter. I got the setup described here working, but there may be something about yours which is different. And it’s somewhat old now. I’d reach out to the yocto list directly for any recent questions and up-to-date information.

  12. Salman Khalid

    @Peter I got the exact same error on googling it says that we should change SRC_URI from http to git in linux-omap4_3.1.0.bb my problem is that mine is already git >>>>> SRC_URI = “git://dev.omapzoom.org/pub/scm/integration/kernel-ubuntu.git;protocol=git;branch=ti-ubuntu-3.1-1282 \ <<<<<< uptil now I am not able to figure it out if u do plz let me know.
    Thanks in Advance

Leave a reply to maniacbug Cancel reply