Booting Tizen 3.0 From eMMC On ARTIK

From Tizen Wiki
Jump to: navigation, search

« back to Tizen_On_ARTIK

Introduction

This document describes how to create boot-able eMMC For ARTIK-5/7/10 with Tizen 3.0. Currently we are supposing that you connected LCD and Camera module to ARTIK-5/7/10. Different from ARTIK-10/7 (Available touch LCD and HDMI monitor), you need to use BT keyboard/mouse for input method in case of ARTIK-5, Regarding such variants, refer to wiki page Tizen On ARTIK

In this page, we describe how to run Tizen 3.0.

Requirements

Ubuntu 14.04 or higher version as Host PC
eMMC with higher than 4GB eMMC

Tools

  • fastboot
1. Edit repository source list
$ sudo vi /etc/apt/sources.list
2. Add the Tizen tools repository by appending the following line, saving, and quitting
deb http://download.tizen.org/tools/latest-release/Ubuntu_14.04/

To following error might occur during the installation (started happening in 2016):

sudo apt-get update
E: Malformed line 59 in source list /etc/apt/sources.list (dist)
E: The list of sources could not be read.

To solve the issue, make sure that the Tizen repository has been specified correctly at /etc/apt/sources.list

deb http://download.tizen.org/tools/latest-release/Ubuntu_14.04/ /
3. Install the tool
$ sudo apt-get update
$ sudo apt-get install android-tools-fastboot
$ sudo apt-get install lthor
4. Add a rule for fastboot(HOST PC/Ubuntu)
$ vi /etc/udev/rules.d/51-android.rules 
SUBSYSTEM=="usb",ATTR{idVendor}=="18d1",MODE="0666"
  • lthor
1. Install the tool
You can download it from download.tizen.org. Choose your system version and find the lthor package.

Fuse Tizen 3.0 image into the eMMC

  • Before flashing the image, check requirement.

Refer to the page

  • Change Bootloader

Default operating system is fedora and it is installed into ARTIK basically. If you want to use Tizen OS, the boot of ARTIK has to be changed for Tizen.
Fastboot utility is able to flash Tize boot into eMMC of ARTIK and then use thordown utility to flash platform image easier than before.

Download Tizen 3.0 common image for ARTIK

You can download the beta release version for Tizen Boot image using the link below: Download each binary to use in your target according to each board

Power On ARTIK

To turn on ARTIK board, you have do switch on power swith and press power key.

  • Brown : Power Switch
  • Yellow : Power Key
  • Red : SW Reset Key

- ARTIK 5 : press the button
ARTIK5 new.jpg
- ARTIK 7 : press the button for 3 seconds
Artik7 new.jpg
- ARTIK 10 : press the button
ARTIK10 new.jpg

Fuse images using through utility

ARTIK 5 / 10

Boot image

If you flash Tizen boot first time, you need to type as 'fastboot' and flash u-boot.bin and params.bin to set up proper partition for Tizen. Otherwise, you can type as 'run tizen format'

  • Using fastboot

- From target

Powner on
Press the right button of power switch
Press the 'enter' key on your keyboard to stop the booting on the bootloader
Enter the 'run tizen_format' command as follwoing on bootloader:
ARTIK5 # run tizen_format
Writing GPT: success!
[Partition table on MoviNAND]
ptn 0 name='fwbl1' start=0x0 len=N/A (use hard-coded info. (cmd: movi))
ptn 1 name='bl2' start=N/A len=N/A (use hard-coded info. (cmd: movi))
ptn 2 name='bootloader' start=N/A len=N/A (use hard-coded info. (cmd: movi))
ptn 3 name='tzsw' start=N/A len=N/A (use hard-coded info. (cmd: movi))
ptn 4 name='env' start=N/A len=N/A (use hard-coded info. (cmd: movi))
ptn 5 name='kernel' start=N/A len=N/A
ptn 6 name='ramdisk' start=N/A len=0x1a00000(~26624KB)
ptn 7 name='dtb' start=N/A len=N/A
ptn 8 name='boot' start=0x100000 len=0x2000000(~32768KB)
ptn 9 name='modules' start=0x2100000 len=0x2000000(~32768KB)
ptn 10 name='rootfs' start=0x4100000 len=0x80000000(~2097152KB)
ptn 11 name='system-data' start=0x84100000 len=0x10000000(~262144KB)
ptn 12 name='user' start=0x94100000 len=0x30fcfbe00(~12841967KB)
Insert a USB cable into the connector!

- From Host PC

### Flash the image to eMMC device
sudo fastboot flash env params.bin
sudo fastboot flash bootloader u-boot.bin
sudo fastboot flash kernel zImage
For ARTIK5 >>
sudo fastboot flash dtb exynos3250-artik5.dtb
For ARTIK10 >>
sudo fastboot flash dtb exynos5422-artik10.dtb

sudo fastboot flash modules modules.img
  • Using thor

- From Target

Powner on
Press the right button of power switch
Press the 'enter' key on your keyboard to stop the booting on the bootloader
Enter the 'run tizen_format' command as follwoing on bootloader:
ARTIK5 # thordown
TIZEN "THOR" Downloader
DFU alt info setting: done

- From Host PC For ARTIK5

$ lthor tizen-common-artik_XXXXXXXX.X_common-boot-armv7l-artik5.tar.gz

For ARTIK10

$ lthor tizen-common-artik_XXXXXXXX.X_common-boot-armv7l-artik10.tar.gz
Platform image
  • Using fastboot

- From Target

$ fastboot

- From Host PC
Before complete the flashing the image, do not turn of the target. If the image is sent, the image will flash into the target.

$ sudo fastboot flash rootfs rootfs.img
$ sudo fastboot flash user user.img
$ sudo fastboot flash system-data system-data.img
  • Using thor

- From Target

Powner on
Press the right button of power switch
Press the 'enter' key on your keyboard to stop the booting on the bootloader
Enter the 'run tizen_format' command as follwoing on bootloader:
ARTIK5 # thordown
TIZEN "THOR" Downloader
DFU alt info setting: done

- From Host PC

$ lthor tizen-common-artik_XXXXXXXX.X_common-wayland-3parts-armv7l-artik.tar.gz

ARTIK 7

Boot image

If you flash Tizen boot first time, you need to type as fast 0 and flash partmap_artik710_emmc.txt and partition.txt to set up proper partition for ARTIK7.
If you use tizen boot, you can flash boot and platform through downloading utility(fastboot, thor).

Flash partmap and partition

- From target
Here is Fedora boot log when you bring up the target first. Press enter key to enter the boot mode to flash partmap and partition files. If you can see tizen boot log at first, you can go to Tizen boot section.
# Fedora Boot

U-Boot 2016.01 (Aug 02 2016 - 10:19:02 +0900)
DRAM:  896 MiB
HW Revision:    3
MMC:   NEXELL DWMMC: 0, NEXELL DWMMC: 1
In:    serial
Out:   serial
Err:   serial
Cannot read from device: 0000000075f47d20 register: 0x10 -121
Cannot read sensor type - -121
Net:   
Warning: ethernet@c0060000 (eth0) using random MAC address - de:1f:8c:f3:57:f1
eth0: ethernet@c0060000
Hit any key to stop autoboot:  0 
artik710#

Flash partmap_artik710_tizen_emmc.txt and patition.txt Copy the below string and make it as partmap_artik710_tizen_emmc.txt file.
- partmap_artik710_tizen_emmc.txt

flash=mmc,0:2ndboot:2nd:0x200,0x10000:bl1-emmcboot.img;
flash=mmc,0:fip-loader:boot:0x10200,0x50000:fip-loader-emmc.img;
flash=mmc,0:fip-secure:boot:0x60200,0x180000:fip-secure.img;
flash=mmc,0:fip-nonsecure:boot:0x1E0200,0x100000:fip-nonsecure.img;
flash=mmc,0:env:env:0x2E0200,0x4000:params.bin;
flash=mmc,0:boot:ext4:0x400000,0x2000000:boot.img;
flash=mmc,0:modules:ext4:0x2400000,0x2000000:modules.img;
flash=mmc,0:rootfs:ext4:0x4400000,0x80000000:rootfs.img;
flash=mmc,0:system-data:ext4:0x84500000,0x40000000:system-data.img;
flash=mmc,0:user:ext4:0xC4500000,0:user.img;

- From Target
Type as fast 0 and wait to receive txt file from you host pc.

artik710# 
artik710# fast 0

Ready : artik710# fast 0

Ready : Starting download of 576 bytes

downloading of 576 bytes finished

Fastboot Partitions:
 mmc.0: 2ndboot, img : 0x200, 0x10000
 mmc.0: fip-loader, img : 0x10200, 0x50000
 mmc.0: fip-secure, img : 0x60200, 0x180000
 mmc.0: fip-nonsecure, img : 0x1e0200, 0x100000
 mmc.0: env, img : 0x2e0200, 0x4000
 mmc.0: boot, fs : 0x400000, 0x2000000
 mmc.0: modules, fs : 0x2400000, 0x2000000
 mmc.0: rootfs, fs : 0x4400000, 0x80000000
 mmc.0: system-data, fs : 0x84500000, 0x40000000
 mmc.0: user, fs : 0xc4500000, 0x0
Support fstype : 2nd  boot  env  factory  raw  fat  ext4  emmc  nand  ubi  ubifs 
Reserved part  : partmap  mem  setenv  cmd 
fdisk 0 5: 0x400000:0x2000000 0x2400000:0x2000000 0x4400000:0x40000000 0x84500000:0x40000000 0xc4500000:0x0
Writing to MMC(0)... done

- From Host PC

$ sudo fastboot flash partmap partmap_artik710_tizen_emmc.txt

Copy the below string and make it as partition.txt

partition = "rootfs";

Flash partition.txt through fastboot

$ sudo fastboot flash setenv partition.txt

- From Target

$ fast 0
downloading of 22 bytes finished
partition=rootfs
Writing to MMC(0)... done
Flash Tizen boot through fastboot

- From host PC
You can distinguish boot is Fedora or not at first line. Here is Fedora boot and has to be changed using fastboot util.
Once you type as 'fastboot 0' and wait to receive partmap and partion files from your host pc and see the log how it downloads.

U-Boot 2016.01 (Aug 02 2016 - 10:19:02 +0900)

DRAM:  896 MiB
HW Revision:    3
MMC:   NEXELL DWMMC: 0, NEXELL DWMMC: 1
In:    serial
Out:   serial
Err:   serial
Cannot read from device: 0000000075f47d20 register: 0x10 -121
Cannot read sensor type - -121
Net:   
Warning: ethernet@c0060000 (eth0) using random MAC address - 02:43:32:16:41:6d
eth0: ethernet@c0060000
Hit any key to stop autoboot:  0 
artik710# 
artik710# 
artik710# fast 0
Ready : Starting download of 508128 bytes
...
downloading of 508128 bytes finished
switch to partitions #0, OK
mmc0(part 0) is current device

MMC write: dev # 0, block # 3841, count 993 ... 993 blocks written: OK
Ready : Starting download of 16384 bytes

downloading of 16384 bytes finished
switch to partitions #0, OK
mmc0(part 0) is current device

MMC write: dev # 0, block # 5889, count 32 ... 32 blocks written: OK

- From Host PC
If you unzip ARTIK7 boot file from download, you can see the below files.

$ ls
fip-nonsecure.img
Image
modules.img
params.bin
s5p6818-artik710-raptor-rev01.dtb
s5p6818-artik710-raptor-rev03.dtb

Flash fip-nonsecure.img and params.bin to add up thordown utility into boot.
Flashing fip-nonsecure.img

$ sudo fastboot flash fip-nonsecure fip-nonsecure.img 
target reported max download size of 938475520 bytes
sending 'fip-nonsecure' (496 KB)...
OKAY [  0.039s]
writing 'fip-nonsecure'...
OKAY [  0.088s]
finished. total time: 0.127s

Flasing params.bin

$ sudo fastboot flash env params.bin
target reported max download size of 938475520 bytes
sending 'env' (16 KB)...
OKAY [  0.002s]
writing 'env'...
OKAY [  0.059s]
finished. total time: 0.061s
Flash pre-built Tizen boot and platform through thor

Reboot the target if you done to flash Tizen boot into ARTIK7 and this section describes how to flash pre-built boot and platform image through thor utility.
You have to check boot whether it is Fedora or Tizen. Tizen boot is available for using thor utility.
- From Target
If boot in your target is Tizen, you can see the log like the below and flash Tizen boot/platform images via thor utility.
Type as thordown 0 mmc 0.

'''U-Boot 2016.01-g9619d9fb6-TIZEN.org (Jan 16 2017 - 12:28:36 +0000)'''               
                                                                                 
Model: Samsung artik710 raptor board based on Nexell s5p6818

Board: ARTIK710 Raptor
DRAM:  991 MiB
HW Revision:    3
MMC:   NEXELL DWMMC: 0, NEXELL DWMMC: 1
In:    serial
Out:   serial
Err:   serial
Cannot read from device: 000000007953b3f0 register: 0x10 -121
Cannot read sensor type - -121
Net:   
Warning: ethernet@c0060000 (eth0) using random MAC address - b6:14:e2:c0:10:0e
eth0: ethernet@c0060000
Hit any key to stop autoboot:  0 
artik710# 

Type as thordown 0 mmc 0 to receive tar.gz file from your host pc.

artik710# thordown 0 mmc 0
TIZEN "THOR" Downloader
Download request from the Host PC
##File System is consistent
file found deleting
update journal finished
File System is consistent
update journal finished
13304096 bytes written in 995 ms (12.8 MiB/s)
##File System is consistent
file found deleting
update journal finished
File System is consistent
update journal finished
51154 bytes written in 77 ms (648.4 KiB/s)
#File System is consistent
file found deleting
update journal finished
File System is consistent
update journal finished
52740 bytes written in 83 ms (620.1 KiB/s)
#resetting ...
"

- From Host PC

$ lthor tizen-3.0-common_20170116.1_common-boot-arm64-artik710.tar.gz 

Linux Thor downloader, version 2.0 
Authors: Jaehoon You <jaehoon.you@samsung.com>
         Krzysztof Opasiak <k.opasiak@samsung.com>

tizen-3.0-common_20170116.1_common-boot-arm64-artik710.tar.gz :
[params.bin]	 16k
[Image]	 12992k
[modules.img]	 20480k
[s5p6818-artik710-raptor-rev03.dtb]	 49k
[s5p6818-artik710-raptor-rev01.dtb]	 51k
[fip-nonsecure.img]	 496k
-------------------------
	total :	33.29MB
Platform image
  • Using Fastboot

- From Target

$ fast 0

- From Host PC
Wait for a minute to flash rootfs all into ARTIK7.

$ sudo fastboot flash -S 0 rootfs rootfs.img
$ sudo fastboot flash system-data system-data.img
$ sudo fastboot flash user user.img
  • Using Thor

- From Target

artik710# thordown 0 mmc 0
TIZEN "THOR" Downloader
Download request from the Host PC
##############################resetting ...

- From Host PC

$ lthor tizen-common-artik_YYYYMMDD.X_common-wayland-3parts-armv7l-artik.tar.gz 

Linux Thor downloader, version 2.0 
Authors: Jaehoon You <jaehoon.you@samsung.com>
         Krzysztof Opasiak <k.opasiak@samsung.com>

tizen-common-artik_20170111.3_common-wayland-3parts-armv7l-artik.tar.gz :
[rootfs.img]	 748624k
[user.img]	 104048k
[system-data.img]	 65684k
-------------------------
	total :	896.83MB


Download files from tizen-common-artik_20170111.3_common-wayland-3parts-armv7l-artik.tar.gz

[rootfs.img]    | sending 748624k/748624k 100% block 732    [avg 10.73 MB/s]
[user.img]      - sending 104048k/104048k 100% block 102    [avg 11.08 MB/s]
[system-data.img\ sending  65684k/ 65684k 100% block 65     [avg 11.03 MB/s]

request target reboot : success 

After install steps

Patch

The patch is needed to get rid of several errors. After you apply the patch, the Desktop starts working.

Tizen 3 Desktop on Artik.jpg

You can download the patch from here: http://developer.samsung.com/tizendevice/firmware
Download the patch according to your Artik version. Unzip it.

  • Start SDB on Artik. Enter the following command in Artik's console:

direct_set_debug.sh --sdb-set

  • Connect to Artik from host PC using SDB:

sdb connect IP_ADDRESS (IP-ADDRESS you can get in Artik's console using ifconfig)

  • Launch the .sh script on your PC.

./common_plugin_tizen3.0_artik7.sh

There is a small error in the script: sdb is launched with -d command which is no longer in sdb's command list. You can simply remove all -d flags from the script text, and all works OK.

  • After installing the patch you will see Artik's desktop, if you plug in a monitor using the Mini-HDMI cable.

Troubleshooting

Thor

If you get some troubles related to thor, visit to below link.
https://wiki.tizen.org/wiki/Troubleshooting_lthor_on_Ubuntu

Booting from your eMMC

  • Change OM pin to the eMMC mode
    1. Turn off “OM pin number.1”
    2. Turn off “OM pin number.2”

Power on and enter to the u-boot shell (Target)

  • Hit any key to stop autoboot
U-Boot 2012.07-g801ab1503-TIZEN.org (Oct 04 2016 - 11:39:04) for ARTIK10

CPU: Exynos5422 Rev0.1 [Samsung SOC on SMP Platform Base on ARM CortexA7]
APLL = 800MHz, KPLL = 800MHz
MPLL = 532MHz, BPLL = 825MHz

Board: ARTIK10
DRAM:  2 GiB
WARNING: Caches not enabled

TrustZone Enabled BSP
BL1 version: ��/���⁁
VDD_KFC: 0x44
LDO19: 0x28

Checking Boot Mode ... EMMC
MMC:   S5P_MSHC0: 0, S5P_MSHC2: 1
MMC Device 0: 14.6 GiB
MMC Device 1: [ERROR] response timeout error : 00000104 cmd 1
Card did not respond to voltage select!
In:    serial
Out:   serial
Err:   serial
rst_stat : 0x100
Net:   No ethernet found.
Hit any key to stop autoboot:  0 
ARTIK10 # 

After the first startup, U-Boot environment is usually not set properly.
To fix this, run:

 ARTIK10 # env default -f
 ## Resetting to default environment 
 ARTIK10 # saveenv
 Writing to MMC(0)... done

Change “rootdev” environment variable to ‘0’ (Target)

ARTIK10 # env set rootdev 0
ARTIK10 # env save
Saving Environment to MMC
Writing to MMC(0)… done
ARTIK10 #

Reset the u-boot shell (Target)

ARTIK10 # reset

Checking Boot Mode ... EMMC
MMC:   S5P_MSHC0: 0, S5P_MSHC2: 1
MMC Device 0: 14.6 GiB
MMC Device 1: [ERROR] response timeout error : 00000104 cmd 1
Card did not respond to voltage select!
In:    serial
Out:   serial
Err:   serial
rst_stat : 0x100
Net:   No ethernet found.
Hit any key to stop autoboot:  0 
ARTIK10 # 

Finally you can see the message via terminal and log-in with id/pw(root/tizen)

Welcome to Tizen 3.0.0 (Tizen3/Common)!
...
[    8.588523] systemd-fsck[3171]: user: 16/8000 files (0.0% non-contiguous), 17117/24666 blocks
[    8.774864] systemd-fsck[3170]: system-data: 1361/8192 files (1.6% non-contiguous), 14235/22122 blocks
localhost login:

Not able to flash Tizen boot on ARTIK 7

If you have ARTIK 7 board which is under 1.0 version, Tizen boot is not able to flash on ARTIK 7.
In case of this problem, will not be occured from 1.0 revision board.
If you face the issue, you should recover ARTIK 7 board using Recovery section.

Weird pointers data on Artik 7

Bug in Artik 7 (Tizen 3.0) - pointer data debug print.png

After installing the system, you can see lots of pointers debug data in real time, like:

[ 36.284000] pgd = ffffffc01d917000
[ 36.284000] [00000000] *pgd=000000007c732003, *pud=000000007c732003, *pmd=000000005d915003, *pte=0000000000000000
[ 36.980000] pgd = ffffffc01d940000
[ 36.980000] [00000000] *pgd=000000007b541003, *pud=000000007b541003, *pmd=000000007b673003, *pte=0000000000000000
[ 37.744000] pgd = ffffffc03a85a000
[ 37.744000] [00000000] *pgd=000000007bcc9003, *pud=000000007bcc9003, *pmd=0000000067c9f003, *pte=0000000000000000

It is not an error, because the system and commands work well in the meantime, but it is very annoying. It will disappear, if you plug in a monitor via HDMI cable.