The Raspberry Pi is the most popular single-board computer with more than 5 million sold. While there are numerous Linux Distributions that run on RPI including Raspbian, Pidora, Ubuntu, OSMC, and OpenElec, the Tizen OS does not currently run on it. Since Tizen is being positioned as an important player within the growing Internet of Things (IoT) ecosystem, providing a Raspberry PI 2 port can help developers gain more Tizen experience. For this reason, the Samsung Open Source group decided to work on such port. This article will go over how to build a bootable Tizen image for Raspberry Pi from a computer running Linux.

The Raspberry Pi 2 has several advantages over the first version. Among them:

It has a quad-core CPU

It runs at 900 MHz

It uses an ARM Cortex-A7 CPU

The ARM Cortex-A7 CPU is very nice since most distributions are compiled to use the arm instruction set found on ARMv7 processors.

Initial Tests

Before doing a native Tizen build, we needed to determine if the new Raspberry PI2 was capable of running Tizen. To do this, we used a small trick: we downloaded a pre-built Tizen image found at tizen.org and borrowed a Debian boot image. Since the Tizen root image was built for ARMv7, the image ran properly on Raspberry Pi 2, except for a few issues related to graphics. That gave us enough confidence to go to step 2: building the boot image and root machine targeted for Raspberry Pi2.

Building Images on Tizen

Currently, as described on the Tizen Wiki, there are two ways used to build a Tizen image:

Via GBS: The “traditional” way, which requires setting up a GBS server to compile several packages

Via Yocto: The “new” way, which uses OpenEmbedded bitbake recipes to generate the image. This can easily be done on a user’s machine, provided a good Internet link is available.

GBS would require a lot of time, and we would need to allocate a dedicated build server, because of this, we decided to use Yocto to produce the images.

Creating a Tizen image for Raspberry PI2

BEFORE STARTING: As Yocto build will download lots of packages, you should ensure that your firewall policy won’t be blocking ftp, http, https and git protocols, as otherwise the build may fail.

1) Create a Local Copy of tizen-distro

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:

git clone git://git.s-osg.org/tizen-distro.git

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 is:

cd tizen-distro
git clone git://git.s-osg.org/meta-raspberrypi.git

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 setup the build environment in order to use bitbake. It should be noted that some packages may be needed to be installed, depending on the distribution you’re using at 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:

source ./tizen-common-init-build-env build

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:

MACHINE ??= "raspberrypi2"

This will tell bitbake that it should compile for 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 following command:

bitbake rpi-hwup-image

NOTE: On some distros, this step will cause an error (this has been confirmed on multiple Debian-based distros):

Get Involved

Now, You’re ready to use Tizen on your Raspberry PI 2. 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

Share this:

Author: Mauro Carvalho Chehab

Mauro is the maintainer of the Linux kernel media and EDAC subsystems and Tizen on Yocto. He's also a major contributor to the Reliability Availability and Serviceability (RAS) subsystems.
View all posts by Mauro Carvalho Chehab

I tried tizen.rpi-sdimg.2015-08-12 on my Pi-2.
I can ssh into it on ethernet just fine.
But when I plug it into an HDMI TV, I get no picture, apart from a quick flash of some white text every 10 sec.
I assume there should be a graphic display? Or should I be using a different img?
@andysc

I put it into HDMI safe mode in config.txt, and I had long enough this time to see an error message:
*** Error in /usr/bin/weston: double free or corruption (tprev) 0x1c309b0 ***
That would explain why I’m getting no image then :)
Any ideas?

I have now also tried it with tizen-common-core-image-crosswalk-dev-raspberrypi2.rpi-sdimg-2015-08-14
same problem:
*** Error in /usr/bin/weston: double free or corruption (tprev) [different hex number] ***
coming up every 10 sec then blank screen again.

Really strange! Can you provide any additional information about what’s plugged into the Pi-2? USB devices, what kind of monitor..
Since you can ssh in, you should be able to see weston’s log file in /run/display/weston.log
This might have a backtrace I can use to find the crash.

Weston will fail to start if you don’t have a keyboard or mouse connected – perhaps that’s what you’re seeing? If the log says failed to create input device, that’s probably what you’re looking at.

Still interested in the double free error if there’s a backtrace in the log though…

I ran into the same problem – got the hint on irc that it might be related to weston not liking to start without input devices (thanks ManMower!). Once I plugged in a keyboard+mouse the problem went away.

Yes, the image doesn’t have many packages installed on it, just the basic stuff. It is possible to compile extra packages via Yocto or gbs and then install the built rpm files on Tizen.

With regards to performance, it is because 3D accel wasn’t enabled yet. Weston/Wayland requires mesa to compile a wayland-egl driver for accel. I’m currently doing some tests to see if I can enable 3D on it, using a Broadcom’s userland fork that contains its own version of wayland-egl. I’ll post here the information and add the new images once its done.

I didn’t test wifi on it. Support for wifi requires to have the Kernel module for the wifi chip used on your dongle, plus the corresponding firmwares. As you’re seeing wlan0, then the Kernel module is probably compiled. So, I would check if the firmware needed for your dongle is there. That’s said, I’m not sure if the wifi userspace tools are packaged on the current image. Perhaps you’ll need to compile it manually.

I succeeded to build the tizen image with yocto and boot it up.
There are four windows.
guest, carol, bob and alice.
I connected mouse, keyboard and hdmi monitor.
How can I shutdown tizen?
And I have another question.
I connected the UART of raspberry pi2 to my host pc.
I want to see the kernel message and login.
How do I do?
Please help me.

The only way that I’m aware of to shut it down properly is to issue “shutdown now” from a terminal as root. However, I haven’t had any problems with simply unplugging the RPi2 when I need to turn it off.

As for your other question, I haven’t used UART, so I’m not familiar with how that works. I’ve been connecting to my RPi2 via ssh over my local network and that has served me well so far. If you don’t have the option to connect it with an Ethernet cable, you can use our guide to setup WiFi on the device and connect that way: http://blogs.s-osg.org/setup-wifi-raspberry-pi-2-tizen/

Thanks for your comment.
I added “console=ttyAMA0” into cmdline.txt on first partition.
I saw the message on UART.
Do you know the root password?
In rpi-hwup-image.bb, there is a function – set_root_passwd().
It changes no root passwd into “wYNffsf6sozwE:%”.
I can’t find out the real passwd from shadow.

Hi ,
After adding console into cmdline.txt file , i saw log on serial console.
But , the shell is not taking the input from me .
It is not asking for me any passwords like that .
I connected mouse , key board and mouse.
I can”t find the real problem.

Hi all,
I took the tizen prebuilt images for the rpi 2 . After flashing , put the sd card into the board . I was able to see some log on the serial port. I was not able to see the display . I am seeing the systemd related error messages in the log .

If I use –ignorearch option while installing, RPM installation will be successful but
running binary gives error as :-
root@raspberrypi2:~# simpleclient
-sh: /usr/bin/simpleclient: No such file or directory

I’m trying to build an image on Ubuntu 14.04 (64 bit) following the newer guide, but it seems that there’s some complications trying to get the pam compiled. 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.