Flashing Tizen Images

There are 2 ways to flash Tizen binaries into your board:

Once you have flashed and set up your board, you can also optionally set up Wi-Fi.

Flashing with the IoT Setup Wizard

The IoT Setup Wizard is a Tizen Studio plugin that can be used to easily set up your IoT device for IoT application development. It offers a simple user interface, with which you can prepare an SD card with the latest image of the Tizen IoT operating system (or any older or customized Tizen image) with the click of a single button. When you insert the prepared SD card into the corresponding IoT device, the device boots up automatically.

Installing the IoT Setup Wizard

To use the IoT Setup Wizard, you must have the Tizen Studio installed.

To install the IoT Setup Wizard:

  1. Download the plugin.

    Currently, the IoT Setup Wizard binary is offered as a JAR file at http://download.tizen.org/misc/iot-preview/org.tizen.iotsetupwizard_0.4.1.preview.jar.

    Note This IoT Setup Wizard version is a test version for developers. The officially verified version is going to be released in the next release milestone.
  2. Add the plugin to the Tizen Studio:
    1. Open the Tizen Studio installation directory. On Linux, it is usually /home/<user>/tizen-studio, where <user> is your username on the computer.
    2. Check whether the ide/dropins/ directory exists in the above installation directory. If not, create it.
    3. Copy the downloaded JAR file into the ide/dropins/ directory.
    Note When updating an existing version of the IoT Setup Wizard, remove the older version and replace it with the newer version. In addition, to avoid issues with the Eclipse plugin cache, remove the .metadata/ hidden directory from your Tizen Studio workspace directory and the ide/iotswiz/ directory in the Tizen Studio installation directory.
  3. Start the Tizen Studio. If the Tizen Studio is already running, close and restart it.
  4. Access the IoT Setup Wizard in the Tizen Studio menu by going to Windows > Show View > Other.

    IoT Setup Wizard menu path

  5. In the Show View window, select IoT > IoT Setup Wizard.

    Show View window

IoT Setup Wizard User Interface

The following figure illustrates the IoT Setup Wizard user interface.

Figure: IoT Setup Wizard

IoT Setup Wizard

The main UI components are:

  • Select Device

    In the drop-down menu, you can select the IoT device for which you want to prepare the SD card. The IoT Setup Wizard uses this information to select the appropriate version of the Tizen IoT operating system and to properly partition the SD card (in the case of a fresh install). The options are:

    • Samsung Artik 530 (Headless)
    • Samsung Artik 530 (Headed)
    • Raspberry Pi 3 (Headless)

    Selecting a headless option installs a version of the operating system which does not support an external display. With a headed version, you can connect a screen to the device using, for example, HDMI.

  • Select Flash Type

    In the drop-down menu, you can select how you want to prepare the SD card. The options are:

    • Fresh Install

      This option prepares your SD card from scratch. It formats and partitions the SD card, and installs both the bootloader image and the Tizen platform Image. This option is to be used when you have a new SD card and want to install Tizen IoT on it.

    • Flash Kernel and Bootloader

      This option can used only when the SD card is already partitioned and contains an existing Tizen IoT installation. This option only updates the partitions containing the kernel and bootloader.

    • Flash Platform Image

      This option can used only when the SD card is already partitioned and contains an existing Tizen IoT installation. This option only updates the partitions containing the Tizen platform files.

  • Select SD Card Location

    In the drop-down menu, you can select the location of your SD card. Any removable drives present in your system are automatically detected by the IoT Setup Wizard and displayed. SD cards are also dynamically detected and updated as you insert and remove them.

    Note If an SD card is not displayed even after inserting it into the system, close the IoT Setup Wizard and open it again.
  • Flash custom images from local storage

    If this check box is selected, the IoT Setup Wizard flashes user-provided image files from local storage instead of the default images provided with the tool. When the check box is selected, the text fields below it are enabled, allowing you to enter the file paths for your custom platform and kernel images.

    Note Make sure to select an image that corresponds to the device type. When selecting custom images, if the flash type is set to Fresh Install, you must to enter both the platform and kernel image paths. Otherwise you only need to enter the value corresponding to the flash type selected, a kernel image for the Flash Kernel and Bootloader option and a platform image for the Flash Platform Image option.

    Flash custom images checkbox

  • Flash

    Click this button to flash the SD card. The button is inactive if complete information for flashing is not provided, for example:

    • An SD card is not inserted.
    • The Flash custom images from local storage checkbox is selected along with the Fresh Install flash type, and at least 1 of the image paths is empty.
    • The Flash custom images from local storage checkbox is selected along with the Flash Kernel and Bootloader flash type, and the kernel image path is empty.
    • The Flash custom images from local storage checkbox is selected along with the Flash Platform Image flash type, and the platform image path is empty.
  • Progress and status bars

    The progress bar displays the current progress of the flashing operation. The status bar displays information about the current operation.

Flashing an SD Card with the Wizard

To flash your SD card with the IoT Setup Wizard:

  1. Insert your SD card into the computer.
  2. In Tizen IoT Setup Wizard, select the device, flash type (the Fresh Install type is selected by default), and the SD card location.
  3. If you want to use your own image files instead of the default images, check the Flash custom images from local storage check box and enter the file paths to the custom image files.
  4. Click Flash.
  5. Enter the password for your user account when prompted (sudo permissions are required to format and partition SD cards).

The IoT Setup Wizard takes about a minute to prepare your SD card, and once finished, displays the "Done" message in the status bar.

Figure: Flashing an SD card

Flashing an SD cardSD card flashing complete

Setting up the Board and Driver

Once you have flashed your SD card, you can set up the development board.

ARTIK 530

To set up an ARTIK 530 Smart IoT Module:

  1. Connect the board and boot it up:

    1. Insert the micro SD card into the card slot (marked with a blue arrow) and connect the 5V DC power supply to the board (the red arrow). The following figure shows the underneath of the board.

      ARTIK 530 power and micro SD slots

    2. Connect a USB serial cable (marked with a yellow box) and a separate USB OTG cable (the red box) to your Linux computer. The following figure shows the underneath of the board on the left and the upside on the right.

      ARTIK 530 USB serial and OTG connectors

    3. To be able to boot from the SD card, set the DIP switch on the board as shown in the following figure (showing the upside of the board).

      ARTIK 530 DIP switch

    4. Boot the board by switching on the power switch (marked with a red box) on and pressing the power button (the yellow box). The following figure shows the upside of the board.
      Note Make sure that the OM pins are set in the proper configuration to enable booting from the SD card.

      ARTIK 530 power switch

    5. Launch 2 shells in your Linux computer: 1 for serial communication ("serial shell") and 1 for installing the drivers ("Linux shell"). For serial communication to the board, run a serial communication application, such as minicom or putty. For example, to run minicom:
      $ sudo minicom -c on
      
      Note In the "serial shell", you can log in with root/tizen:

      localhost login: root
      Password: tizen
      Welcome to Tizen
      
  2. Install connectivity drivers:
    1. Download the plugin zip file from the ARTIK530(4.0) Plugin section at http://developer.samsung.com/tizendevice/firmware and follow the provided instructions.

      ARTIK530(4.0) Plugin section

    2. Run the script command given in the instructions in the "Linux shell":
      $ ./ARTIK_plugin_tizen4.0.sh
      

Raspberry Pi 3

To set up a Raspberry Pi 3 board:

  1. Install the firmware for Wi-Fi and Bluetooth:

    1. Insert an SD card into your computer and check its device node (for example, sdX where X is a letter).

      Note To check the device node:

      1. Before inserting the SD card into the Linux computer, give the following command:

        $ ls -al /dev/sd*
        

        For example:

        $ ls -al /dev/sd*
        brw-rw---- 1 root disk 8, 0  9 18 09:08 /dev/sda
        brw-rw---- 1 root disk 8, 1  9 18 09:08 /dev/sda1
        brw-rw---- 1 root disk 8, 2  9 18 09:08 /dev/sda2
        brw-rw---- 1 root disk 8, 5  9 18 09:08 /dev/sda5
        
      2. Insert the SD card, and enter the same command again:
        $ ls -al /dev/sd*
        

        For example:

        $ ls -al /dev/sd*
        brw-rw---- 1 root disk 8,  0  9 18 09:08 /dev/sda
        brw-rw---- 1 root disk 8,  1  9 18 09:08 /dev/sda1
        brw-rw---- 1 root disk 8,  2  9 18 09:08 /dev/sda2
        brw-rw---- 1 root disk 8,  5  9 18 09:08 /dev/sda5
        brw-rw---- 1 root disk 8, 16  9 22 14:59 /dev/sdb
        brw-rw---- 1 root disk 8, 17  9 22 14:59 /dev/sdb1
        brw-rw---- 1 root disk 8, 18  9 22 14:59 /dev/sdb2
        brw-rw---- 1 root disk 8, 19  9 22 14:59 /dev/sdb3
        brw-rw---- 1 root disk 8, 20  9 22 14:59 /dev/sdb4
        brw-rw---- 1 root disk 8, 21  9 22 14:59 /dev/sdb5
        brw-rw---- 1 root disk 8, 22  9 22 14:59 /dev/sdb6
        brw-rw---- 1 root disk 8, 23  9 22 14:59 /dev/sdb7
        

        The new sdX node is the device node for the SD card.

        In this example, the device node for the SD card is sdb.

    2. Download the plugin zip file from the Raspberry Pi 3(4.0) Plugin section in http://developer.samsung.com/tizendevice/firmware and follow the provided instructions.

      Raspberry Pi 3(4.0) Plugin section

    3. Run the script command given in the instructions in the "Linux shell". For example:
      $ ./RPI3_plugin_tizen4.0.sh /dev/sdb
      
  2. Set up the Raspberry Pi 3 board:
    1. Insert the SD card to the Raspberry Pi.
    2. For the serial communication connection:
      1. Connect the host computer to the Pi with a UART-to-USB dongle, such as PL2303 or FT232 USB UART Board.

        For the PL2303, connect the Raspberry Pi TXD0 pin (pin 8) to RXD on the UART board, RXD0 (pin 10) to TXD on the UART board, and the ground (pin 6) to GND on the UART board, and set the jumper switch to 3.3V.

        Raspberry Pi GPIO pins

      2. Execute a terminal program, such as Minicom.
      3. Connect power to the Pi.
      4. Log in with root/tizen:
        localhost login: root
        Password: tizen
        Welcome to Tizen
        root@localhost:~#
        
    3. For the SDB connection:
      1. Connect the host computer to the Pi through an Ethernet cable.

        Note If no Ethernet ports are available in the host computer or the Pi, you can also use an Ethernet-to-USB dongle.
      2. Set a new network interface in the host computer as in the following figure.

        DB connection to RPi3

      3. Set an IP address for the SDB connection in the serial shell of the Pi with the ifconfig command:
        root@localhost:~# ifconfig eth0 192.168.1.11
        
      4. Connect SDB in the Linux shell of the host computer:
        $ sdb connect 192.168.1.11
        $ sdb root on
        $ sdb shell
        

        For example:

        ~$ sdb connect 192.168.1.11
        * server not running. starting it now on port 26099 *
        * server started successfully *
        connecting to 192.168.1.11:26101 ...
        connected to 192.168.1.11:26101
        ~$ sdb root on
        ~$ sdb shell
        sh-3.2#
        

Flashing with the Command Line

You can also flash the SD card through the command line.

ARTIK 530

To flash eMMC (without SD card) for ARTIK 530:

  1. Fill the following prerequisites:

  2. Set up the board connections:
    1. Connect the 5V DC power supply to the board (marked with a red arrow). The following figure shows the underneath of the board.

      ARTIK 530 power

    2. To be able to boot from the eMMC card, set the DIP switch on the board as shown in the following figure (showing the upside of the board).

      ARTIK 530 DIP switch

    3. Connect a USB serial cable form your Linux computer to the debug USB port (marked with a yellow box in the following figure) and a separate USB OTG cable to the USB OTG port (marked with the red box). The following figure shows the underneath of the board on the left and the upside on the right.

      ARTIK 530 USB serial and OTG connectors

    4. Switch on the power switch (marked with a red box in the following figure) and press the power button (the yellow box). The following figure shows the upside of the board.

      ARTIK 530 power switch

    5. Launch 2 shells in your Linux computer: 1 for serial communication ("serial shell") and 1 for flashing the binaries ("Linux shell"). For serial communication to the board, run a serial communication application, such as minicom or putty. For example, to run minicom:
      $ sudo minicom -c on
      
  3. After the board has been reset, the "serial shell" shows a number counting down next to the Hit any key to stop autoboot line. Before the count reaches 0, press Enter in the "serial shell" to stop the boot process and enter the bootloader mode.
    Board: ARTIK530 Raptor
    DRAM:  512 MiB
    HW Revision:    4
    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 - xx:xx:xx:xx:xx
    eth0: ethernet@c0060000
    Hit any key to stop autoboot:  0 <Enter key>
    artik530#
    
  4. Flash the boot image:
    1. Download the following tar.gz file: flash_boot_v1.tar.gz
    2. Unzip the flash_boot_v1.tar.gz file to find the flash_boot.sh file and the bootimage directory.
    3. In the "serial shell", enter fastboot 0:
      artik530# fastboot 0
      
    4. In the "Linux shell", run flash_boot.sh:
      $ ./flash_boot.sh
      
    5. Reboot the board and enter the bootloader mode again.
    6. In the "serial shell", enter thordown 0 mmc 0:
      artik530# thordown 0 mmc 0
      
    7. In the "Linux shell", run lthor to flash the boot image (which you downloaded in step 1):
      $ lthor tizen-4.0-unified_YYYYMMDD.V_iot-boot-armv7l-artik530.tar.gz
      
  5. Flash the platform image:
    1. Reboot the board and enter the bootloader mode again.
    2. In the "serial shell", enter thordown 0 mmc 0:
      artik530# thordown 0 mmc 0
      
    3. In the "Linux shell", run lthor to flash the platform image (which you downloaded in step 1):
      $ lthor tizen-4.0-unified_YYYYMMDD.V_iot-headless-2parts-armv7l-artik530.tar.gz
      
  6. Open the SDB connection in the "serial shell":
    1. Reboot the board and login with root/tizen:

      localhost login: root
      Password: tizen
      Welcome to Tizen
      
    2. Enter the following command:
      root@localhost:~# sdb-mode.sh --on
      
    Note Repeat this step whenever you power-cycle the device, in order to reconnect the sdb tool. If you flash the binaries using the command line, SDB connection is not automatically set.
  7. Install connectivity drivers:
    1. Download the plugin zip file from the ARTIK530(4.0) Plugin section in http://developer.samsung.com/tizendevice/firmware and follow the provided instructions.

      ARTIK530(4.0) Plugin section

    2. Run the script command given in the instructions in the "Linux shell":
      $ ./ARTIK_plugin_tizen4.0.sh
      

For more detailed information, see https://wiki.tizen.org/Booting_Tizen_From_eMMC_On_ARTIK530.

Raspberry Pi 3

To flash the SD card for Raspberry Pi 3:

  1. Fill the following prerequisites:

    1. Install the pv package in the Linux computer:

      $ sudo apt-get install pv
      
    2. Make sure you have an SD card of 4 GB or more.
    3. Download the following images, script, and firmware:
  2. Flash the SD card to make it "Tizen ready":
    1. Insert an SD card to the Linux computer and check its device node.

      Note To check the device node:

      1. Before inserting the SD card into the Linux computer, type the following command:

        $ ls -al /dev/sd*
        

        For example:

        $ ls -al /dev/sd*
        brw-rw---- 1 root disk 8, 0  9 18 09:08 /dev/sda
        brw-rw---- 1 root disk 8, 1  9 18 09:08 /dev/sda1
        brw-rw---- 1 root disk 8, 2  9 18 09:08 /dev/sda2
        brw-rw---- 1 root disk 8, 5  9 18 09:08 /dev/sda5
        
      2. Insert the SD card, and type the same command again:
        $ ls -al /dev/sd*
        

        For example:

        $ ls -al /dev/sd*
        brw-rw---- 1 root disk 8,  0  9 18 09:08 /dev/sda
        brw-rw---- 1 root disk 8,  1  9 18 09:08 /dev/sda1
        brw-rw---- 1 root disk 8,  2  9 18 09:08 /dev/sda2
        brw-rw---- 1 root disk 8,  5  9 18 09:08 /dev/sda5
        brw-rw---- 1 root disk 8, 16  9 22 14:59 /dev/sdb
        brw-rw---- 1 root disk 8, 17  9 22 14:59 /dev/sdb1
        brw-rw---- 1 root disk 8, 18  9 22 14:59 /dev/sdb2
        brw-rw---- 1 root disk 8, 19  9 22 14:59 /dev/sdb3
        brw-rw---- 1 root disk 8, 20  9 22 14:59 /dev/sdb4
        brw-rw---- 1 root disk 8, 21  9 22 14:59 /dev/sdb5
        brw-rw---- 1 root disk 8, 22  9 22 14:59 /dev/sdb6
        brw-rw---- 1 root disk 8, 23  9 22 14:59 /dev/sdb7
        

        The new sdX node (where X is a letter) is the device node for the SD card.

        In this example, the device node for the SD card is sdb.

    2. Download and unzip the flash-sdcard-rpi3.tar.gz script file. This script and all other downloaded files must be in the same directory.
    3. Run the flash-sdcard.sh script with the device node and binary version:
      $ sudo ./flash-sdcard.sh <SD card device node>
      

      For example:

      $ sudo ./flash-sdcard.sh /dev/sdb
      
    4. Download the plugin zip file from the Raspberry Pi 3(4.0) Plugin section in http://developer.samsung.com/tizendevice/firmware and follow the provided instructions.

      Raspberry Pi 3(4.0) Plugin section

    5. Run the script command given in the instructions in the "Linux shell". For example:
      $ ./RPI3_plugin_tizen4.0.sh /dev/sdb
      
  3. Set up the Raspberry Pi 3 board:
    1. Insert the SD card to the Raspberry Pi.
    2. For the serial communication connection:
      1. Connect the host computer to the Pi with a UART-to-USB dongle, such as PL2303 or FT232 USB UART Board.

        For the PL2303, connect the Raspberry Pi TXD0 pin (pin 8) to RXD on the UART board, RXD0 (pin 10) to TXD on the UART board, and the ground (pin 6) to GND on the UART board, and set the jumper switch to 3.3V.

        Raspberry Pi GPIO pins

      2. Execute a terminal program, such as Minicom.
      3. Connect power to the Pi.
      4. Log in with root/tizen:
        ...
        
        localhost login: root
        Password: tizen
        Welcome to Tizen
        root@localhost:~#
        
    3. For the SDB connection:
      1. Connect the host computer to the Pi through an Ethernet cable.

        Note If no Ethernet ports are available in the host computer or the Pi, you can also use an Ethernet-to-USB dongle.
      2. Set a new network interface in the host computer as inthe following figure.

        DB connection to RPi3

      3. Set an IP address for the SDB connection in the serial shell of the Pi with the ifconfig command:
        root@localhost:~# ifconfig eth0 192.168.1.11
        
      4. Connect SDB in the Linux shell of the host computer:
        $ sdb connect 192.168.1.11
        $ sdb root on
        $ sdb shell
        

        For example:

        ~$ sdb connect 192.168.1.11
        * server not running. starting it now on port 26099 *
        * server started successfully *
        connecting to 192.168.1.11:26101 ...
        connected to 192.168.1.11:26101
        ~$ sdb root on
        ~$ sdb shell
        sh-3.2#
        

Setting up Wi-Fi

Note If you want to connect your device to the SmartThings Cloud, skip this section. For SmartThings devices, the device enables SoftAP mode during setup, so there is no need to switch on Wi-Fi separately.

You can set up a WiFi connection by running wifi_manager_test and entering the options 1 > 3 > 9 > b > c. If you set up the connection once, it reconnects automatically the next time you power-cycle the device.

# wifi_manager_test
Test Thread created...<Enter>
Event received from stdin
Network Connection API Test App
Options..
1   - Wi-Fi init and set callbacks
2   - Wi-Fi deinit(unset callbacks automatically)
3   - Activate Wi-Fi device
4   - Deactivate Wi-Fi device
5   - Is Wi-Fi activated?
6   - Get connection state
7   - Get MAC address
8   - Get Wi-Fi interface name
9   - Scan request
a   - Get Connected AP
b   - Get AP list
c   - Connect
d   - Disconnect
e   - Connect by wps pbc
f   - Forget an AP
g   - Set & connect EAP
h   - Set IP method type
i   - Set Proxy method type
j   - Get Ap info
k   - Connect Specific AP
l   - Load configuration
m   - Save configuration
n   - Remove configuration
o   - TDLS Discover
p   - TDLS Connect
q   - TDLS Connected peer
r   - TDLS Disconnect
s   - Connect Hidden AP
t   - Connect WPS PBC without SSID
u   - Connect WPS PIN without SSID
v   - Cancel WPS Request
w   - Set Auto Scan Enable-Disable
x   - Set Auto Scan Mode
y   - Get wifi scanning state
z   - Get Auto Scan Enable-Disable
A   - Get Auto Scan Mode
B   - Enable TDLS Channel Switch Request
C   - Disable TDLS Channel Switch Request
D   - Get Wi-Fi Module State
E   - BSSID Scan
F   - Add VSIE
G   - Get VSIE
H   - Remove VSIE
I   - Start Multi Scan
J   - Flush BSS
K   - Set auto connect mode
L   - Get auto connect mode
0   - Exit
ENTER  - Show options menu.......
Operation succeeded!
1
Event received from stdin
Wifi init succeeded
Operation succeeded!
3
Event received from stdin
Wi-Fi Activation Succeeded
Operation succeeded!
9
Event received from stdin
Interface name : wlan0
Operation succeeded!
b
Event received from stdin
AP name : crash_messaging, state : Disconnected
AP name : dnet1, state : Disconnected
... < list of APs > ...
Get AP list finished
Operation succeeded!
Background Scan Completed, error code : NONE
c
Event received from stdin
Input a part of AP name to connect : <AP name>
Passphrase required : TRUE
Input passphrase for dnet1 : <Password>