Full-A13 Development Board--Build an SD card that can start Linux

Source: Internet
Author: User
Tags spl

1 Creating a tool for connecting Toolchain    

# apt-get Install GCC-ARM-LINUX-GNUEABIHF ncurses-dev uboot-mkimage build-essential git

# older (prior to): Apt-get install Gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git


Building bootable SD card with Debian Linux image for A13 Olinuxino
Building Uboot# mkdir Olinuxino # CD Olinuxino
# git clone-b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git
# CD uboot-allwinner/
# make Cross_compile=arm-linux-gnueabihf-a13-olinuxino_config
# make cross_compile=arm-linux-gnueabihf-
# (older (prior): Make A13_olinuxino Cross_compile=arm-linux-gnueabi
# ls U-boot.bin spl/sunxi-spl.bin

Building the Kernal# CD:
download Kernel This is about 700M, and it's going to be a bit long.# git clone https://github.com/linux-sunxi/linux-sunxi.git
Enter the kernel directory after download# CD linux-sunxi/
Then make the relevant configuration# make Arch=arm a13_defconfig
# make Arch=arm menuconfig

If you want to use GPIOs for instance they is not enabled by default and you can do this by adding:

sun4i_gpio_ugly = y inside. config

Then you can contiue with:

# make Arch=arm Cross_compile=arm-linux-gnueabi HF -Uimage here to note is that the marked place cannot be less than the compilation error

When this is finish ' s you'll have uimage ready and you can build the kernel modules:

# Make Arch=arm cross_compile=arm-linux-gnueabi-install_mod_path=out modules

# Make Arch=arm cross_compile=arm-linux-gnueabi-install_mod_path=out Modules_install

Format and setup the Sd-card (formatting and setup sd-card) First, we have to make the correct card partitioning, which is done with Fdisk. Insert the SD card into the card reader and enter the terminal, then according to the command: LS/DEV/SD Press the match button, you will see the list of SD devices, for example: SDA SDB SDC You first want to determine which device is your SD device, you can unplug and plug it up to differentiate. Once you know which device is your sdcard if it is SdX command: FDISK-U=SECTORS/DEV/SDX then do the following several steps 1 P list partition table if the partition table already exists in your SD card partitions You go ahead. Step 2 D 1 remove them 3 N p 1 Create first partition table, start 2048 end 34815 4Create a second partitioned tableN P 2 Enter enter 5 then list the created partition table p if you do everything correctly, then you should see the following information:

        disk/dev/sdx:2001 MB, 2001731584 bytes
        heads, Sectors/track, 2270 cylinders, total 3909632 sectors
        Units = sectors of 1 * all = BYTES
        Sector size (logical/physical): bytes/512 bytes
        I/O size (minimum/optimal): bytes/512 bytes
        Disk identifier:0x00000000

Device Boot Start End Blocks Id System
/DEV/SDX1 2048 34815 16384-up Linux
/DEV/SDX2 34816 3909631 1937408-up Linux

6 writing an established partition table to the SD card w the first partition should be VFAT this is the command that is understood by the full bootloader: Mkfs. ext3/dev/sdx1 the second partition should be normal Lin UX EXT3 FS command: MKFS. ext3/dev/sdx2
root file system Debian RootfsThe Linux kernel and uboot are ready, now we have the Linux root filesystem, how to construct a very long topic, the best is we have pre-built we can download and can use.    First exit the Kernel Directory command: CD. Then download the Debian rootfs command:wget http://hands.com/~lkcl/mele_debian_armhf_minimal.cpio.gzMount your SD card partition table# mount/dev/sdx2/mnt # cd/mnt/ and unzip Rootfs(depending on the specific directory)

# gunzip-c/home/user/olinuxino/mele_debian_armhf_minimal.cpio.gz | cpio-i where "user" is the user name of your root user

# CD:

# Sync

# umount/mnt

You already have Debian on the second partition of your SD card.
Write Uboot and Kernel you build# mount/dev/sdx1/mnt/Copy the Kernel uimage to root directory in partition 1 # cp linux-allwinner/arch/arm/boot/uimage/mnt/. Download the Script.bin from:https://github.com/olimex/olinuxino/blob/master/software/a13/script.bin
and copy it to the same directory as Uimage
Script.bin is a very important text file, you can configure some parameters, such as the GPIO pin allocation, memory parameters, video resolution and so on. By changing some of the parameters in the file you can configure your Linux and do not need to recompile again and again.Write the Uboot

# CD uboot-allwinner/

# dd If=spl/sunxi-spl.bin OF=/DEV/SDX bs=1024 seek=8

# dd If=u-boot.bin OF=/DEV/SDX bs=1024 seek=32

# Sync

# umount/mnt

and copy the Kernel modules for Partition 2 # MOUNT/DEV/SDX2/MNT

# CD:

# cp-a linux-allwinner/out/lib/modules/3.0.42+//mnt/lib/modules/.

# umount/mnt

So now you have an SD card ready to boot Debian.(now there is a SD card ready-to-boot Debian on A13-olinuxino.)

Connect the USB to the serial port or VGA screen, insert the SD card into A13-olinuxino (-wifi), and power on, you should see the uboot and kernel information after the terminal. The default user name/password is: Root/password
Software Links

Linux Sunxi to build latest Kernel yourself

U-boot to build community u-boot

Building bootable Debian SD card for A13-olinuxino Original Step by step instructions what to make SD card image W ith above Kernel and u-boot

Forum Post with yet another + up to date explanation how to build SD card

Full-A13 Development Board--Build an SD card that can start Linux

Related Article

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.