skip menu and go to main content

body start

U-boot for ODROID

Project News

Project Info

activity viewforum,download view

1 Preface

This page will explain how to compile u-boot for original Odroid.

Please note, Odroid-S and Odroid-T users must follow this link.


2 Build environment

Tested with Ubuntu 8.10/9.04/9.10 (Other Linux packages might be able to build u-boot)

3 Download and Install tool-chain for u-boot

3.1 Download the cross tool package

3.2 Copy the cross tool package to /usr/local/arm

If the '/usr/local/arm' directory does not exist in host pc, then create the directory.
# sudo mkdir /usr/local/arm
# sudo cp cross-4.2.2-eabi.tar.bz2 /usr/local/arm

3.3 Uncompress the cross tool with tar command

# cd /usr/local/arm
# sudo tar xvjf cross-4.2.2-eabi.tar.bz2

3.4 Add Path in your environment file

Modify your ~/.bashrc file to add a new path with editor (gedit or vi)

PATH=$PATH:/usr/local/arm/4.2.2-eabi/usr/bin

To apply this change, login again or restart the .bashrc
# source .bashrc

3.5 Check the tool-chain path to see if it is set up correctly or not.

# arm-linux-gcc -v
Using built-in specs.
Target: arm-unknown-linux-gnueabi
Configured with: /home/scsuh/workplace/coffee/buildroot-20071011/toolchain_build_arm/gcc-4.2.2/configure --prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=arm-unknown-linux-gnueabi --enable-languages=c,c++ --with-sysroot=/usr/local/arm/4.2.2-eabi/ --with-build-time-tools=/usr/local/arm/4.2.2-eabi//usr/arm-unknown-linux-gnueabi/bin --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --enable-shared --with-gmp=/usr/local/arm/4.2.2-eabi//gmp --with-mpfr=/usr/local/arm/4.2.2-eabi//mpfr --disable-nls --enable-threads --disable-multilib --disable-largefile --with-arch=armv4t --with-float=soft --enable-cxx-flags=-msoft-float
Thread model: posix
gcc version 4.2.2

4 Download source code

# sudo apt-get install git-core
# git clone http://dev.odroid.com/gitroot/uboot.git

5 Compile

# cd uboot
# make mrproper    ---> This is only used to clean up files from the source code
# make hkdkc100_config
# make

If there is no error, u-boot.bin should have been generated with a file size of about 130~150Kbyte.

6 Debug board setup

debug_board.jpg.jpg


* TTA20-Male connector
  • Connect to I/O port of Odroid.
* RS232C Serial Port
  • Connect to Host PC RS232C Serial Port via cable. The cable should be 1:1 direct cable. Don't use the cross type.
  • If your host PC has no RS232C port, you need a USB-Serial converter.
* Power on button
  • Turn on power of Odroid. You can't turn off.
* RS232C Level shifter
  • This IC(SIPEX3232) converts CPU I/O volt(3.3V) to +/-10Volt RS232C standard.
* DC Connector (Please be careful !!!)
  • External power supply connection (Input voltage should be 4.0 ~ 4.2-volt.)
  • If you want to use this power without a battery, you need to move a resister from R2 to R1.
  • When connected to external power, do NOT install the battery. If you install the battery with this modification(R1, R2), the battery could severely damage the Odroid or you.
  • This modification(R1, R2) disables the USB charging feature of the debug board.
  • To use USB charging feature, you need to change the R1/R2 back to it's original location.

* TTA20-Female connector
  • If you want to use Odroid all day long, you will need a external power supply or external charger.
  • There are 2 different types of standard connectors we use for mobile phones, the TTA20 and TTA24.
  • Odroid utilizes the TTA20 which is the latest standard, and almost all mobile phones in 2009 have it.
  • If you have a standard TTA24, you can use a simple converter for TTA24 to TTA20
  • You can check the charging status with the LED of the charger. There is no charging indicator on Odroid.
* Mini-B USB connector
  • You can use this connector to connect Odroid to a host PC while charging with TTA20 connector.

6.1 Debug board connection example 1 (Without external TTA charger)

debug_board_example1.jpg

6.2 Debug board connection example 2 (With external TTA charger)

debug_board_example2.jpg



7 Transfer boot-loader to target board(Odroid)

If u-boot is already installed and working well in T-flash, you can download the new compiled u-boot via USB. If u-boot is not working or damaged, you will need to write the u-boot bin with a special tool on a Windows PC. This process can be used for fusing u-boot as well as the kernel.

7.1 For Windows(XP) PC Users

  • Use Windows utility DNW.exe and USB driver. You can get the files from this link and uncompress it.
  • 1) Connect Debug board and PC serial port with Serial Cable(1:1)

    2) Run serial communication software in PC (HyperTerminal/SecureCRT/etc)

    3) Configure serial port options (COM port, Baudrate : 115200, DATA : 8, STOP : 1, No-Parity, No Flow Control)

    4) Turn on Odroid and you can see the below booting message. Be sure to press any key quickly to stop the OS booting process.
    OK
    
    U-Boot 1.3.4-svn (Oct 24 2009 - 22:16:25) for HKDKC100
    
    CPU:     S5PC100@834MHz
             Fclk = 1668MHz, Hclk = 166MHz, Pclk = 66MHz, Serial = PCLK
    Board:   HKDKC100
    I2C:   ready
    DRAM:    512 MB
    SD/MMC:  1937 MB
    In:      serial
    Out:     serial
    Err:     serial
    Hit any key to stop autoboot:  0
    HKDKC100 #
     


    5) With "dnw" command, you can download any binary file to Odroid RAM from PC via USB.
    HKDKC100 # dnw 0x20008000
    Insert a OTG cable into the connector! 
     


    6) If you plug in the USB Cable, you are ready to send binary files to Odroid.
    HKDKC100 # dnw 0x20008000
    Insert a OTG cable into the connector!
    OTG cable Connected! 
    Now, Waiting for DNW to transmit data
     


    7) It's time to execute DNW utility. But, you should install the USB driver first. Driver installation is only required for the first time of USB connection. Driver file location should NOT be automatic selection.
    dnw-1.jpg


    8) Select the driver file and complete installation.

    dnw-2.jpg


    9) Execute the DNW utility software and set the download address as below. Ignore serial port settings, if you are familiar with other serial console software. Please also check for USB:OK to make sure the connection is good.

    dnw-4.jpg


    10) You can start the download with the menu for USB Port -> Download to select file to send.

    11) After downloading, the Serial terminal will show the below message.

    Download Done!! Download Address: 0x20008000, Download Filesize: 0xxxxxxx
    Checksum is being calculated..
    Checksum O.K.
    HKDKC100 #
     


    12) It's time to write the binary image to T-flash with the "movi write"command.
    HKDKC100 # movi write u-boot 0x20008000
    Writing u-boot to sector xxxx (16 sectors).. completed
    Writing u-boot to sector xxxx (1024 sectors).. completed
    HKDKC100 #
     


  • This is another way to transfer u-boot.bin or zImage(kernel) to T-flash(Micro-SD).
    You can write the raw image files directly from XP PC to T-flash with this special utility. Download moviNAND_Fusing_Tool from this link. Unfortunately a Linux version is not available. This utility is very useful when the Odroid boot-loader is damaged or when you have a new T-flash card.

  • 1) Remove T-flash card from Odroid and plug it into a Card Reader. If you don't have a card reader, buy one :(

    This picture is just an example.
    Micro-SD-T-Flash-Card-Reader.jpg


    2) Connect the card reader to PC.

    3) Check which drive is assigned for the card reader.

    4) Run moviNAND_Fusing_Tool.exe

    5) Select the drive of the card reader then Browse for the Blootloader Image file and choose "u-boot.bin"

    reader-1.jpg


    6) Click "START" button and the writing process will be done shortly.

    reader-2.jpg


    Note) Do not change any of the other parameters. Doing so will cause a malfunction.


7.2 For Linux (Ubuntu) PC Users

  • Use Linux utility smdk-usbdl. You can get the files from this link and uncompress it.
  • Copy the executable file smdk-usbdl to /usr/local/arm/4.2.2-eabi/usr/bin
  • To execute smdk-usbdl, you need to install libusb. Original port was done by Ben Dooks.
    # sudo cp smdk-usbdl /usr/local/arm/4.2.2-eabi/usr/bin
    # sudo apt-get install libusb-dev
     


    1) Connect the Debug board and PC serial port with Serial Cable(1:1)

    2) Run serial communication software in PC (minicom or others)

    3) Set serial options (COM port, Baudrate : 115200, DATA : 8, STOP : 1, No-Parity, No Flow Control)

    4) Turn on Odroid and you can see below booting message. You need to quickly press any key to stop the OS booting process.
    OK
    
    U-Boot 1.3.4-svn (Oct 24 2009 - 22:16:25) for HKDKC100
    
    CPU:     S5PC100@834MHz
             Fclk = 1668MHz, Hclk = 166MHz, Pclk = 66MHz, Serial = PCLK
    Board:   HKDKC100
    I2C:   ready
    DRAM:    512 MB
    SD/MMC:  1937 MB
    In:      serial
    Out:     serial
    Err:     serial
    Hit any key to stop autoboot:  0
    HKDKC100 #
     


    5) With "dnw" command, you can download any binary file to Odroid RAM from PC via USB.
    HKDKC100 # dnw 0x20008000
    Insert a OTG cable into the connector! 
     


    6) If you plug in the USB Cable, you are ready to send binary file to Odroid.
    HKDKC100 # dnw 0x20008000
    Insert a OTG cable into the connector!
    OTG cable Connected! 
    Now, Waiting for DNW to transmit data
     


    7) You can check whether USB connection is correct or not with lsusb command.
    # lsusb
    Bus 008 Device 002: ID 1871:0306 Aveo Technology Corp. 
    Bus 008 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 004 Device 006: ID 04e8:1234 Samsung Electronics Co., Ltd   ---> odroid is here. Samsung??
    Bus 004 Device 005: ID 05af:0802 Jing-Mold Enterprise Co., Ltd 
    Bus 004 Device 004: ID 0cf2:6230 ENE Technology, Inc. 
    Bus 004 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
    #
     


    8) To start download, use the smdk-usbdl command.
    # smdk-usbdl -f u-boot.bin -a 0x20008000
     


    9) After downloading, PC will show the below message.
    # smdk-usbdl -f u-boot.bin -a 0x20008000
    SMDK42XX,S3C64XX USB Download Tool
    Version 0.20 (c) 2004,2005,2006 Ben Dooks <ben-linux@fluff.org>
    
    S3C64XX Detected!
    => found device: bus 004, dev 006
    => loaded xxxx bytes from xxxxxx
    => Downloading xxxxxx bytes to 0x20008000
    => Data checksum xxxx
    => usb_bulk_write() returned xxxxx
    #
     


    10) After downloading, Serial terminal will show below message.
    Download Done!! Download Address: 0x20008000, Download Filesize: 0xxxxx
    Checksum is being calculated..
    Checksum O.K.
    HKDKC100 #
     


    11) It's time to write the binary image to T-flash with "movi write"command.
    HKDKC100 # movi write u-boot 0x20008000
    Writing u-boot to sector xxxx (16 sectors).. completed
    Writing u-boot to sector xxxx (1024 sectors).. completed
    HKDKC100 #
     


8 T-flash sector map

Odroid has 2Gbyte T-flash(removable) memory card for system area. Assume it has 3,862,528 blocks(sectors) and each block has 512bytes.
Area NameSize in bytesFrom(sector #)To(Sector #)Partition Name
eFuse1K38625263862527
U-boot BL18K38625103862525
U-boot Envi. variables16K38624783862509
U-boot BL2512K38614543862477
Linux Kernel4M38532623861453
Reserved
EXT3 for Recovery System256MB26322723156560mmcblkp3
EXT3 for Android system256MB21027922632271mmcblkp2
EXT3 for Android user data1GB622102791mmcblkp1
Partition table / BPB31K061
Reserved area will be used for other purpose in the future. Or you can also install E-boot and a WinCE image to activate multi OS booting. B)

8.1 Where is T-flash(Micro-SD)

Odroid has 2 memory cards.
  • T-flash card contains boot-loader, kernel, Android system and applications.
  • SD card contains user files such as pictures, music, video clips and so on.

Open the battery cover and you can find them.

SD_tflash.jpg

If you want to know about T-flash in detail, visit this link. [http]http://en.wikipedia.org/wiki/MicroSD