Summary of problems with USB-boot support during migration

Source: Internet
Author: User

========================================================== ====
Author: yuanlulu

Http://blog.csdn.net/yuanlulu

No copyright, but please keep this statement for reprinting
========================================================== ====

I recently transplanted the u-boot.201006 to smartarm3250, and later added the ubi File System porting.

During the porting process, I encountered n problems and had to deal with them for a long time. I would like to share my mistakes here and hope they will be useful to my colleagues.

 

 

(1) After U-boot is started, the system prompts "*** warning-bad CRC or nand, using default environment"

This is generally not a big problem. It's okay to ignore it. It reminds you that you cannot read environment variables in falsh. You can only use the default environment variables defined in the software. If you want to solve the problem, you only need to input saveenv in U-boot. It will not appear again next time. If it still appears, it may be that your NAND driver is faulty, it may also be a bad block.

U-boot uses the environment variables in flash by default. If the environment variables are modified in the software, it is best to saveenv once.

 

(2) Error 12 of U-boot.

This is an error after I joined the ubi support.

UBI error: ubi_init: ubi error: Cannot initialize ubi, error-12
UBI init error-12
Refer to include/ASM-generic/error. h. The definition of the error no. 12 found is "# define enomem 12/* out of memory */". After tracking, it is in Driver/MTD/ubi/build. the second vmalloc in the ubi_attach_mtd_dev function of C will die, so modify config_sys_malloc_len in smartarm3250.h (my configuration file) and increase it to 1 m (1024*1024 ). Solve the problem.

 

(3) Error 5 of U-boot.

UBI error: ubi_io_write: Error-5 while writing 512 bytes to peb, written 0 bytes
Check include/ASM-generic/error. h. The definition of error No. 5 is "# define EIO 5/* I/O Error */".
In:
I get "ubi_io_write: Error-5 while writing 512 bytes to peb"
If you have a 2048 bytes per NAND page device, and have config_mtd_nand_verify_write enabled in your kernel, you will need to turn it off. the Code does not currently (as of 2.6.26) perform verification of sub-page writes correctly. as ubi is one of the few
Users of sub-page writes, not much else seems to be affected by this bug.
Although Linux Kernel configuration is used, config_mtd_nand_verify_write is also available in U-boot. comment out the macro in smartarm3250.h to solve the problem. It seems to be a kernel problem. Since U-boot uses the Linux kernel driver to a large extent, it should be a ubi driver problem.

 

(4) cannot start volume update.

In the ubi_volume_write function in common/cmd_ubi.c, find the place where this sentence is printed, and print the err to find that it is still error 12. The solution is as follows.

 

(5) at startup, the kernel prints the ubi 19 error (no such device ).

That is, the kernel cannot find a partition. Generally, the config_bootargs defined in U-boot is incorrect.

My correct definition is:

# Define config_bootargs "Ubi. MTD = 4 root = ubi0: rootfs console = ttys0, 115200 mem = 64 m rootfstype = ubifs RW"
The original incorrect syntax is # define config_bootargs "Ubi. MTD = 6 root = ubi0: rootfs console = ttys0, 115200 mem = 64 m rootfstype = ubifs RW ". The reason is that the partitioning method of the U-boot to the NAND falsh is different from that of the Linux kernel.

The partitions defined by U-boot are as follows:

# If 1
# Define mtdids_default "nand0 = nandflash0"
# Define mtdparts_default "mtdparts = nandflash0:" 1536 K (bootloder )"/
"512 K (Params )"/
"4 m (kernel )"/
"16 m (safefs )"/
"-(Root )"
# Endif // end of YLL

 

(6) When the Linux kernel is started, output the following information and stop:
Ubifs error (PID 1): ubifs_read_node: Bad node type (0 but expected 6)
Ubifs error (PID 1): ubifs_read_node: Bad node at LEB 0: 0
List of all partitions:
1f00 1536 mtdblock0 (driver ?)
1f01 256 mtdblock1 (driver ?)
1f02 4096 mtdblock2 (driver ?)
1f03 16384 mtdblock3 (driver ?)
1f04 239616 mtdblock4 (driver ?)
No filesystem cocould Mount root, tried: ubifs
Kernel panic-not syncing: VFS: Unable to mount root FS on unknown-block (0, 0)

This problem is caused by a write command error. The original write command is ubi write 0x01600000 rootfs $ (filesize) and should be ubi write 0x080008000 rootfs $ (filesize ).
That is to say, the file system is not written to flash.
If you have such errors, either your file system image is not written (or is not written correctly) or your file system image is faulty. Other problems may be minor.

 

(7) software version issues.

When the Linux kernel is started, the following information appears and stops:

Ubifs error (PID 1): ubifs_check_node: Bad CRC: calculated 0x9f186f96, read 0x3baee010
Ubifs error (PID 1): ubifs_check_node: Bad node at LEB 0: 0
Ubifs error (PID 1): ubifs_read_node: Expected node type 6
VFS: cannot open root device "ubi0: rootfs" or unknown-block (0, 0)
Please append a correct "root =" Boot option; here are the available partitions:
1f00 1536 mtdblock0 (driver ?)
1f01 256 mtdblock1 (driver ?)
1f02 4096 mtdblock2 (driver ?)
1f03 16384 mtdblock3 (driver ?)
1f04 239616 mtdblock4 (driver ?)
Kernel panic-not syncing: VFS: Unable to mount root FS on unknown-block (0, 0)
My file system image was made using a mtd-utils2010 and I later changed to mtd-utils2009 to solve the problem.

My kernel version is 2.6.27.8. I guess because my kernel version is old, so there is a difference between the kernel and the CRC algorithm in the mtd-utils2010 will be bad CRC.

If you encounter a similar problem, make sure that the kernel version matches the MTD-utils version. To check whether the kernel and MTD-utils match each other, you only need to check whether the kernel and MTD-utils match each year, or the time is close. In short, there may be errors in collaboration between two software that have been working for a long time.

MTD-utils http://ftp.debian.org/pool/main/m/mtd-utils/ (download package ending with orig.tar.gz)

 

I sometimes think about how many mistakes I make. In fact, it is a kind of happiness to make mistakes. What else do you learn if you find a document to follow suit.

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.