Burn the image file to the SD card in Ubuntu-based on the Samsung 210 Development Board

Source: Internet
Author: User

Step 1: Install and compile necessary software for the Android system;

Step 2: Install the cross-compilation tool chain;

Step 3: Compile uboot

The uboot configuration file is smdkv210single. H. Copy two copies, one named smdkv210_nand.h and the other named smdkv210_sd.h,
Modify smdkv210_nand.h as follows:
// # Define pai_fastboot_onenandbsp
# Define pai_fastboot_nandbsp
// # Define pai_fastboot_sdmmcbsp
# Define config_evt1 1

Modify smdkv210_sd.h as follows:
// # Define pai_fastboot_onenandbsp
// # Define pai_fastboot_nandbsp
# Define ipv_fastboot_sdmmcbsp
# Define config_evt1 1

Make the following changes in makefile:
Cross_compile =/opt/arm-2009q3/bin/ARM-None-Linux-gnueabi-

Smdkv210single_config: unconfig
@ $ (Mkconfig) $ (@: _ Config =) arm s5pc11x smdkc110 Samsung s5pc110
@ Echo "text_base = 0xc3e00000"> $ (OBJ) Board/Samsung/smdkc110/config. mk

Smdkv210_nand_config: unconfig
@ $ (Mkconfig) $ (@: _ Config =) arm s5pc11x smdkc110 Samsung s5pc110
@ Echo "text_base = 0xc3e00000"> $ (OBJ) Board/Samsung/smdkc110/config. mk

Smdkv210_sd_config: unconfig
@ $ (Mkconfig) $ (@: _ Config =) arm s5pc11x smdkc110 Samsung s5pc110
@ Echo "text_base = 0xc3e00000"> $ (OBJ) Board/Samsung/smdkc110/config. mk

Note: smdkv210_nand_config and smdkv210_sd_config are newly added statements for configuring NAND and SD cards;

Create a uboot compilation script named Mk. The content is as follows:
#! /Bin/sh
# Create by liuqiming
# Date: 2011-11-24

Mode = $1

Cpu_num = $ (CAT/proc/cpuinfo | grep processor | WC-l)
Cpu_num = $ (cpu_num + 1 ))

Mkdir-P/home/lqm/share/tftpboot

# If no parameter is input, an error is returned.
If [-Z $ mode]; then
Echo "\ nerror: must set the compile mode"
Echo "Example: $0 NAND or $0 SD \ n"
Exit
Fi

# If the input parameter is greater than 1, an error is returned.
If [$ #-GT 1]; then
Echo-e "\ 033 [40; 32 m"
Echo "Usage:./mK [mode]"
Echo "Mode: nand, sd"
Echo "compile:./mK NAND or./mK SD"
Echo-e "\ 033 [40; 37 m"
Fi

If [$ mode = "NAND"]; then
Make distclean
Make smdkv210_nand_config
Make-J $ {cpu_num}
Music u-boot.bin uboot_nand.bin
CP uboot_nand.bin/home/lqm/share/tftpboot/uboot. Bin
Echo "cmd_^ uboot_nand.bin is finished successful! "
Exit
Elif [$ mode = "SD"]; then
Make distclean
Make smdkv210_sd_config
Make-J $ {cpu_num}
Music u-boot.bin uboot_sd.bin
CP uboot_sd.bin/home/lqm/share/tftpboot/uboot. Bin
Echo "cmd_^ uboot_sd.bin is finished successful! "
Exit
Else
Echo-e "\ 033 [40; 32 m"
Echo "Usage:./mK [mode]"
Echo "Mode: nand, sd"
Echo "compile:./mK NAND or./mK SD"
Echo-e "\ 033 [40; 37 m"
Exit
Fi

Run the MK script to compile the uboot started on the SD card:
./MK SD

Step 4: Compile the kernel
Make smdkv210_android_defconfig
Make menuconfig
Configure the file system to support the SD card file system:
Check ext4 filesystem on menuconfig.
File Systems
Set <*> the extended 4 (ext4) filesystem
Set [*] Use ext4 for ext2/ext3 file systems
Save & Exit

Modify the MAKEFILE file:
Arch? = Arm
Cross_compile? =/Opt/arm-2009q3/bin/ARM-None-Linux-gnueabi-

Then, make will generate the kernel image file zimage in the arch/ARM/boot directory.

Step 5: Compile the android File System
Rename the android compilation script build_android.sh to MK and make the following changes:
Kernel_dir = ../kernel
Sec_product = 'smdkv210'
Note that the uboot, kernel, and Android directories are all stored in one directory, as shown below:
Lqm @ lqm :~ /S5pv210 $ ls
Android kernel uboot uboot_20111124.tgz
Lqm @ lqm :~ /S5pv210 $
The android compiling script MK is in the android directory, so the kernel directory is ../kernel.
Modify the device/Samsung/smdkv210/boardconfig. mk file:
# Board_sdmmc_bsp: = false
# Modified for sdcard image.
Board_sdmmc_bsp: = true

# Board_userdataimage_partition_size: = 1073741824
# Modified for sdcard image.
Board_userdataimage_partition_size: = 370147328

Modify the system/extras/ext4_utils/mkuserimg. Sh file:
# Make_ext4fs-S-L $ size-A $ mount_point $ output_file $ src_dir
# Modified for sdcard image.
Make_ext4fs-L $ size-A $ mount_point $ output_file $ SRC

Execute MK script Compilation:
./MK

After compilation, the ramdisk-uboot.img will be generated in the android/out/target/product/smdkv210 directory,
System. IMG, zimage, userdata. IMG and other image files.

Step 6: Burn the uboot image file to the SD card
Put the SD card on the card reader, and then plug the card reader into a PC running Linux system. When using the SD card for the first time, you need to partition all the SD cards.
Delete and execute the following command:
Sudo fdisk/dev/SDB
Note: In most cases, the drive letter of the SD card is SDB. In rare cases, drive letters such as SDC and SDE may appear. CAT/proc/partition is required.
Command query.
Enter D and press Enter. If there are multiple drive letters, follow the prompts to delete them one by one. After deletion, press W to save them, re-insert the card reader, and use ls/dev/SD *
Command query. At this time, there should be only one SDB with no redundant partitions.
Go to the sd_fusing directory and run the script to burn the SD card image:
CD uboot/sd_fusing/
Sudo Bash./sd_fusing.sh/dev/SDB
Then, uboot is burned into the SD card.
Note that the script file sd_fusing.sh has been modified as follows:
Echo "BL1 fusing"
./Mkbl1 ../uboot_sd.bin SD-bl1-8k.bin 8192 # Separate the SD-bl1-8k.bin
Dd iflag = dsync Oflag = dsync if = SD-bl1-8k.bin of = $1 seek = $ bl1_position
# Write SD-bl1-8k.bin to SD card
Rm SD-bl1-8k.bin # Delete SD-bl1-8k.bin

####################################
# <U-boot fusing>
Echo "U-boot fusing"
Dd iflag = dsync Oflag = dsync if = ../uboot_sd.bin of = $1 seek = $ uboot_position
# Write uboot. bin to the SD card
Just modified the original u-boot.bin to uboot_sd.bin, because the uboot compilation script MK also made the corresponding changes.

Step 7: Use fastboot to burn the image file to the SD card
Linux fastboot for Android source package compiled, the specific path is Android/out/host/linux-x86/bin directory. Therefore, first
You need to modify the Ubuntu environment variable script:
Vim/etc/bash. bashrc
Add the following statement:
Export Path =/opt/arm-2009q3/bin: $ path
Export Path =/home/lqm/s5pv210/Android/out/host/ linux-x86/bin: $ path
First, the declaration of the cross-compilation tool, and second, the declaration of the fastboot command.
Then adjust the dial code switch cfg4 [6] = 00110x, insert the SD card to slot0 of the development board, start the development board, and start bootloader.
Press the Space key within the three-second countdown to enter the command line control bar, enter fastboot, and press Enter. Then, the screen displays blue, prompting that the fastboot status has been entered, Printing
The information is as follows:
Checking mode for fastboot...
Hit any key to stop autoboot: 0
Smdkv210 # fastboot
[Partition Table on movinand]
PTN 0 name = 'bootloader 'Start = 0x0 Len = N/A (use hard-coded info. (CMD: movi ))
PTN 1 name = 'kernel 'start = N/A Len = N/A (use hard-coded info. (CMD: movi ))
PTN 2 name = 'ramdisk' start = N/A Len = 0x300000 (~ 3072kb) (use hard-coded info. (CMD: movi ))
PTN 3 name = 'system' start = 0xb14800 Len = 0x79e1800 (~ 124806kb)
PTN 4 name = 'userdata' start = 0x84f6000 Len = 0x15ede800 (~ 359290kb)
PTN 5 name = 'cache' start = 0x1e3d4800 Len = 0x676a000 (~ 105896kb)
PTN 6 name = 'fat' start = 0x24b3e800 Len = 0xc6bfb800 (~ 3256302kb)

If the following error is prompted:
Error: No MBR is found at SD/MMC.
Hint: Use fdisk command to make partitions.
Run the command "fdisk-C 0" first. The execution process is as follows:
Smdkv210 # fdisk-C 0
Fdisk is completed

Partion # size (MB) block start # block count partition_id
1 3126 1200255 6403845 0x0c
2 120 22365 246015 0x83
3 353 268380 723135 0x83
4 101 991515 208740 0x83

Then, remove the SD card from the Development Board and put it on the PC through the card reader to format the partition:
− # Mkfs. vfat/dev/sdb0
− # Mkfs. ext4-J/dev/sdb1
− # Mkfs. ext4-J/dev/sdb2
− # Mkfs. ext4-J/dev/sdb3
Uboot is supported on the Development Board and fastboot is executed.

Start a debugging terminal and enter the following command:
Fastboot Devices
If the command is executed under a common user, the following message is displayed:
No permissions fastboot
If you execute the fastboot flash kernel zimage command, the system prompts <waiting for device>,
If sudo fastboot devices is executed, the following command is prompted: sudo: fastboot: Command not found. The following command must be executed:
Sudo Su
Enter the root user mode and run fastboot devices. The following message is displayed:
Root @ lqm:/home/lqm/s5pv210/Android/out/target/product/smdkv210 # fastboot Devices
SMDKC110-01 fastboot.
Go to the image generation directory and run the following commands to burn the image:
− "Fastboot flash bootloader u-boot.bin"
− "Fastboot flash kernel zimage"
−" Fastboot flash ramdisk ramdisk-uboot.img"
− "Fastboot flash system. IMG"
After the installation is complete, restart the Development Board and enter the android file system.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.