August 3, 2016 - Phil Coval

How to Boot Tizen on ARTIK

The fact that Tizen can be run on ARTIK is not the latest breaking news, considering it was previously demonstrated live at the 2015 Tizen Conference. There, the ARTIK project was also explained as an IoT platform of choice. Since then, ARTIK has become a new Tizen reference device, so here are a couple of hints that will help you test upcoming Tizen release on this hardware. First let me point out that Tizen’s wiki has a special ARTIK category, where you’ll find ongoing documentation efforts, you’ll want to bookmark this page.

In this article, I will provide a deeper explanation of how to use the bleeding edge version of Tizen:3.0:Common on ARTIK10, and how to start working on this platform. As explained in my previous Yocto/meta-artik article, I suggest you avoid using the eMMC for development purposes; for this article I will boot the ARTIK from an SDcard. In the long term I think it could be possible for the community to assemble Tizen infrastructure that automatically builds bootable SDcard tizen images to save time, but I’ll detail the whole process here in the meantime.

The Short and Easy Path

For your convenience, you can download an image of the build I’ll be describing here (md5=0d21e2716f67a16086fdd2724e7e11f1). It’s a binary image of the latest Tizen weekly development version (plus the latest IoTivity build too) prepared for the ARTIK10. All you have to do is flash it to the SD card, switch SW2/1 to on and SW2/2 to off, setup USB link to change a couple of U-Boot variables (set rootdev 1 ; set rootpart 3 ; boot ) as explained later in this tutorial.

If you want to take the long road, or you want to do this for the ARTIK5, follow the rest of this guide; it will explain how to build Tizen and IoTivity to run on the ARTIK.

Download Tizen

Development for the Tizen project is a continuous process, the latest version can be downloaded here.

In theĀ images/arm-wayland/ sub folder you’ll need to download 2 archives, the first is the boot image, which is different based on whether you’re using the ARTIK5 or ARTIK10. This image includes kernel and modules and the bootloader. The main difference between the ARTIK5 and ARTIK10 images is that U-Boot parameters are written at different media offsets.

I’m using the ARTIK10 for this guide, so I downloaded the tar.gz file found here. If you want to save bandwidth and time, it’s possible to grab a headless image archive tizen-common-artik_YYYYMMDD.*_common-headless-3parts-armv7l-artik.tar.gz.

If you own an ARTIK5, download the image from here; the ARTIK1 is totally different and it’s unlikely the same Tizen 3 codebase will be ever supported.

Prepare the SD Card

To write data to SD card, I’ll use the helpful sdboot script to handle the partitioning, formating and copying tasks that would be done manually using dd.

Insert the SD card into the host computer and identify the device node:

Next, partition the SD card (8GB is minimal requirement), and format no less than 6 partitions.

In the repo that was cloned earlier there is tizen-sd-bootloader-artik10.tar.gz; this contains early stages of the signed bootloader (bl1.bin, bl2.bin and ARM Trust Zone Software tzsw.bin). Note: don’t be confused by the “tz” in “twsw.bin” it means ARM TrustZone software not Tizen. The general purpose is to establish a chain of trust to ensure software integrity. The general purpose is to establish a chain of trust to ensure software integrity. U-boot.bin and its parameters file params.bin will be overridden later, and uInitrd, while not totally mandatory, will be helpful to setup systemd and mount the modules partition.

Use the mk_sdboot.sh helper script to write these files at the specific offets (Seek by 1231 for artik10’s U-Boot params file):

Now, the SDcard should be able to launch U-Boot’s shell, so the next step is to prepare the operating system. Copy the Linux kernel to the 1st partition and its modules to the 2nd, and override the copied uboot and params just before the 1st partition:

Now, you can try to boot the kernel if you want, but let’s also dump Tizen’s rootfs to our SD card’s 3rd partition. Along with this, 2 other partitions are copied too: user and systemd-data.

The device should now be capable of booting into Tizen.

Boot Tizen

For the purpose of this guide, I’m going to assume you’ve already booted your ARTIK with an existing OS (Fedora) or others (Ubuntu, Yocto) and know how to setup your debug link.

Power up the ARTIK10.

Hit any key to stop and get a shell, if you don’t, U-Boot will try to boot the OS from the eMMC. Once you are in UBoot’s shell, change some variables temporarily:

In the next step of the boot process, the kernel, device tree and rootfs are loaded and executed:

Login to Tizen

The first boot will take a bit longer than usual, but eventually a prompt will appear that will allow you to login as root with “tizen” as the password:

Hotfix

I noticed a critical bug that can be worked around for now. Some daemons are causing damage to the root filesystem after a short period (less than 5 minutes), I suspect they could generate too much output and fill our low disk space, this is something that needs to be investigated. As a temporary solution, they should be stopped as soon as possible:

To make sure they won’t be re installed / restarted, they need to also be renamed:

Then, make sure the modules partition is mounted and matches the kernel version:

If not you aren’t using uInitrd, you’ll have to tweak fstab.

Connect to the Network

Check to make sure the network is working and the device has an IP address assigned to it:

If it doesn’t, it can be set it up manually after loading the AX8817X USB NIC’s driver:

The LAN’s DHCP server should then assign an IP address to the device.

Install Packages

The headless image should already have zypper installed, it will be used for this section. If for some reason it’s not part of the image, it’s possible to use sdb to install it. This is outside the scope of this article, but if you have questions, feel free to post them to the comment section.

First, add the remote repos:

Now it’s possible to install packages and upgrade the distro to latest snapshot.

Take IoTivity for a Spin.

What’s next? Many people have expressed interest in using IoTivity on new platforms like Tizen, so let’s take a look at some of the IoTivity apps.

The binary image I shared at the beginning of this article contains the recently-released iotivity-1.1.1. I built it locally from sources using GBS on the 1.1.1 git tag with security enabled. The example apps must be run in the same directory where *.dat files are stored. Here are some instructions to launch a sample app I described in my previous article on IoTivity on ARTIK:

What’s Next?

I’m going to continue hacking away at Tizen on my ARTIK10, stay tuned for more articles about developing on these platforms. Also check upcoming Tizen Community Online Meeting, a live chat about ARTIK is planned this fall , see you there.

Development Boards for Tizen IoT from Samsung Open Source Group
Phil Coval

About Phil Coval

Philippe has been involved with the Tizen project since 2012 when he became the co-maintainer on some of the distributions domain's in the Common profile. He now works for the Samsung Open Source Group where he actively supports community contributions by helping others who have an interest in free software and open hardware. In particular, he is actively involved in the Tizen and IoTivity communities.

Development / Embedded Technology / IoTivity / Linux / Tizen / Users ARTIK / artik10 / IoT / iotcon / IoTivity / Tizen / uboot /

Comments

  • […] article is a direct follow up of my previous post about booting Tizen on the ARTIK10. Before starting, you should bookmark this wiki page as an entry point for Tizen on ARTIK […]

  • […] the IoTivity server. For more information about this, check out the previous blog posts about booting tizen on ARTIK and building software for Tizen OS. These will show you how to rebuild the latest version of […]

  • Piligrim says:

    Dear Phil,

    Thanks a lot for a bunch of material concerning Artik boards!
    I’ve found it very informative!
    Anyway, I cannot find the information about the boot sequence regarding TrustZone binaries, like “tzsw.bin”.
    Also I cannot find information about current TrustZone’s interoperation model.
    Where is located TrustZone’s monitor software? BL1, BL2, tzsw?
    How do they interoperate?

    Can you please explain, or at list give web resources, where listed questions may be enlighten?

    Thank you!

    WBR,
    Piligrim

    • Phil Coval Phil Coval says:

      I guess the flow is:
      ROM, BL1, (BL2 + TrustZone), U-BOOT, Linux kernel, Tizen OS’s userland

      Boot level files are coming from tizen-artik

      You’ll find more hints online on ARM or Linaro website

      If you want to share your discoveries don’t hesitate to update tizen’s wiki:

      https://wiki.tizen.org/Category:ARTIK

      Regards

  • Piligrim says:

    Dear Phil,

    thank you for a quick response!
    I got you point.
    Probably you may know right person to get this information without reverse engineering.
    Would you be so kind to give a public blog link or public person’s e-mail responsible for this?
    Thanks!

    WBR,
    Piligrim

Leave a Reply to Get Started with IoTivity Interactions on the ARTIK10 and Tizen - Samsung Open Source Group Blog Cancel reply

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

Comments Protected by WP-SpamShield Anti-Spam