The general method of burning and writing uboot/bootloader/kernel in embedded system

Source: Internet
Author: User

General method of writing Uboot/bootloader/kernel in embedded system   This article describes the general method of burning uboot/bootloader/kernel in embedded systems, and if uboot or kernel errors occur,   www.2cto.com   boot failure and so on how to re-burn write uboot/kernel.  burning write Uboot/kernel generally there are two ways, one is in the Linux itself (shell), directly uboot/ Kernel image files (binaries) use the command to burn write Flash to the flash specific partition,  another is on the Uboot interface, by configuring SERVERIP,IPADDR, using the TFTP command to download uboot/ Kernel to flash   examples are as follows:  //one, burning the UBOOT/KERNEL MTD write command in the shell of Linux is a custom burn-write Flash command.  //Burn Write Uboot,/dev/mtd0 is bootloader specific partition  MTD write u-boot.bin/dev/mtd0  //burn write kernel, MTD1 is kernel specific partition MTD write vmlinux.elf/dev/mtd1 //restart reboot  //Two, burn uboot/kernel in Uboot interface, take kernel as an example  // //native uboot IP address in bootloader interface setenv ipaddr 10.10.167.10 //server IP address setenv serverip 10.10.167.249  //Download Linux kernel vmlinux52tftpboot 0 vmlinux52 //write to Flash. The 0x20000000 is the storage location of the vmlinux52.  //0x1dd00000 is the starting position of the system kernel (each device location is different),  //+0x600000 is the file length upgrade 0x20000000 0x1dd00000 +0x600000 // Restart linux bootoctliux ***********************  If the boot fails due to uboot or kernel errors, and the card is dead, you need to determine whether the problem is in the uboot phase or the Linux phase, which can be judged by observing the debug information during the startup process.   If uboot problems are troublesome, because this requires a flash chip with the correct uboot/bootloader as the boot,  to reboot the system into the Uboot interface, Then re-burn the uboot to flash in the system itself, and then burn the kernel (if necessary).    A, re-burn write uboot  first need a specific PCLL (Flash chip), this PCLL cured a correct bootloader, through this bootloader can successfully enter the Bootloader interface , the Uboot/bootloader is re-burned under this condition.   The procedure for using this PLCC is to power up the system when the system is under power, using a jumper/dial switch, etc. to boot the system from external flash (i.e., PLCC), and then start from the PLCC.   After successful launch, enter the Uboot interface,   that is, the command line displays Dream 5220# # (similar to a command line prompt)   at this point the version of the card will be started from nor flash.   then re-burn the uboot to this nor flash.    then use Kermit   to operate.  kermit is a serial service tool, similar to minicom, features more than minicom.  //kermit/usb0.cfg   is a Kermit configuration file where you can configure/dev/ttyusb0 and other paths kermit-y kermit/usb0.cfg -y kermit/usb0.cfg   Specify the configuration file.   The contents of this file are as follows:/* set line/dev/ttyusb0                       & nbsp                 &NBSp                          ,         &NB Sp                                  set Speed 115200set carrier-watch off set hardshake noneset flow-control nonerobustset file type Bin set file name l It set Rec Pack 1000set Send pack 1000set window 5 */Save this file in the home directory, named: kermit/usb0.cfg (customizable)   Enter Kermit after execution interface, press c   to enter the serial interface (that is, the device interface)   switch back to the Kermit interface shortcut: Ctrl + \ &nbsp, and then press C  .   Execute: Dream 5220# # detect    Show: Checking for NOR Flash ... Flash detect 33554432mb  This indicates that flash is in good condition.  //Let the serial port enter the receiving state. Dream 5220# # loadb   into the Kermit interface: Ctrl + \   Press c  to execute: Send  uboot.bin  sends the Uboot.bin file in the current directory to Serial.   After completion, enter the serial interface.   performed: Dream 5220# # Upgrade 0x20000000 0x1dc00000 +0xe0000 0x20000000 is the default address that Kermit send files to after performing send  . Then write the file to nor Flash's first address: 0x1dc00000  +0xe0000 for the length of the write.   Execution: RESET. Let the system restart.  /*  at this point, the new uboot burning finish, reset, if still unsuccessful, then the problem is definitely in the Linux startup phase or the new uboot still have a problem, this can be started by the debug information in the process to see   one, If there is a problem with the kernel, so that Linux does not enter the shell interface, to re-enter the Uboot environment, that is, after reset, press CTRL + C &NBSP, so that after Uboot startup is complete, will not enter the kernel start-up phase, Instead, stay in the Uboot command line,  in this uboot environment, burning the new kernel, configuring the Ipaddr,serverip, and so on, with the first example of the same operation.  //native uboot IP address setenv ipaddr 10.10.167.10 //server IP address setenv serverip 10.10.167.249 // Download the Linux kernel vmlinux52//file in the server's Tftpboot directory, build to the TFTP service environment Tftpboot 0 vmlinux52 //burn to Flash. The 0x20000000 is the storage location of the vmlinux52.  //0x1dd00000 is the starting position of the system kernel (each device location is different),  //+0x600000 is the file length upgrade 0x20000000 0x1dd00000 +0x600000  at reset Before, the environment variables are usually set.   such as  setenv Linux_args mtdparts=octeon_nor0:1m (BOOT), 7m (Linux), 21m (CONFIG), 3m (MD)  setenv bootcmd ' Bootoctlinux 0x1dd00000 coremask=0x3 mem=700 '  //save saveenv bootoctliux  Two, if the newly burned uboot itself has problems, Then modify the Uboot code, after compiling the pass, use PLCC repeat the above burning process.

General methods for burning uboot/bootloader/kernel in embedded systems

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.