Booting Tizen From eMMC On ARTIK530

From Tizen Wiki
Jump to: navigation, search

Introduction

This document describes how to create boot-able eMMC For ARTIK530 with Tizen. Currently we are supposing that you connected LCD and Camera module to ARTIK530. You can connect HDMI monitor and USB mouse instead of touch LCD.

In this page, we describe how to run Tizen.

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 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 common image for ARTIK

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

Migrate to Tizen Platform from other platform

If your target didn't install Tizen platform, you have to migrate to Tizen platform at first step.

  • Choose the proper version to migrate

ARTIK530 : MIgration_ARTIK530_tizen.tar.gz

ARTIK530S : Migartion_ARTIK530S_tizen.tar.gz

  • Decompress a tar file on your PC, (For example, will be explained about ARTIK530)

$ tar xvf Migration_ARTIK530_20181026.tar.gz
./bl1-emmcboot.img
./bl_mon.img
./boot.img
./bootloader.img
./flash_boot_for_tizen.sh
./loader-emmc.img
./partmap_artik530_tizen_emmc.txt
./README.A530_os_3.0.0
./secureos.img
./tizen_params.bin

  • Flash the miaration iamges to target.

- Target side

  artik530#fastboot 0 

- Host side

  ./flash_boot_for_tizen.sh

If you want to get more information, read the README.XXX file.

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
  • Green : USB
  • Red : UART console

- Press the power button for 3 seconds
Artik7 new.jpg

Fuse images using through utility

Boot image

If you flash Tizen boot first time, you need to type as fast 0 and flash partmap_artik530_emmc.txt and partition.txt to set up proper partition for ARTIK530.
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-0530GC0F-44F-01E5 (Oct 07 2016 - 19:28:46 +0900)

Model: Samsung artik530 raptor board based on Nexell s5p4418

Board: ARTIK530 Raptor
DRAM:  512 MiB
HW Revision:    3
MMC:   NEXELL DWMMC: 0, NEXELL DWMMC: 1
In:    serial
Out:   serial
Err:   serial
LCD#1:0x4, LCD#2:0x4, CAM#1:0x4, CAM#2:0x4
ADD-ON-BOARD : 0xFFFF
Net:   
Warning: ethernet@c0060000 (eth0) using random MAC address - 16:29:bd:47:91:f4
eth0: ethernet@c0060000
Hit any key to stop autoboot:  0 
artik530# 

Flash partmap_artik530_tizen_emmc.txt and patition.txt Copy the below string and make it as partmap_artik530_tizen_emmc.txt file.
- partmap_artik530_tizen_emmc.txt
Updated tizen's partmap since 20180726.

flash=mmc,0:2ndboot:2nd:0x200,0x10000:bl1-emmcboot.img;
flash=mmc,0:loader:boot:0x10200,0x30000:loader-emmc.img;
flash=mmc,0:blmon:boot:0x40200,0x20000:bl_mon.img;
flash=mmc,0:secure:boot:0x60200,0x180000:secureos.img;
flash=mmc,0:bootloader:boot:0x1E0200,0x100000:bootloader.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,0x40000000:rootfs.img;
flash=mmc,0:system-data:ext4:0x44500000,0x40000000:system-data.img;
flash=mmc,0:user:ext4:0x84500000,0:user.img;

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

artik530# 
artik530# fast 0

Ready : artik530# fast 0

Ready : Starting download of 576 bytes

downloading of 576 bytes finished

Fastboot Partitions:
 mmc.0: 2ndboot, img : 0x200, 0x10000
 mmc.0: bootloader, img : 0x10200, 0x300000
 mmc.0: env, img : 0x310200, 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:0x80000000 0x84500000:0x40000000 0xc4500000:0x0
Writing to MMC(0)... done

- From Host PC

$ sudo fastboot flash partmap partmap_artik530_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-0530GC0F-44F-01E5 (Oct 07 2016 - 19:28:46 +0900)

Model: Samsung artik530 raptor board based on Nexell s5p4418

Board: ARTIK530 Raptor
DRAM:  512 MiB
HW Revision:    3
MMC:   NEXELL DWMMC: 0, NEXELL DWMMC: 1
In:    serial
Out:   serial
Err:   serial
LCD#1:0x4, LCD#2:0x4, CAM#1:0x4, CAM#2:0x4
ADD-ON-BOARD : 0xFFFF
Net:   
Warning: ethernet@c0060000 (eth0) using random MAC address - 16:29:bd:47:91:f4
eth0: ethernet@c0060000
Hit any key to stop autoboot:  0 
artik530# 
artik530# 
artik530# 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 ARTIK530 boot file from download, you can see the below files.

$ ls
modules.img
zImage
bootloader.img
s5p4418-artik530-raptor-rev00.dtb
params.bin
s5p4418-artik530-raptor-rev03.dtb

Flash bootloader.img and params.bin to add up thordown utility into boot.
Flashing bootloader.img

$ sudo fastboot flash bootloader bootloader.img
target reported max download size of 535822336 bytes
sending 'bootloader' (477 KB)...
OKAY [  0.041s]
writing 'bootloader'...
OKAY [  0.085s]
finished. total time: 0.126s

Flasing params.bin

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

Reboot the target if you done to flash Tizen boot into ARTIK530 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-g7b054df51-TIZEN.org (Jul 11 2017 - 18:06:43 +0000)'''               
                                                                                 
Model: Samsung artik530 raptor board based on Nexell s5p4418

Board: ARTIK530 Raptor
DRAM:  512 MiB
HW Revision:    3
MMC:   NEXELL DWMMC: 0, NEXELL DWMMC: 1
In:    serial
Out:   serial
Err:   serial
LCD#1:0x4, LCD#2:0x4, CAM#1:0x4, CAM#2:0x4
ADD-ON-BOARD : 0xFFFF
Net:   
Warning: ethernet@c0060000 (eth0) using random MAC address - 16:29:bd:47:91:f4
eth0: ethernet@c0060000
Hit any key to stop autoboot:  0 
artik530#  

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

artik530# 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
6009328 bytes written in 887 ms (6.5 MiB/s)
##File System is consistent
file found deleting
update journal finished
File System is consistent
update journal finished
49018 bytes written in 85 ms (562.5 KiB/s)
##File System is consistent
file found deleting
update journal finished
File System is consistent
update journal finished
49018 bytes written in 88 ms (543.9 KiB/s)
#resetting ...
"

- From Host PC

$ lthor tizen-unified_YYYYMMDD.X_common-boot-armv7l-artik530.tar.gz

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

tizen-unified_YYYYMMDD.X_common-boot-armv7l-artik530.tar.gz :
[modules.img]	 20480k
[zImage]	 5868k
[bootloader.img]	 477k
[s5p4418-artik530-raptor-rev00.dtb]	 47k
[params.bin]	 16k
[s5p4418-artik530-raptor-rev03.dtb]	 47k
-------------------------
	total :	26.30MB
Platform image
  • Using Fastboot

- From Target

$ fast 0

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

$ 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-unified_YYYYMMDD.X_common-wayland-3parts-armv7l-artik710.tar.gz

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

lthor tizen-unified_YYYYMMDD.X_common-wayland-3parts-armv7l-artik710.tar.gz :
[rootfs.img]	 893724k
[system-data.img]	 73128k
[user.img]	 105500k
-------------------------
	total :	1047.22MB


Download files from tizen-unified_YYYYMMDD.X_common-wayland-3parts-armv7l-artik710.tar.gz

[rootfs.img]    | sending 893724k/893724k 100% block 873    [avg 11.78 MB/s]
[system-data.img\ sending  73128k/ 73128k 100% block 72     [avg 12.66 MB/s]
[user.img]      - sending 105500k/105500k 100% block 104    [avg 12.47 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(Temporarily, use the patch for ARTIK7). 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”
    3. Turn off “OM pin number.3” (Turn off on Board rev 0.3)
    4. Turn off “OM pin number.4”

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

  • Hit any key to stop autoboot
U-Boot 2016.01-0530GC0F-44F-01E5 (Oct 07 2016 - 19:28:46 +0900)

Model: Samsung artik530 raptor board based on Nexell s5p4418

Board: ARTIK530 Raptor
DRAM:  512 MiB
HW Revision:    3
MMC:   NEXELL DWMMC: 0, NEXELL DWMMC: 1
In:    serial
Out:   serial
Err:   serial
LCD#1:0x4, LCD#2:0x4, CAM#1:0x4, CAM#2:0x4
ADD-ON-BOARD : 0xFFFF
Net:   
Warning: ethernet@c0060000 (eth0) using random MAC address - 16:29:bd:47:91:f4
eth0: ethernet@c0060000
Hit any key to stop autoboot:  0 
artik530# 

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

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

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

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

Reset the u-boot shell (Target)

ARTIK530 # reset
resetting ...

U-Boot 2016.01-0530GC0F-44F-01E5 (Oct 07 2016 - 19:28:46 +0900)

Model: Samsung artik530 raptor board based on Nexell s5p4418

Board: ARTIK530 Raptor
DRAM:  512 MiB
HW Revision:    3
MMC:   NEXELL DWMMC: 0, NEXELL DWMMC: 1
In:    serial
Out:   serial
Err:   serial
LCD#1:0x4, LCD#2:0x4, CAM#1:0x4, CAM#2:0x4
ADD-ON-BOARD : 0xFFFF
Net:   
Warning: ethernet@c0060000 (eth0) using random MAC address - 16:29:bd:47:91:f4
eth0: ethernet@c0060000
Hit any key to stop autoboot:  0 
artik530# 

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

Welcome to Tizen 4.0.0 (Tizen4/Unified)!
...
...
artik login:

Not able to flash Tizen boot on ARTIK device

If you face the issue, you should recover ARTIK530 board using Recovery section.