Tizen On ARTIK

From Tizen Wiki
Jump to: navigation, search

Introduction

Welcome to Tizen on ARTIK.
Samsung ARTIK offers a family of modules tailored for the Internet of Things(IoT). With a tiered architecture built for performance, optimized power consumption, and memory utilization and footprint, ARTIK modules are designed specifically for a variety of applications, from low-end wearables to powerful hubs with local processing and analytic.
With Tizen, a device manufacturer can begin with one of these profiles and modify it to serve their own needs, or use the Tizen Common base to develop a new profile to meet the memory, processing and power requirements of any device and quickly bring it to market.

Reference Site

ARTIK Series

ARTIK 5

Key features

  • Power efficient dual Cortex®-A7 with Wi-Fi, Bluetooth, ZigBee, Thread
  • Leverages Samsung ePoP technology to offer small footprint modules: 30 mm X 25 mm
  • 512MB RAM, 4GB flash (eMMC)
  • Enterprise class security with hardware secure element and Secure OS

High performance applications

  • Smart home gateway
  • Building Automation zone controllers
  • Lighting controllers
  • Security panels

ARTIK 7

Key features

  • High performance, 8-core, 64-bit Cortex® A-53 processor with Wi-Fi®, Bluetooth®, ZigBee®, Thread
  • ARM MALI™ GPU for multimedia, graphics applications
  • 1GB RAM, 4GB flash (eMMC)
  • Enterprise-class security with hardware secure element and Secure OS

High performance applications

  • Factory automation
  • Smart home gateway
  • Building Automation controllers
  • Multimedia applications

ARTIK 10

Key Features

  • Quad Cortex®-A15 + quad Cortex-A7 processor with Wi-Fi®, Bluetooth®, ZigBee® support
  • ARM MALI™ GPU for multimedia, graphics applications
  • Support for MIPI camera and HDMI displays
  • 2GB RAM, 16GB flash (eMMC)

High performance applications

  • Multimedia applications
  • Image processing
  • 3D graphics
  • Drones

Binary version

Tizen 3.0 common M2 released and you can download the below link. M2 means milestone. Tizen 3.0 common for ARTIK will be released every 3 or 6 months.

Get Started

The setup and installation steps are different based on what hardware you have.
Check your hardware, installation media, OS version, and peripheral.
1. Select your hardware

  • ARTIK 5
  • ARTIK 7
  • ARTIK 10

2. Select your installation media

  • Install onto my blank microSD card
  • Install onto eMMC of ARTIK

3. Select your OS version Only Tizen 3.0 supports to ARTIK

  • Tizen 3.0, Common profile

4. Prepare peripheral

  • PC with Linux Operating System
  • One of the ARTIK development boards: ARTIK 5 / ARTIK 7 / ARTIK 10
  • Cable
  1. ARTIK 5 : 1x USB type A <=> USB type mini B, 1x Cable : USB type A <=> USB type micro
  2. ARTIK 7 : 2x USB type A <=> USB type micro
  3. ARTIK 10 : 1x USB type A <=> USB type A, 1x Cable : USB type A <=> USB type micro
  • DC 5V / 5A by 2.5mm jack(If you use a adapter for power)
  • Option : Camera, LCD

Here is pictures to describe what ports have functions.

  • Red : SDB connection to download image file via fastboot or thor, ARTIK 10 needs to put USB type A(both side), ARTIK 5 is USB type mini B and ARTIK 7 is micro type.
  • Green : See the serial log from ARTIK.

- ARTIK 5
ARTIK5.jpg
- ARTIK 7
Artik7.jpg
- ARTIK 10
ARTIK10.jpg

5. Booting with Pre-built Image Continue the setup process by getting instructions you'll need to get up and running.

If you complete the booting process, you can see the message by UART port otherwise you can see menu screen through a connected display.

<UART Connection>

  • Login Password : tizen
Welcome to Tizen 3.0.0 (Tizen3/Common)!
localhost login: root

<Enable SDB>
- From ARTIK : Enable SDB.

root:~> direct_set_debug.sh --sdb-set
[ 1705.897118] [c3] usb_mode usb0: slp_multi_usb: Cannot enable ''
[ 1705.902365] usb_mode usb0: slp_multi_usb: enable SUCCESS 'sdb'
SDB enabled
[ 1706.353927] [c0] usb_mode usb0: can't send usb_state[

6. Building Tizen Image
Plase see the build guide section here

7. Tutorial For Hardware on ARTIK with Tizen

  • Check below link to use functionalities on ARTIK with Tizen.

https://wiki.tizen.org/wiki/Tutorial_for_Hardware_on_ARTIK_with_Tizen

  • Visit to below site to know how to get plugins for Hardware according to ARTIK
Mali DDK, WIFI and BT need to install each plugin into rootfs but we provide them seprately.

- Mali DDK
https://wiki.tizen.org/wiki/Tutorial_for_Hardware_on_ARTIK_with_Tizen#Plug-in_patch
- WIFI
WIFI plugins are not be provided due to license issue, but we provide the rootfs including WIFI plugins. Take the pre-built binary to use WIFI
visit to here binary

Build guide

Kernel/Boot Build

Install Utility

  • Cross compiler, u-boot-tools, android-tools-fastboot

- ARTIK 5 / 10

sudo apt-get install gcc-arm-linux-gnueabihf u-boot-tools android-tools-fastboot

- ARTIK7

sudo apt-get install gcc-aarch64-linux-gnu android-tools-fsutils device-tree-compiler

Get the latest source and build

Using your tizen.org account get the latest kernel code and build the kernel image easily using the following commands:

Kernel

  • Copy the script into your Host PC and build it for ARTIK 5 / 7 / 10.(Make build_linux.sh file with the below contents)
#!/bin/bash

export ARCH=arm
export JOBS=`getconf _NPROCESSORS_ONLN`
export CROSS_COMPILE=arm-linux-gnueabihf-

set -e

error()
{
        JOB="$0"              # job name
        LASTLINE="$1"         # line of error occurrence
        LASTERR="$2"          # error code
        echo "ERROR in ${JOB} : line ${LASTLINE} with exit code ${LASTERR}"
        exit 1
}

package_check()
{
        command -v $1 >/dev/null 2>&1 || { echo >&2 "${1} not installed. Please install \"sudo apt-get install $2\""; exit 1; }
}

set_envs()
{
        if [ $# -lt 1 ]; then
                echo "Usage: ./build_linux.sh [artik10|artik5|artik710]"
                exit
        elif [ "$1" = "artik5" ]; then
                kernel_defconfig=artik5_defconfig
                kernel_dtb=exynos3250-artik5.dtb
                kernel_image=zImage
        elif [ "$1" = "artik10" ]; then
                kernel_defconfig=artik10_defconfig
                kernel_dtb=exynos5422-artik10.dtb
                kernel_image=zImage
        elif [ "$1" = "artik710" ]; then
                export ARCH=arm64
                export CROSS_COMPILE=aarch64-linux-gnu-

                kernel_defconfig=artik710_raptor_defconfig
                kernel_dtb=s5p6818-artik710-raptor-*.dtb
                kernel_image=Image
                dtb_suffix=/nexell
        else
                exit
        fi

        package_check make_ext4fs android-tools-fsutils
        package_check arm-linux-gnueabihf-gcc gcc-arm-linux-gnueabihf

        TARGET_BOARD=$1

        KERNEL_IMAGE=$kernel_image
        KERNEL_DEFCONFIG=$kernel_defconfig
        DTB_PREFIX_DIR=arch/${ARCH}/boot/dts${dtb_suffix}
        KERNEL_DTB=$kernel_dtb
        MODULE_SIZE=32
}

########## Start build_kernel ##########

build_modules()
{
        make modules_prepare
        make modules -j$JOBS

        mkdir -p modules
        make modules_install INSTALL_MOD_PATH=modules INSTALL_MOD_STRIP=1
        make_ext4fs -b 4096 -L modules -l ${MODULE_SIZE}M modules.img modules/lib/modules/
        rm -rf modules
}

install_kernel_output()
{
        if [ $TARGET_BOARD = "artik5" ] || [ $TARGET_BOARD = "artik10" ]; then
                cat arch/$ARCH/boot/$KERNEL_IMAGE $DTB_PREFIX_DIR/$KERNEL_DTB > $KERNEL_IMAGE
        else
                cp arch/$ARCH/boot/$KERNEL_IMAGE .
        fi
        cp $DTB_PREFIX_DIR/$KERNEL_DTB .
}

build_kernel()
{
        make distclean
        make $KERNEL_DEFCONFIG
        make $KERNEL_IMAGE -j$JOBS
        make dtbs

        build_modules
        install_kernel_output
}
#######################################

trap 'error ${LINENO} ${?}' ERR

set_envs $@

build_kernel
  • Build with Script

For ARTIK 5 / 7 / 10

./build_linux.sh artik10 or ./build_linux.sh artik710 or ./build_linux.sh artik5
  • Kernel for ARTIK 10 and 5
$ git clone ssh://your_id@review.tizen.org:29418/profile/common/platform/kernel/linux-3.10-artik linux-3.10-artik
$ cd linux-3.10-artik
$ git checkout tizen_3.0

If you done to build for artik5 or 10, you can find output here. - linux-3.10-artik/ for modules.img
- linux-3.10-artik/arch/arm/boot for zImage
- linux-3.10-artik/arch/arm/boot/dts for exynos5422-artik10.dtb or exynos3250-artik5.dtb
You can flash the files into ARTIK 5 or 10 using fastboot utility.

  • Kernel for ARTIK 7
$ git clone ssh://your_id@review.tizen.org:29418/profile/common/platform/kernel/linux-artik7
$ cd linux-artik7
$ git checkout tizen_3.0

If you done to build for artik7, you can find output here. - linux-artik7/ for Iamge, modules.img, 5p6818-artik710-raptor-rev00.dtb, s5p6818-artik710-raptor-rev001.dtb, s5p6818-artik710-raptor-rev03.dtb
You can flash the files into ARTIK 7 using fastboot utility.

Boot

  • Copy the script into your Host PC and build it for ARTIK 5 / 7 / 10.(Make build_uboot.sh file with the below contents)
#!/bin/bash

export ARCH=arm
export JOBS=`getconf _NPROCESSORS_ONLN`
export CROSS_COMPILE=arm-linux-gnueabihf-

set -e

error()
{
        JOB="$0"              # job name
        LASTLINE="$1"         # line of error occurrence
        LASTERR="$2"          # error code
        echo "ERROR in ${JOB} : line ${LASTLINE} with exit code ${LASTERR}"
        exit 1
}

package_check()
{
        command -v $1 >/dev/null 2>&1 || { echo >&2 "${1} not installed. Please install \"sudo apt-get install $2\""; exit 1; }
}

set_envs()
{
        if [ $# -lt 1 ]; then
                echo "Usage: ./build_uboot.sh [artik10|artik5|artik710]"
                exit
        elif [ "$1" = "artik5" ]; then
                chip_name=espresso3250
                uboot_defconfig=artik5_config
                uboot_spl=espresso3250-spl.bin
                uboot_image=u-boot.bin
                uboot_env_section=.rodata
        elif [ "$1" = "artik10" ]; then
                chip_name=smdk5422
                uboot_defconfig=artik10_config
                uboot_spl=smdk5422-spl.bin
                uboot_image=u-boot.bin
                uboot_env_section=.rodata
        elif [ "$1" = "artik710" ]; then
                export ARCH=arm64
                export CROSS_COMPILE=aarch64-linux-gnu-

                chip_name=s5p6818
                uboot_defconfig=artik710_raptor_config
                uboot_spl=
                uboot_image=fip-nonsecure.img
                uboot_env_section=.rodata.default_environment
        else
                exit
        fi
        package_check make_ext4fs android-tools-fsutils
        package_check arm-linux-gnueabihf-gcc gcc-arm-linux-gnueabihf

        CHIP_NAME=$chip_name
        TARGET_BOARD=$1
        #BUILD_DATE=`date +"%Y%m%d.%H%M%S"`
        BUILD_DATE=`date +"%Y%m%d"`

        UBOOT_DEFCONFIG=$uboot_defconfig
        UBOOT_SPL=$uboot_spl
        UBOOT_IMAGE=$uboot_image
        UBOOT_ENV_SECTION=$uboot_env_section
}

die() {
        if [ -n "$1" ]; then echo $1; fi
        exit 1
}

########## Start build_uboot ##########

gen_uboot_envs()
{
        cp `find . -name "env_common.o"` copy_env_common.o
        ${CROSS_COMPILE}objcopy -O binary --only-section=$UBOOT_ENV_SECTION \
                `find . -name "copy_env_common.o"`

        tr '\0' '\n' < copy_env_common.o | grep '=' > default_envs.txt
        cp default_envs.txt default_envs.txt.orig
        tools/mkenvimage -s 16384 -o params.bin default_envs.txt

        # Generate recovery param
        sed -i -e 's/rootdev=.*/rootdev=1/g' default_envs.txt
        sed -i -e 's/partitions=uuid_disk/partitions_default=uuid_disk/g' default_envs.txt
        sed -i -e 's/partitions_tizen=uuid_disk/partitions=uuid_disk/g' default_envs.txt
        sed -i -e 's/bootcmd=run .*/bootcmd=run sdrecovery/g' default_envs.txt
        tools/mkenvimage -s 16384 -o params_recovery.bin default_envs.txt

        # Generate sd-boot param
        cp default_envs.txt.orig default_envs.txt
        sed -i -e 's/rootdev=.*/rootdev=1/g' default_envs.txt
        tools/mkenvimage -s 16384 -o params_sdboot.bin default_envs.txt
}

gen_fip_image()
{
        if [ "$UBOOT_IMAGE" = "fip-nonsecure.img" ]; then
                tools/fip_create/fip_create --dump --bl33 u-boot.bin fip-nonsecure.bin
        fi
}
gen_nexell_image()
{
        local chip_name=$(echo -n ${CHIP_NAME} | awk '{print toupper($0)}')
        case "$CHIP_NAME" in
                s5p4418)
                        nsih_name=raptor-emmc.txt
                        input_file=u-boot.bin
                        output_file=$UBOOT_IMAGE
                        gen_tool=BOOT_BINGEN
                        FIP_LOAD_ADDR=0x43c00000
                        launch_addr=$FIP_LOAD_ADDR
                        ;;
                s5p6818)
                        nsih_name=raptor-64.txt
                        input_file=fip-nonsecure.bin
                        output_file=fip-nonsecure.img
                        hash_file=fip-nonsecure.bin.hash
                        gen_tool=SECURE_BINGEN
                        FIP_LOAD_ADDR=0x7df00000
                        launch_addr=0x00000000
                        ;;
                *)
                        return 0 ;;
        esac

        tools/nexell/${gen_tool} \
                -c $chip_name -t 3rdboot \
                -n ../tools/nexell/nsih/${nsih_name} \
                -i ${input_file} \
                -o ${output_file} \
                -l $FIP_LOAD_ADDR -e ${launch_addr}
}

build_uboot()
{
        make distclean
        make distclean O=output
        make $UBOOT_DEFCONFIG O=output
        if [ "$UBOOT_SPL" != "" ]; then
                make spl all -j$JOBS O=output
        else
                make -j$JOBS O=output
        fi

        pushd output
        if [ "$UBOOT_SPL" != "" ]; then
                cp spl/$UBOOT_SPL bl2.bin
        fi


        gen_fip_image
        gen_nexell_image
        gen_uboot_envs

        popd
}

#######################################

trap 'error ${LINENO} ${?}' ERR

set_envs $@

build_uboot
  • Boot for ARTIK 10 and 5
$ git clone ssh://your_id@review.tizen.org:29418/profile/common/platform/kernel/u-boot-artik
$ cd u-boot-artik
$ git checkout tizen_3.0

If you done to build for artik5 or 10, you can find output here. - u-boot-artik/output/ for u-boot.img, params.bin
You can flash the files into ARTIK 5 or 10 using fastboot utility.

  • Boot for ARTIK 7
$ git clone ssh://your_id@review.tizen.org:29418/profile/common/platform/kernel/u-boot-artik7
$ cd u-boot-artik7
$ git checkout tizen_3.0

If you done to build for artik7, you can find output here.
- u-boot-artik7/output/ for fip-nonsecure.img, params.bin
You can flash the files into ARTIK 7 using fastboot utility.

Recovery Tizen on ARTIK

If you see the problem during flashing the image on eMMC of ARTIK, Refer to the page below.

Connection to ARTIK Cloud

  • ARTIK integrates seamlessly with ARTIK cloud so you can integrate an entire network of devices and clouds for your IoT product line.

Visit to below github to know how to use ARTIK-cloud and make up IoT services based on ARTIK cloud.
https://github.com/tizen-artik/cloudSample : installation rpms (you can compose the example of IoT Services
https://github.com/tizen-artik/node_iotbus : how to build iotbus to control System I/O
https://github.com/tizen-artik/iotbus : how to build iotbus node modules

Here is an example for IoT service based on ARTIK-Cloud.
- Home Automation IoT Services
ARTIK CLOUD.jpg
- Sensor(Light Sensor) : The sensor will detect ambient light at home and send the data to ARTIK-cloud.
- Actuator(Motor) : The actuator will rotate for the blind at home according to ARTIK-cloud private rule, ARTIK cloud will give an action.
Graph.png
- Sensor Data graph in ARTIK-cloud : The graph shows Sensor data from ARTIK-5(light sensor).

Tizen Compliance Test

We provide TCT binary and guide to check functionalities for Tizen. There is Native and Web TCT but common profile on ARTIK has tested with Native TCT.
TCT binary has tested with M2 binary of Tizen(check the version).

Resources