U-boot kernel, file system download mode, u-boot Kernel
1 Preparation 1.1 TFTP server
The host computer uses the Ubuntu system. The installation method of the TFTP server is as follows:
$ Sudo apt-get install tftpd-hpa |
Open the tftp configuration file in the path:/etc/default/tftpd-hpa, as shown below:
TFTP_USERNAME = "tftp" TFTP_DIRECTORY = "" TFTP_ADDRESS = "0.0.0.0: 69" TFTP_OPTIONS = "-l-c-s" |
Here, TFTP_DIRECTORY indicates the path determined by the file downloaded from the tftp file. The permission for this file is at least
"Dr-xr-x"
1.2 U-boot TFTP Configuration
Start the Development Board to u-boot and configure the TFTP parameters as follows:
Setenv eth1addr 4a: ac: 3a: 4c: 7a: 07 // set the MAC address of the local Nic Setenn ethact gmac0 // set the current working network card Setenv ipaddr = 192.168.12.200 // configure the local IP address of u-boot Setenv serverip = 192.168.12.199 // configure the TFTP server IP Address Saveenv |
2 U-boot download and nand burning
L U-boot kernel download
U-boot: tftp 0x21000000 zImage |
Download zImage to 0x2000000 of memory
L Nandflash Erasure
U-boot: nand erase 0x200000 0x359CD0 |
Erase the space at nandflash address 0x200000, with the size of 0x359CD0 byte
L U-boot kernel nand burning and writing
U-boot: nand write 0x21000000 0x200000 0x359CD0 |
The zImage image at memory 0x2000000 is in the size of 0x350CD0 byte and burned to the space at nandflash's start address: 0x200000.
The download and write processes of the file system are basically the same. For UBIFS file systems, run the following command:
U-boot: nand write. trimffs addr off size |
Otherwise, the following error occurs during kernel boot file system:
No filesystem cocould mount root, tried: ubifs
Kernel panic-not syncing: VFS: Unable to mount root fs on unknown-block (0, 0)
Is it necessary to manually erase the Embedded Development Board that has loaded u-boot and file system before re-Downloading u-boot and the new file system?
Not necessarily, you need to know whether your u-boot has its own and new features.
I know: you can use the u-boot tftp Command to download the kernel mirror or the u-boot.bin to update yourself.
In fact, you can use a programming tool in windows to erase and re-burn u-boot.
The file system should belong to the operating system layer. It must be based on u-boot.
After checking it, we can see that the file system is built on the kernel and can be used for user information resource management.
In fact, you only need to understand your storage structure. The address of bootloader and kernel (the file system is mounted on the kernel ),
When booloader jumps to the kernel address, it must be consistent with the starting address of the kernel.
As to how you put your code in the memory, you can use the bootloader or download tool to achieve the same effect.
Therefore, you can update yourself through the bootloader itself, or use a burning tool;
The file system should be updated through the kernel (operating system.
I wonder if your problem has been solved.
Thank you!
What tools are used in ubuntu to perform uboot and kernel burning?
List the file systems. How to run uboot, kernel, and file system: 1. How to Run uboot
Downloading Uboot involves two steps: Step 1: Download uboot to the extended RAM of the system and run it; Step 2: Download the entire uboot to the memory through the uboot running in the memory and then burn it to nandflash.
Step 1 download uboot to extend RAM
First, use the short-circuit block to select the system from the internal start, reset or power-on will be in the serial port software (115200 8 n 1) will see the printed information LPC31xx ready for plain image>, at this time, use the Serial Software to send the u-boot-init.bin, and then send the u-boot.bin, will start uboot in RAM, print the output startup information, and countdown, at this time to send arbitrary characters to the system, stop timing, disable the serial software, and connect to the system using a Super Terminal.
Step 2: Run uboot to nandflash
Enter the loady command in the Super Terminal, and then use the transfer/Send File, select the Ymodem protocol, send the u-boot.bin, after the receipt is complete, first erase the nand erase, You can erase all (do not give the parameter ), you can also use the parameter to specify the region. Generally, the first time you need to completely wipe the region, then use nand_params to write the flash information to it, and finally use nand write 0x30001000 0x4000 0x100000
0x30001000 indicates the address of uboot in the memory;
0x4000 starting address for storing uboot in flash, depending on the actual partition;
0x100000 is the uboot size, not smaller than the actual size;
Now, write uboot into nandflash and remove the Short-Circuit Jumper so that it can be started from nandflash.
2. kernel burning and writing
In the uboot Start countdown, press any key to stop and input loady, similar to the uboot burning and writing. The main Commands used are: nand erase 0x200000 (Address) 0x200000 (size)
Nand write 0x30001000 0x200000 0x200000
3. Writing a File System
File System burning and writing can be done through serial port burning in a similar way as the kernel, or through mounting nfs using mtd_debug tool, because the file system is large, the first method is slower.
Command Used for serial port burning
Loady
Nand erase 0x600000 0x3a00000 (current partition condition)
Nand write 0x30001000 0x600000 0x800000 (actual size)
Command Used for nfs burning
Mtd_debug erase/dev/mtd2 0 0x3a00000
Mtd_debug write/dev/mtd2 0 0x800000 ubi. img
For the meaning of each item, refer to the help of mtd_debug to obtain the description directly by using mtd_debug. The len can be in decimal number, but not in uboot, if you do not add 0x, it will also be considered as hexadecimal.
4. Options for starting a File System
In uboot, you can set the startup options through environment variables. Generally, you only need to configure the nfs or ubi mounting file system and the kernel startup options.
Mount ubifs in nanflash:
Setenv bootargs console = ttyS0, 115200n8 ubi. mtd = 2 root = ubi0: rootfs rootfstype = ubifs;
Mount/rfs/rootfs on 129.1.4.199, and the local I... the remaining full text>