Tizen+RPI2

July 14, 2015 - Mauro Carvalho Chehab

Tizen on RPi2: Now Supporting 3D Acceleration

In Bringing Tizen to a Raspberry PI 2 Near You… I described the work we completed to port Tizen to Raspberry Pi 2 (RPi2). Since then, the Samsung Open Source Group has worked hard to add support for 3D acceleration.

UPDATES:

  • Added the -dev images, as they’re now supported.
  • Added bitbake command for building the crosswalk-dev image
  • Added command line for ddrescue
  • The Kernel was updated to Vanilla Tizen Kernel 4.4

This is an update to our original guide that describes how to build a custom Tizen image for the RPi2, and it now includes instructions to enable 3D acceleration. This is based mostly on work completed by our own Derek Foreman. Please note that this uses a driver that is still under development (VC4), written by Eric Anholt from Broadcom, so we don’t recommend its use in production situations.

If you don’t want to wait through the build process (it can take a few hours or more), you can download the latest version of this image here. Once it has downloaded, you can skip to the section titled “Use the Image.”

Step-By-Step Process for Building a Tizen Image for the RPi2

BEFORE STARTING: As a Yocto build needs to download lots of packages and git trees, you should ensure that your firewall policy allows  ftp, http, https and git protocols, otherwise the build may fail. If git:// is blocked, the recipes can be modified to use http – details are beyond the scope of this blog, see the Yocto bitbake documentation.

1) Create a Local Copy of tizen-distro

The first step is to clone the Tizen distro tree. We actually use an alternate version of the already existing tizen.org tizen-distro tree.

Our variant has some patches on the top of the tree that allows building Tizen for ARM CPUs. It also disables the usage of the Open Source mesa/gallium 3D driver, since the Broadcom GPU used on Raspberry PI2 is not currently supported by this open source driver. The plan is to rework these patches to submit them to Tizen upstream, without breaking anything for x86.

To create the clone, do the following from any terminal window:

2) Add Raspberry PI 2 BSP Meta Repository

Yocto works with several layers of software. The BSP (Board Supported Package) layer provides support for the board, and writing a BSP can consume a lot of time. Fortunately, there’s already a Yocto BSP for Raspbery PI 2, and the only extra requirement is to adjust the BSP to work with Tizen. Again, we opted to create a fork of the tree, to avoid interfering with other distros supported by this BSP, but the plan is to rework these patches in order to submit them to Yocto upstream in a way that would not affect builds for other distros.

The steps to create the clone are (starting in the tizen-distro directory created above):

3) Initialize the Environment to Prepare for Build

Now that we have a copy of both the Tizen and BSP Yocto bits, we need to set up the build environment in order to use bitbake. It should be noted that some packages may need to be installed, depending on the distribution you’re using on the build machine. The Yocto builder (bitbake) requires Python 2.7.3 or greater. So, we don’t recommend using an LTS distro for the build, as it may have packages that are too old. Here, we used Fedora 21, as it provides recent packages while being stable enough for desktop needs.

The command to initialize the build environment is:

4) Modify Config Files to Point to Build for Raspberry PI2

The Tizen build is controlled by configuration files. Assuming Tizen was installed at ~/tizen-distro the previous steps would have changed the working directory to the new build directory. So, the current directory should be ~/tizen-distro/build and the configuration files are in the ./conf directory.

From the build directory, you’ll need to edit the conf/local.conf with your favorite editor. You should comment out any existing line that starts with “MACHINE”, and add the line bellow:

This will tell bitbake that it should compile for the Raspberry PI 2 board.

Now, we need to add the BSP meta-raspberrypi layer to the conf/bblayers.conf file, at both BBLAYERS and BBLAYERS_NON_REMOVABLE. Again, use your favorite editor.

After the changes, the file contents should look like the one below, with your home directory instead of /home/mchehab:

Notice the new entry for “~/tizen-distro/meta-raspberrypi \” in each of the sections.

5) Start Building

Now that everything is set, it is time to start the build. This is the step that will take a considerable amount of time, and will require a good Internet connection because it will download thousands of packages and/or clone upstream git trees for several packages.

Do this by running the bitbake command to generate an image. Currently, the following images are supported:

Image name Details
rpi-hwup-image Raspberry PI2 minimal image plus gstreamer
tizen-common-core-image-minimal Tizen common core image with the bare minimum Tizen packages
tizen-core-image-minimal Tizen minimal image – has application launchers for test apps
tizen-common-core-image-crosswalk Tizen image with crosswalk HTML application runtime
tizen-core-image-minimal-dev Same as tizen-core-image-minimal plus some additional development packages
tizen-common-core-image-crosswalk-dev Same as tizen-common-core-image-crosswalk plus some additional development packages

NOTE: Those images are the minimal images. They can incremented by adding more packages at the bitbake recipe. For example, if you want to add gstreamer to tizen-core-image-minimal, you could edit ./meta-tizen/meta-tizen-common-base/recipes-image/images/tizen-core-image-minimal.bb and add there the following lines:

So, for example, in order to build the most complete image, you can run the command:

If everything goes well with bitbake, the images will be located in the tmp-glibc/deploy/images/raspberrypi2 directory, and will look like the ones below:

Use the Image

Be careful at this point, because the steps below should be run as root, and will rewrite a disk image. If you do something wrong at this point, you may end by damaging what’s stored on your disks! Let’s assume that the SD card will be mapped as /dev/sdc. Replace /dev/sdc with the device where your SD card is stored. To find out where your device is mapped, you can run the command:

WARNING: In the next section, be sure to change any instance of /dev/sdc to your specific disk that it is mapped. Otherwise you may damage your system!

1) Fill the SD Card With the Image

Insert an SD card into your computer using an SD->USB adapter and check if it was mapped at /dev/sdc.

The current image size is about 620 MB. Be sure to have an SD card big enough to fit the size of the generated image.

Now, write the image with the following command:

NOTE: the actual image size may vary, as we add more packages to the build image.

Please notice that the above is for the rpi-hwup-image. If the selected bitbake target is different, you need to change the above accordingly.

You may, instead use ddrescue:

The image is now created and you can use it to boot into Tizen.

NOTE: The root password used on this image will be “root”.

Get Involved

Now, You’re ready to use Tizen on your Raspberry PI 2 with 3D acceleration. Please notice that this uses a WIP GPU driver. So, I don’t recommend using it in production. If you want to learn more or get involved, you can join us in the Tizen IRC chatroom, or subscribe to the Tizen Community mailing list. Lastly, you can also stay tuned to this blog to catch more articles about building things on Tizen and Raspberry Pi. Have fun!

Raspberry Pi is a trademark of the Raspberry Pi Foundation

About Mauro Carvalho Chehab

Mauro is the upstream maintainer of the Linux kernel media and EDAC subsystems, and also a major contributor for the Reliability Availability and Serviceability (RAS) subsystems.
Mauro also maintains Tizen on Yocto packages upstream.
He works for the Samsung Open Source Group since 2013. Has worked during 5 years at the Red Hat RHEL Kernel team, having broad experience in telecommunications due to his work at some of the Brazilian largest wired and wireless carriers.

Development / Embedded Technology / Internet of Things / Linux / Tizen 3D / Linux / Port / Raspberry PI2 / Tizen / VC4 / Yocto /

Comments

  • […] you’ve got Tizen running on your Raspberry PI 2 (RPi2) using the procedures described in Tizen on RPi2: Now Supporting 3D Acceleration, you will probably want to be able to dynamically add/remove packages. It’s a pain to be […]

  • Paul Z. says:

    Problem build this project to Raspberry Pi 2:

    LOG:

    arm-oe-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon-vfpv4 -mtune=cortex-a7 –sysroot=/media/paulz/data/yocto/tizen-distro/build/tmp-glibc/sysroots/raspberrypi2 -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I../src/lib/efl -I../src/lib/efl -DPACKAGE_BIN_DIR=\”/usr/bin\” -DPACKAGE_LIB_DIR=\”/usr/lib\” -DPACKAGE_DATA_DIR=\”/usr/share/efreet\” -DPACKAGE_BUILD_DIR=\”/media/paulz/data/yocto/tizen-distro/build/tmp-glibc/work/cortexa7t2hf-vfp-vfpv4-neon-oe-linux-gnueabi/efl/1.12.2-r0/git\” -DDATA_DIR=\”/usr/share\” -DLOCALE_DIR=\”/usr/share/locale\” -Wall -Wextra -Wpointer-arith -Wno-missing-field-initializers -fvisibility=hidden -fdata-sections -ffunction-sections -I../src/lib/efreet -I../src/lib/efreet -I../src/bindings/efreet -I../src/bindings/efreet -I../src/lib/eina -I../src/lib/eina -I../src/lib/eo -I../src/lib/eo -I../src/lib/eldbus -I../src/lib/eldbus -I../src/lib/ecore_file -I../src/lib/ecore_file -I../src/lib/ecore -I../src/lib/ecore -I../src/lib/eet -I../src/lib/eet -DEFL_EFREET_BUILD=1 -O2 -pipe -g -feliminate-unused-debug-types -DMESA_EGL_NO_X11_HEADERS -c -o tests/efreet/compare/tests_efreet_compare_efreet_menu_alloc-efreet_menu_alloc.o test -f 'tests/efreet/compare/efreet_menu_alloc.c' || echo './'tests/efreet/compare/efreet_menu_alloc.c
    | make[4]: *** No rule to make target ‘lib/ecore_audio/ecore_audio.eo.hh’, needed by ‘all-am’. Stop.
    | make[4]: *** Waiting for unfinished jobs….
    | Makefile:31903: recipe for target ‘all-recursive’ failed
    | make[3]: *** [all-recursive] Error 1
    | Makefile:11563: recipe for target ‘all’ failed
    | make[2]: *** [all] Error 2
    | Makefile:2254: recipe for target ‘all-recursive’ failed
    | make[1]: *** [all-recursive] Error 1
    | Makefile:1484: recipe for target ‘all’ failed
    | make: *** [all] Error 2
    | ERROR: oe_runmake failed
    | WARNING: exit code 1 from a shell command.
    | ERROR: Function failed: do_compile (log file is located at /media/paulz/data/yocto/tizen-distro/build/tmp-glibc/work/cortexa7t2hf-vfp-vfpv4-neon-oe-linux-gnueabi/efl/1.12.2-r0/temp/log.do_compile.10450)
    ERROR: Task 3730 (/media/paulz/data/yocto/tizen-distro/meta-tizen/meta-tizen-common-share/recipes-efl/efl/efl_git.bb, do_compile) failed with exit code ‘1’
    Waiting for 2 running tasks to finish:
    0: linux-raspberrypi-4.1.0+git07009cab090ade3dd180e8a55d590b1a00072eed-r0 do_compile (pid 20506)

    • There are a number of packages that should be installed at the host for tizen to build. Those vary depending on the distribution you’re using. Take a look at the Tizen wiki for more about that: https://wiki.tizen.org/wiki/Build_Tizen_with_Yocto_Project. Also, sometimes I experience random build errors. Calling bitbake again or cleaning the caches usally fixes. In order to cleanup the caches, you can do:
      bitbake -c clean [package]
      you may also remove everything under build/tmp-glibc, build/ccache and/or build/sstate-cache.

  • AmirN says:

    The build is failing also with the following error:
    | configure: exit 1
    | ERROR: oe_runconf failed
    | WARNING: /home/anathoo/projects/tizen/tizen-distro/build/tmp-glibc/work/cortexa7t2hf-vfp-vfpv4-neon-oe-linux-gnueabi/pam/1.1.6-r0/temp/run.do_compile.10754:1 exit 1 from
    | exit 1
    | ERROR: Function failed: do_compile (log file is located at /home/anathoo/projects/tizen/tizen-distro/build/tmp-glibc/work/cortexa7t2hf-vfp-vfpv4-neon-oe-linux-gnueabi/pam/1.1.6-r0/temp/log.do_compile.10754)
    ERROR: Task 413 (/home/anathoo/projects/tizen/tizen-distro/meta-tizen/meta-tizen-common-base/recipes-extended/pam/pam_git.bb, do_compile) failed with exit code ‘1’
    Waiting for 0 running tasks to finish:
    NOTE: Tasks Summary: Attempted 509 tasks of which 16 didn’t need to be rerun and 1 failed.
    Waiting for 0 running tasks to finish:

    ============
    Some package error also during configure:
    ============
    checking for LIBSMACK… no
    configure: error: Package requirements (libsmack) were not met:

    No package ‘libsmack’ found

    • There are a number of packages that should be installed at the host for tizen to build. Those vary depending on the distribution you’re using. Take a look at the Tizen wiki for more about that: https://wiki.tizen.org/wiki/Build_Tizen_with_Yocto_Project.
      I suspect, however, that, for some reason, it failed to download some package from review.tizen.org. Try to run bitbake again and check at the warnings if it was able to download everything or if there are some warnings that some package(s) weren’t downloaded.

      • AmirN says:

        Hi,

        I managed to build the image, by doing a cleansstate and forcing bitbake to rebuild the problem component. I was able to build both the bare rpi image and the crosswalk image.

        However the crosswalk image does not seem to work after following the instruction to flash the SD card. My rpi keeps rebooting after a very brief flash on the screen. And the serial interface does not seem to work either, so I don’t have a way to see what’s going on.

  • AmirN says:

    The raspberry pi keeps rebooting before it has finished the boot process.

    I was able to capture a video of the screen flashing for a split second and it show the following errors on the display during the boot process:

    display-manager.service changed failed -> start
    double free or corruption (fprev): 0x017219b0 *****

    The double free is causing WATCHDOG timer to trigger and the rpi is rebooting.

    Amir.

  • Kevin Welsh says:

    I’m trying to build an image on Ubuntu 14.04 (64 bit) following this guide, but it seems that there’s some complications trying to get the pam compiled. I noticed on the older guide that they had a section mentioning a workaround for pam. I tried pulling “origin/tizen-debianhost” but during the auto-merging, two conflicts came up (efl.inc and weston.inc).

    Kinda stuck now; anyone else have success building on Ubuntu 14.04? Is there some trick to getting pam? Any hints would be greatly appreciated.

  • Kerry Jones says:

    I’m getting a connection refused on the “git clone git://git.s-osg.org/tizen-distro.git” step – is the git server down? Are there any mirrors?

    • Kerry Jones says:

      just to clarify – the machine at git.s-osg.org is clearly up, but it’s refusing connections on port 9418 (I’m getting a RST/ACK packet back). Neither http nor https work either…one possible hint is that DNS is actually aliasing git.s-osg.org to lists.s-osg.org

  • Chi Vo says:

    Hello,

    Can I build Tizen with IVI profile?

    Could you please help to confirm?

    Thank you very much with best regards,
    Chi

  • JiahaoChen says:

    Thanks for your contribution.
    I installed the image successfully on raspbery pi 2.
    But except the wayland-terminator and gst-launch, I can’t run any app on raspberry pi.
    Does any one run the app successfully?

  • iosif says:

    ok downloaded the latest image and now how to burn it on the SD card? Is the format similar to images provided by raspberry for their OSes?

    I am on Windows machine

Leave a Reply to Paul Z. Cancel reply

Your email address will not be published. Required fields are marked *

Comments Protected by WP-SpamShield Anti-Spam