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

Source: Internet
Author: User

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

This paper introduces the general method of burning write Uboot/bootloader/kernel in embedded system, and if Uboot or kernel error occurs, www.ahlinux.com

How to re-burn the uboot/kernel when the boot fails.

There are generally two ways to write Uboot/kernel, one is in the Linux itself (shell), directly to the Uboot/kernel image file (binary file) using the command to burn Flash write to the flash specific partition,

The other is on the Uboot interface, by configuring the SERVERIP,IPADDR, using the TFTP command to download Uboot/kernel to flash

Examples are as follows:

One, write Uboot/kernel in the shell of Linux

The MTD Write command is a custom burn-write Flash command.

Burn Write Uboot,/dev/mtd0 is a specific partition of bootloader

MTD Write U-boot.bin/dev/mtd0

Burn write kernel, MTD1 is a specific partition of kernel

MTD Write VMLINUX.ELF/DEV/MTD1

Restart

Reboot

Second, write Uboot/kernel in the Uboot interface, take kernel as an example

In the Bootloader interface

The IP address of the native Uboot

setenv ipaddr 10.10.167.10

Server IP Address

Setenv ServerIP 10.10.167.249

Download Linux kernel vmlinux52

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

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 the uboot problem is more troublesome, because it requires a flash chip with the correct uboot/bootloader as a guide,

Reboot the system into the Uboot interface and then re-burn the uboot into flash in the system itself to burn the kernel (if necessary).

One, 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, under this condition to re-burn write Uboot/bootloader.

The steps to use this PLCC are:

When the system is under power, the boot mode of this system is changed from external flash (i.e. PLCC) using jumper/dip switch, etc.

The system is then power up and then starts from the PLCC.

After successful launch, enter the Uboot interface, which is the command line display Dream 5220# # (similar to command line prompt)

This will change the way the card is started from nor flash. Then re-burn write uboot to this nor flash.

Then use the Kermit to operate.

Kermit is a serial service tool, similar to minicom, features more than minicom.

Kermit/usb0.cfg is a Kermit configuration file in which you can configure paths such as/dev/ttyusb0

Kermit-y kermit/usb0.cfg

-y kermit/usb0.cfg Specifies the configuration file.

The contents of the document are as follows:

/*

Set line/dev/ttyusb0

Set Speed 115200

Set Carrier-watch off

Set Hardshake None

Set Flow-control None

Robust

Set File Type Bin

Set file name lit

Set REC Pack 1000

Set Send Pack 1000

Set Window 5

*/

Save this file in the home directory, named: kermit/usb0.cfg (customizable)

After execution enter the Kermit interface, press C

Enter the serial interface (which is the device interface)

Switch back to the Kermit interface shortcut: Ctrl + \, then press C.

Perform:

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

Enter Kermit interface: CTRL + \ Press C

Perform:

Send Uboot.bin

is to send the Uboot.bin file in the current directory to the serial port.

When finished, enter the serial interface.

Perform:

Dream 5220# # upgrade 0x20000000 0x1dc00000 +0xe0000

0X20000000 is the default address that Kermit send a file to when it executes send.

Write the file to nor Flash's first address: 0x1dc00000 +0xe0000 is the length of the write.

Execution: RESET. Let the system restart.

/*

At this point, the new Uboot finish, after 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 seen through the debug information during the startup process

One, if the kernel has a problem, cause Linux does not enter the shell interface, to re-enter the Uboot environment, that is, after reset, always press CTRL + C, so that after the completion of Uboot startup, will not enter the kernel start phase, but stay in the Uboot command line,

In this uboot environment, burning new kernels, configuring Ipaddr,serverip, and so on, is the same as in the first example.

The IP address of the native Uboot

setenv ipaddr 10.10.167.10

Server IP Address

Setenv ServerIP 10.10.167.249

Download Linux kernel vmlinux52

The file is in the Tftpboot directory of the server and is built into 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

Before reset, the environment variables are usually set.

Like what

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

Second, if the new burning writes the uboot itself has the problem, then modifies the Uboot code, compiles through, uses PLCC repeats above the burning writes the process.

    • This article is from: Linux Tutorial Network

The general method of burning and writing uboot/bootloader/kernel in embedded 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.