Step by step teach you how to run uboot on Skyeye

Source: Internet
Author: User
1. Introduction

Skyeye is a good Simulator Based on various ARM Series CPUs, SOC and motherboard. Uboot is a boot program that can run on a variety of CPU (ARM, MIPS, PowerPC) boards. It is equivalent to a pc bios, but far stronger than a common bios. For example, it supports network boot, boot various kernels, even a simple shell, and so on. Both of them are open-source and free software based on GPL.

This article teaches you how to use Skyeye to simulate EP7312 and run uboot with the minimal amount of code modification, giving new users a perceptual knowledge about embedded systems.

2. Establish a Development Environment

2.1 install the Skyeye Simulator

The development environment is built on Linux. First download and install the source code package of the skyeyes-0.8.5.1, unzip, install according to readme inside, pay attention to your Linux to have GTK support. You must be the root user during installation. For installation notes under various Linux distributions, refer to the relevant posts on the forum. After the installation is successful, add the target directory of Skyeye to your path so that you can execute the Skyeye simulator in any directory.

2.2 cross-compiler Installation

Cross-compiler is a compiler that runs on the host to compile another architecture. For example, my host is Linux on x86. Now I want to compile ARM-based code, so I cannot use a common compiler and need a cross compiler. I have tried to build a cross compiler from the source code of GCC, which is very troublesome and time consuming. Uboot authors have also developed a good cross compiler called ELDK (Embedded Linux development kit ). I will use this, of course, you can also use other embedded companies to provide. You can view ELDK images at the following URL:

ELDK availability: http://www.denx.de/twiki/bin/view/DULG/ELDKAvailability

ELDK has three versions: MIPS, PPC, and arm. I downloaded the ARM-based cross compiler from the following image:

Http://sunsite.utk.edu/ftp/pub/linux/eldk/3.1/arm-linux-x86/iso/

The file is "arm-2004-11-09.iso", which supports ARM7, arm9-, XScale, at91rm9200 and other arm based systems.

Install the cross compiler. I install the cross compiler in my own directory "/opt/x86-arm:
// MNT/CDROM/install-D/opt/x86-arm/

After the installation is complete, set the user environment:

Export Path = "$ {path}:/opt/x86-arm/usr/bin:/opt/x86-arm/bin"
Export cross_compile = arm-Linux-
In this way, you can access the cross compiler in any directory.

Test:

Arm-Linux-gcc-O testarm test. c
File testarm
Testarm: Elf 32-bit LSB executable, arm, Version 1 (ARM), for GNU/Linux 2.2.5, dynamically linked (uses SHARED libs), not stripped.
It indicates that the compiled file is the code on arm. You can use arm-Linux-GCC to compile your files.

3. Modify uboot

You can download the latest uboot source code from the uboot website.



Then return to the uboot root directory, configure and compile:

Make ep7312_config
Make all
After the wait ends, we will find the u-boot.bin and U-boot files, where the u-boot.bin is a raw binary file. U-boot is in ELF format.

4. Configure Skyeye and run uboot

First, create a directory that represents your EP7312 motherboard. In this way, files can be kept clean and orderly.

Mkdir board01
Copy the u-boot.bin you just compiled to this directory. Skyeye supports raw binary and elf formats. Here we use raw binary format.

Edit Skyeye. conf. This file is used to configure the motherboard. For details, see the related documentation of Skyeye. My Skyeye. conf is as follows:

# Skyeye config file for uboot
CPU: arm720t
Mach: EP7312

Mem_bank: Map = I, type = RW, ADDR = 0x80000000, size = 0x00010000

# Skyeye for uboot Flash 16 m bank 1
Mem_bank: Map = m, type = RW, ADDR = 0x00000000, size = 0x01000000, file =./u-boot.bin, boot = Yes

# Skyeye for uboot SDRAM 16 m bank 1
Mem_bank: Map = m, type = RW, ADDR = 0xc0000000, size = 0x01000000

Note that the memory address and capacity allocation here are adjusted according to the EP7312 configuration file in uboot. In this way, we can minimize the modification of uboot code.

At this time your skyeye-ep7312 motherboard is configured. You can try to run it. In your current directory, enter:
Skyeye

Then enter the following in the Skyeye interface:

Target Sim
Run
At this time, you can see the uboot startup interface and prompt. If you type "hlep", you can view all commands supported by uboot, and type "version" to view the current uboot version.

5. Further work

This article is the most basic step-by-step guide. There are a lot of work to try. For example:

× Because Skyeye does not support flash memory, can we modify the EP7312 relative flash code on uboot to meet our needs temporarily? Otherwise, for setting environment parameters on uboot, we can only modify the default parameters in the source code.

* Uboot supports 8019as Ethernet controller, Skyeye also supports the simulation of this hardware, we want to further make the uboot network also on Skyeye with the 'target = _ blank> http://u-boot.sourceforge.net/
Ftp://ftp.denx.de/pub/u-boot/

The source code structure of uboot is clear and detailed, which is a good example of learning embedded systems. I downloaded the latest U-Boot-1.1.2. Because we want to simulate the EP7312 chip, and uboot already supports an EP7312-based board, we only need to slightly modify the configuration of the EP7312 board in uboot. The configuration files of the motherboard in uboot are all under "include/configs/. H", so we can find include/configs/ep7312.h and modify it.

Find
# Define config_driver_cs8900 1
Change
# Define config_driver_cs8900 0

Find
# Define config_commands (config_cmd_dfl | pai_cmd_jffs2)
Change
# Define config_commands (config_cmd_dfl)/* Skyeye doesn' t have jffs2 */

Then return to the uboot root directory, configure and compile:

Make ep7312_config
Make all
After the wait ends, we will find the u-boot.bin and U-boot files, where the u-boot.bin is a raw binary file. U-boot is in ELF format.

4. Configure Skyeye and run uboot

First, create a directory that represents your EP7312 motherboard. In this way, files can be kept clean and orderly.

Mkdir board01
Copy the u-boot.bin you just compiled to this directory. Skyeye supports raw binary and elf formats. Here we use raw binary format.

Edit Skyeye. conf. This file is used to configure the motherboard. For details, see the related documentation of Skyeye. My Skyeye. conf is as follows:

# Skyeye config file for uboot
CPU: arm720t
Mach: EP7312

Mem_bank: Map = I, type = RW, ADDR = 0x80000000, size = 0x00010000

# Skyeye for uboot Flash 16 m bank 1
Mem_bank: Map = m, type = RW, ADDR = 0x00000000, size = 0x01000000, file =./u-boot.bin, boot = Yes

# Skyeye for uboot SDRAM 16 m bank 1
Mem_bank: Map = m, type = RW, ADDR = 0xc0000000, size = 0x01000000

Note that the memory address and capacity allocation here are adjusted according to the EP7312 configuration file in uboot. In this way, we can minimize the modification of uboot code.

At this time your skyeye-ep7312 motherboard is configured. You can try to run it. In your current directory, enter:
Skyeye

Then enter the following in the Skyeye interface:

Target Sim
Run
At this time, you can see the uboot startup interface and prompt. If you type "hlep", you can view all commands supported by uboot, and type "version" to view the current uboot version.

5. Further work

This article is the most basic step-by-step guide. There are a lot of work to try. For example:

× Because Skyeye does not support flash memory, can we modify the EP7312 relative flash code on uboot to meet our needs temporarily? Otherwise, for setting environment parameters on uboot, we can only modify the default parameters in the source code.

× Uboot supports the 8019as Ethernet controller, and Skyeye also supports the simulation of this hardware. How can we further enable the uboot network to be used on Skyeye?

* You can also use uboot to test the development of simulated flash. Uboot contains a large number of Flash drivers.

I hope you can advise me to further modify and improve it.

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.