Introduction to Bootloader and migration of uboot

Source: Internet
Author: User
Introduction to Bootloader and migration of uboot
1. Introduction
Embedded system applications are generally burned into flash, EEPROM or ROM. In the development process
Continuously download the program to the target board for debugging. If you want to burn the program into flash every time, a flash
Is slow (erased, programmed). Second, when running in flash, the debugger cannot break the breakpoint, so it cannot be easily tuned.
Purpose. Third, frequent flash burning reduces the service life of flash.
A better method is to download the application to ram to solve the above problems. There are two methods:
1) download the image to ram through JTAG. The premise of using this method is that the RAM on the target board has been correctly started.
Or cannot be downloaded.

2) run a program on the target board (the program is in Flash ).
Ost downloads the image to ram. Such as serial port, USB interface, and network interface. This method is boot.
Loader method.
2. Introduction to bootloader
Anyone who has played Linux knows LILO or grub, two very famous boot programs, used to guide the operating system. And
The bootloader introduced in is very similar. Basically, the job is to perform some simple initialization work. However
And then transfer the control to the image (operating system or application) to be run ).
A better bootloader provides a better interactive interface and provides some
Is a useful tool. For example, you can view and modify the content in Ram and download the image from the host to ram in multiple ways.
Saves configuration information to flash.
To provide these functions, bootloader must implement the driver of the relevant device. If you can download IM from a network interface
It must implement the NIC Driver, IP protocol, ARP protocol, TFTP protocol, and so on. Serial Port and flash reading and writing are also
So.
The common free bootloader is armboot, which is used for the Development Board using the ARM-based CPU. PPC-boot is used
PowerPC architecture CPU development board. Development of both bootloaders has been stopped. And combine them into one,
Become U-boot. The current version is 0.4.0. You can download the source program on sourceforge.net.
3. Introduction to U-boot
The current rease version of U-boot has been transplanted to arm720t, ARM920T, at91rm9200, i386, MIPS, m
On pc5xx, mpcrjx, mpc8260, mpc8xx, ppc4xx, PXA, and sa1100 platforms, more development boards are supported.
. For other monitor commands and file systems supported, see readme.
4. USB-Boot porting
Let's talk about the main porting steps:
1) check whether the porting environment is Windows (cygwin) or Linux. We strongly recommend that you run
Porting: There are many compilation problems in WIN (cygwin), which are very time-consuming.
2) download tool chain, install it, and port it to the ARM platform in Linux, and use arm-Linux-XX (XX: GCC, objcop
Y, as, LD, etc ).
3) download U-boot, decompress, and read readme. It is very important !!! Check the directory structure.
4) Find the most similar target board under the board directory and the CPU directory, and study it carefully.
5) then refer to the building the Software section in readme for porting. The specific part will not be written.
6) After compilation, you must use the flash burning tool to download uboot. bin to the board. Run on host
Super Terminal: power on the Board to see if uboot is running on the Super Terminal. Repeat this process for debugging.
Try.
7) Remember to initialize the ram first, and the UART driver should be changed to the Super Terminal.
8) the following section describes how to start with the program.
Int main (INT argc, char * argv [])
{
Sighandler_t no_more_time;
Signal (sigalrm, no_more_time );
Alarm (project_deadline-tosec (3 * week ));
If (available_money> available_manpower ){
Pay consultant to port U-boot;
Return 0;
}
Download latest U-boot source;
Subscribe to U-boot-Users Mailing List;
If (clueless ){
Email ("Hi, I am new to U-boot, how do I get started? ");
}
While (learning ){
Read the README file in the top level directory;
Read http://www.denx.de/re/DPLG.html
Read the source, Luke;
}
If (available_money> tolocalcurrency ($2500 )){
Buy a bdi2000;
} Else {
Add a lot of aggravation and time;
}
Create your own board support subdirectory;
Create your own board config file;
While (! Running ){
Do {
Add/modify source code;
} Until (compiles );
Debug;
If (clueless)
Email ("Hi, I am having problems ...");
}
Send patch file to Wolfgang;
Return 0;
}
Void no_more_time (INT sig)
{
Hire_a_guru ();
5. Conclusion and feelings

Before porting, you first need to know how to get help. Before that, I didn't know how to get help.
Maillist of uboot has been in the process of exploration and comparison.

The process of porting and debugging is quite trivial, and many details are not clearly explained. Not moved
Once successfully planted, it was easy to do similar work. Be sure to stick to it, especially in the face of many things you are not familiar
When the West is frustrated, stick to 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.