Booting Tizen 3.0 From microSD On ARTIK

From Tizen Wiki
Jump to: navigation, search

« back to Tizen_On_ARTIK

Introduction

This document describes how to create bootable microSD For ARTIK 5/7/10 with Tizen 3.0
Suppose you have LCD and Camera accessary for ARTIK.
ARTIK 7/10 are supported to LCD which is 4.99 inch(1080 X 1920 resolution, touch available) and ARTIK 5 is supported to 3.97 inch(480 X 800 resolution, touch not available)
Instead of LCD dispay, you can use HDMI monitor in case of ARTIK 7/10 .

Requirements

Hardware

  • Host PC : Ubuntu 14.04 or higher version as Host PC
  • microSD card : higher than 4GB

Downloading Pre-Built Tizen OS Image

You can download the beta release version for boot and platform image of ARTIK using the link below:
The version is tested and released.
Download each binary to use in your target according to each board

notice - If public final version is released, the link will be updated.

microSD setup

Download script

You can get script file and sd boot file from github.

$ git clone https://github.com/tizen-artik/sdboot

Enter the sdboot folder and check the file list.

$ ls
build.sh      prebuilt   tizen-sd-boot-artik10.tar.gz
mk_sdboot.sh  README.md  tizen-sd-boot-artik5.tar.gz

or If you are not able to clone the project through https, you can download the project through a web site directly.

Make script executable

$ chmod +x mk_sdboot.sh

Checking SD card to flash

Prepare a microSD card (Recommend higher than 4GB)
Insert the microSD into your host PC

Check your microSD device node from ‘lsblk’ command

  • From below example, your card node might be “sdb”
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0 461.9G  0 part /
├─sda2   8:2    0     1K  0 part 
└─sda5   8:5    0   3.9G  0 part [SWAP]
sdb      8:16   1   3.7G  0 disk 
└─sdb1   8:17   1   3.7G  0 part /media

Flashing Image

Format your microSD

  • Be careful, the command below must be run exactly as described. Just replace the /dev/sdX for your device!

There is options to work exact process, -m means mode, -d means sd card device name and -f/-b/-p are functional options.
-f is format, -b is boot and -p is platform.
Here is the sample for ARTIK10 and /dev/sdb

$ sudo ./mk_sdboot.sh -m artik10 -d /dev/sdb -f   # check your device name

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util sfdisk doesn't support GPT. Use GNU Parted.

========================================
Label          dev           size
========================================
boot		 /dev/sdb1  	 32 MB
modules		 /dev/sdb2  	 32 MB
rootfs		 /dev/sdb3  	 2048 MB
[Extend]	 /dev/sdb4
 system-data	 /dev/sdb5  	 1024 MB
 user		 /dev/sdb6  	 12137 MB
Remove partition table...
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.00490667 s, 104 kB/s
Checking that no-one is using this disk right now ...
OK

Disk /dev/sdb: 15279 cylinders, 64 heads, 32 sectors/track

sfdisk: ERROR: sector 0 does not have an msdos signature
 /dev/sdb: unrecognized partition table type
Old situation:
No partitions found
New situation:
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start   End    MiB    #blocks   Id  System
/dev/sdb1   *     4     35     32      32768    e  W95 FAT16 (LBA)
/dev/sdb2        36     67     32      32768   83  Linux
/dev/sdb3        68   2115   2048    2097152   83  Linux
/dev/sdb4      2116  15278  13163   13478912    5  Extended
/dev/sdb5      2116+  3139   1024-   1048575+  83  Linux
/dev/sdb6      3140+ 15276  12137-  12428287+  83  Linux
Successfully wrote the new partition table

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
mkfs.fat 3.0.26 (2014-03-07)
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
bl1.bin
bl2.bin
exynos5422-artik10.dtb
modules.img
params.bin
params_recovery.bin
params_sdboot.bin
tzsw.bin
u-boot.bin
uInitrd
zImage
~/source/tizen/new/sdboot/artik10 ~/source/tizen/new/sdboot
4191+0 records in
4191+0 records out
2145792 bytes (2.1 MB) copied, 0.0120199 s, 179 MB/s
30+0 records in
30+0 records out
15360 bytes (15 kB) copied, 0.000142444 s, 108 MB/s
28+0 records in
28+0 records out
14336 bytes (14 kB) copied, 0.000131128 s, 109 MB/s
653+1 records in
653+1 records out
334400 bytes (334 kB) copied, 0.00119409 s, 280 MB/s
512+0 records in
512+0 records out
262144 bytes (262 kB) copied, 0.000720739 s, 364 MB/s
32+0 records in
32+0 records out
16384 bytes (16 kB) copied, 0.000260223 s, 63.0 MB/s
~/source/tizen/new/sdboot
~/source/tizen/new/sdboot/artik10 ~/source/tizen/new/sdboot
32+0 records in
32+0 records out
33554432 bytes (34 MB) copied, 0.0239325 s, 1.4 GB/s
mkfs.fat 3.0.26 (2014-03-07)
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
~/source/tizen/new/sdboot
4190+0 records in
4190+0 records out
2145280 bytes (2.1 MB) copied, 0.447643 s, 4.8 MB/s
32+0 records in
32+0 records out
33554432 bytes (34 MB) copied, 4.89533 s, 6.9 MB/s
32+0 records in
32+0 records out
33554432 bytes (34 MB) copied, 2.80956 s, 11.9 MB/s

If format and making partitions are done, please check the partition with 'lsblk" command. 6 partitions are created in sdX node.

$ lsblk
 NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
 sda      8:0    0 465.8G  0 disk 
 ├─sda1   8:1    0 461.9G  0 part /
 ├─sda2   8:2    0     1K  0 part 
 └─sda5   8:5    0   3.9G  0 part [SWAP]
 sdb      8:16   1   3.7G  0 disk 
 ├─sdb1   8:17   1    32M  0 part 
 ├─sdb2   8:18   1    32M  0 part 
 ├─sdb3   8:19   1     2G  0 part 
 ├─sdb4   8:20   1     1K  0 part 
 ├─sdb5   8:21   1   256M  0 part 
 └─sdb6   8:22   1   1.4G  0 part 

Flasing boot image

Once you copy boot tar file in sdboot directory.
Here is sample for ARTIK10 and /dev/sdb

$ sudo ./mk_sdboot.sh -m artik10 -d /dev/sdb -b tizen-common-artik_YYYYMMDD.X_common-wayland-3parts-armv7l-artik.tar.gz  

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util sfdisk doesn't support GPT. Use GNU Parted.

bl1.bin
bl2.bin
exynos5422-artik10.dtb
modules.img
params.bin
params_recovery.bin
params_sdboot.bin
tzsw.bin
u-boot.bin
uInitrd
zImage
zImage
params.bin
u-boot.bin
modules.img
exynos5422-artik10.dtb
~/source/tizen/new/sdboot/artik10 ~/source/tizen/new/sdboot
4191+0 records in
4191+0 records out
2145792 bytes (2.1 MB) copied, 0.00573252 s, 374 MB/s
30+0 records in
30+0 records out
15360 bytes (15 kB) copied, 0.0001191 s, 129 MB/s
28+0 records in
28+0 records out
14336 bytes (14 kB) copied, 9.5522e-05 s, 150 MB/s
649+1 records in
649+1 records out
332784 bytes (333 kB) copied, 0.000636114 s, 523 MB/s
512+0 records in
512+0 records out
262144 bytes (262 kB) copied, 0.000590462 s, 444 MB/s
32+0 records in
32+0 records out
16384 bytes (16 kB) copied, 0.000106697 s, 154 MB/s
~/source/tizen/new/sdboot
~/source/tizen/new/sdboot/artik10 ~/source/tizen/new/sdboot
32+0 records in
32+0 records out
33554432 bytes (34 MB) copied, 0.0179835 s, 1.9 GB/s
mkfs.fat 3.0.26 (2014-03-07)
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
~/source/tizen/new/sdboot
4190+0 records in
4190+0 records out
2145280 bytes (2.1 MB) copied, 0.437871 s, 4.9 MB/s
32+0 records in
32+0 records out
33554432 bytes (34 MB) copied, 3.29585 s, 10.2 MB/s
20+0 records in
20+0 records out
20971520 bytes (21 MB) copied, 1.74902 s, 12.0 MB/s

Flasing platform image

Here is the sample for ARTIK10 and /dev/sdb

$ sudo ./mk_sdboot.sh -m artik10 -d /dev/sdb -p tizen-common-artik_YYYYMMDD.X_common-wayland-3parts-armv7l-artik.tar.gz
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util sfdisk doesn't support GPT. Use GNU Parted.

bl1.bin
bl2.bin
exynos5422-artik10.dtb
modules.img
params.bin
params_recovery.bin
params_sdboot.bin
tzsw.bin
u-boot.bin
uInitrd
zImage
params.bin
Image
modules.img
s5p6818-artik710-raptor-rev03.dtb
s5p6818-artik710-raptor-rev01.dtb
fip-nonsecure.img
~/source/tizen/new/sdboot/artik10 ~/source/tizen/new/sdboot
4191+0 records in
4191+0 records out
2145792 bytes (2.1 MB) copied, 0.00876674 s, 245 MB/s
30+0 records in
30+0 records out
15360 bytes (15 kB) copied, 0.00022927 s, 67.0 MB/s
28+0 records in
28+0 records out
14336 bytes (14 kB) copied, 0.000156016 s, 91.9 MB/s
653+1 records in
653+1 records out
334400 bytes (334 kB) copied, 0.00145575 s, 230 MB/s
512+0 records in
512+0 records out
262144 bytes (262 kB) copied, 0.000774986 s, 338 MB/s
32+0 records in
32+0 records out
16384 bytes (16 kB) copied, 0.00023068 s, 71.0 MB/s
~/source/tizen/new/sdboot
~/source/tizen/new/sdboot/artik10 ~/source/tizen/new/sdboot
32+0 records in
32+0 records out
33554432 bytes (34 MB) copied, 0.0306393 s, 1.1 GB/s
mkfs.fat 3.0.26 (2014-03-07)
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
~/source/tizen/new/sdboot
4190+0 records in
4190+0 records out
2145280 bytes (2.1 MB) copied, 0.429085 s, 5.0 MB/s
32+0 records in
32+0 records out
33554432 bytes (34 MB) copied, 5.1447 s, 6.5 MB/s
20+0 records in
20+0 records out
20971520 bytes (21 MB) copied, 1.6896 s, 12.4 MB/s
namsulee@namsu:~/source/tizen/new/sdboot$ sudo ./mk_sdboot.sh -m artik10 -d /dev/sdb -p tizen-3.0-common_201
tizen-3.0-common_20161230.2_common-wayland-3parts-armv7l-artik.tar.gz
tizen-3.0-common_20170113.2_common-boot-arm64-artik710.tar.gz
namsulee@namsu:~/source/tizen/new/sdboot$ sudo ./mk_sdboot.sh -m artik10 -d /dev/sdb -p tizen-3.0-common_20161230.2_common-wayland-3parts-armv7l-artik.tar.gz 

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util sfdisk doesn't support GPT. Use GNU Parted.

rootfs.img
user.img
system-data.img
731+1 records in
731+1 records out
766824448 bytes (767 MB) copied, 64.0434 s, 12.0 MB/s
64+1 records in
64+1 records out
67244032 bytes (67 MB) copied, 6.59815 s, 10.2 MB/s
101+1 records in
101+1 records out
106504192 bytes (107 MB) copied, 9.56801 s, 11.1 MB/s

Fit to the image the entire partition.

# sudo e2fsck -p /dev/sdb2
# sudo e2fsck -p /dev/sdb3
# sudo e2fsck -p /dev/sdb5
# sudo e2fsck -p /dev/sdb6

Now we can resize

# sudo resize2fs /dev/sdb2
# sudo resize2fs /dev/sdb3
# sudo resize2fs /dev/sdb5
# sudo resize2fs /dev/sdb6

Booting from your microSD

Insert the microSD into your ARTIK device

Change OM pin to the SD card mode

ARTIK 5 / 10

- Turn on “OM pin number.1”
- Turn off “OM pin number.2”

ARTIK5 Board

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

ARTIK 7

- Turn on “OM pin number.4, Don't need to move other OM pin"

ARTIK7 Board

Hit any key to stop autoboot

In case of ARTIK 10 and 5 are the below when you turn on the target. ARTIK 7 is different

TrustZone Enabled BSP
BL1 version: 20140203
Checking Boot Mode ... SDMMC   //Currently ARTIK was booted not eMMC but SD card

MMC:   S5P_MSHC2: 0, S5P_MSHC0: 1
MMC Device 0: 3.7 GiB
MMC Device 1: 3.6 GiB
MMC Device 2: MMC Device 2 not found
In:    serial
Out:   serial
Err:   serial
rst_stat : 0x10000
Net:   AX88796C_SPI
Hit any key to stop autoboot:  0

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

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

Change “rootdev” environment variable to ‘1’

- From Target

  • ARTIK5/10
 ARITK5 # env set rootdev 1
 ARITK5 # env save
 Saving Environment to MMC
 Writing to MMC(0)… done
 ARITK5 # reset
 
 TrustZone Enabled BSP
 BL1 version: 20140203
 Checking Boot Mode ... SDMMC  
 MMC:   S5P_MSHC2: 0, S5P_MSHC0: 1
 MMC Device 0: 3.7 GiB
 MMC Device 1: 3.6 GiB
 MMC Device 2: MMC Device 2 not found
 In:    serial
 Out:   serial
 Err:   serial
 rst_stat : 0x10000
 Net:   AX88796C_SPI
 Hit any key to stop autoboot:  0
  • ARTIK7
artik710# env set rootdev 1
artik710# saveenv
Saving Environment to MMC...
Writing to MMC(0)... done
artik710# reset
resetting ...

Finally you can see the message through 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:

NOTES

Set U-Boot parameters to boot Sdcard for ARTIK 5/10 :

env default -f 
set rootdev 1
set rootpart 3
set opts ${opts} init=/lib/systemd/systemd
set opts ${opts} rootwait rootdelay=3
boot 

ARTIK 7 :

set rootdev 1
set rootpart 3

If you visit to the link, you can see the movie clip to work with Tizen on ARTIK.