Uboot MMC command detailed &nand Flash uboot command detailed

Source: Internet
Author: User
  uboot MMC commands detailed  
One: MMC commands are as follows: 1: MMC read operations MMC read addr blk# cnt 2: MMC write addr blk# cnt 3: For MMC erase operations MMC erase blk# CNT 4: Re-search MMC set Standby MMC rescan 5: List MMC's partitions MMC part-lists available partition oncurrent MMC device 6: View the current device number, or set the device number and partition MMC dev [dev] [P Art]-Show or set CURRENTMMC device [partition] 7: Display the boot sub-area code MMC bootpart [Dev] [parts]-Show or Setboot partition 8: List when  Pre-MMC device MMC list-lists available devices 9: Print some information about current MMC devices Mmcinfo Two: MMC commands detailed 1:mmcinfo input: Mmcinfo display results: Manufacturer id:45 oem:100 name:sem08 Tran speed:25000000 Rd block len:512 MMC version 4.0 clock:52000000 high Capacity:yes Cap acity:7944011776 Bytes bus Width:8-bit DDR current Partition for boot:boot Partition 1 2:mmc list-lists available dev ICES input: MMC list appears as follows: fsl_usdhc:0 fsl_usdhc:1 fsl_usdhc:2 fsl_usdhc:3 Analysis: Boot is configured with four MMC resources, SD card is 2,emmc is 3 3:mmc dev[d EV] [PART]-Shows or set current MMC device [partition] Input: MMC Dev 3 is shown as follows: MMC3 (part 0) was current device analysis: Indicates that it is currently in eMMC NO. 0 Partition input for device: MMC Dev 31 appears as follows: MMC3 (Part 1) are current device analysis: Sets the 1th partition currently in the EMMC device 4:mmc bootpart [Dev] [part]-Show or set boot partition loses In: MMC Bootpart appears as follows: Device 3:boot partition 1 is for boot analysis: Uboot is in the first partition 5:MMC part-lists available partition on CU  rrent MMC device input: MMC part appears as follows: Partition Map for UNKNOWN device 3--Partition Type:dos-Partition Start sector Num Sectors Type 1 16384 16384 2 32768 16384 3 49152 6397952 5 extd 4 6447104 9150464 83 5 49153 3145727 83 6 3194881 3 145727 83 7 6340609 16383 83 8 6356993 8191 83 Analysis: Show all partitions of current eMMC 6:mmc read addr blk# cnt the function of this command is to read the data on the MMC to the memory parameters: Addr : Read to memory location Blk: Read Block location, this position is the 0 address of MMC offset, is 16 in the unit is 512 bytes CNT: Read the number of blocks, to read the memory of the size of the data, is 16 in the unit is 512 bytes: MMC de V 3 0 MMC read 0x10800000 600 10 Command analysis: Represents the result from the beginning of 1536x512 bytes (1536 is 600 in decimal) from the MMC, and reads 16x512 bytes (16 10) to the memory 0x10800000 display results: M MC Read:dev #3, Block # 1536, Count 16 ... Blocks Read:ok Results Analysis: We can only see from the results read successfully, but can not determine whether the read content is correct, so print the memory of the data to see if the contents of the MMC with the same input: md.b 0x10800000 100 Command analysis: Print memory location 0x10800000 100 bytes Display results: 10800000:b15ecb3c 6f62 746f 6564 616c 3d79 0033.
10800010:61626475 6172 6574 313d 3531 3032 0030. 10800020:70696461 7264 313d 3239 312e 3836 312e ipaddr=192.168.1 10800030:312e3330 7300 7265 6576 6972 3d70 3931.103.se rverip=19 10800040:2e323631 2e38 2e31 3031 0031 656e 6d74 2.168.1.101.netm 10800050:73613d6b 3532 2e35 3532 2e35 3532 2e
ask=255.255.255.
.....
....... Result Analysis: I store the environment variable in the position of MMC position 1536x512, the same as the memory print, read the correct 7:mmc write addr blk# cnt The function is to write the data on the memory to the MMC parameter: Addr: Location read from memory Blk: Write into the block position in MMC, which is the offset of the 0 address of the MMC, is 16, and the block unit is 512 bytes CNT: The number of blocks written to MMC, the size of the data to be written is 16, and the unit is 512 bytes: MMC Dev 3 mmc Write 0x108000000 0 100 command analysis: means to read the 256*512 data from the Memory 0x108000000 location (256 is 100 decimal) to the location of 0 on the MMC, where there is no example to verify that 0 on the MMC is a partitioned table. After I wrote the messy data in the memory, Uboot detected no partitions 8:mmc erase blk# CNT parameters: Blk: Erase the block position in MMC, which is the 0 address offset of MMC, is 16, and block unit is 512 bytes CNT: The number of blocks in the erased MMC is 16, and the block unit is 512 bytes
Nand Flash uboot Command detailed
NAND info & NAND Device

Display information for Flash:

DM365: >nand Info
Device 0:nand 32MiB 3,3v 8-bit, Sector size KiB
DM365: >nand Device
Device 0:nand 32MiB 3,3v 8-bit

NAND read (. oob) addr off size

Whether reading data, using NAND read, or reading OOB, use the command NAND Read.oob, followed by the address addr, are the address of RAM, off is the address of NAND flash, size: Refers to to read NAND flash data size, However, if you are reading OOB, the size cannot exceed the OOB size of a page, and oob size is 16 bytes if the page size is 512 bytes.

DM365: >nand read 86000000 58000 100
NAND read:device 0 Offset 0x58000, size 0x100
256 bytes Read:ok
DM365: >MD 86000000 40
86000000:ea000012 e59ff014 e59ff014 e59ff014
............
860000f0:e1a0000d eb00022e 00000000 00000000 ........ ...
DM365: >nand read.oob 86000000 58000 10
NAND read:device 0 Offset 0x58000, size 0x10
Bytes Read:ok
DM365: >MD 86000000 40
86000000:FFFFFFFF 2707ffff 33e316ad 44b2e1a1 ..... 3...D

If you want to read the full value of one page at a time, include OOB, use the following command, NAND dump.
NAND dump [addr] [size]

Call procedure: NAND dump addr Size (COMMON/CMD_NAND.C) ==> nand_dump () ==> Nand_read_raw ();
NAND dump no matter how big your size is, it will dump at least one page size:

SMDK2440 # NAND Dump 0 100
Page 00000000 Dump:
EA F0 9f e5
F0 9f e5 f0 9f e5 f0 9f e5 f0 9f e5
F8 C0 F8 F8 33 F8 (a)
F8 E0 F8-F8-EF-Am ad de
F8 F8 FA 6d FA 33/m
At 0f E1 1f C0 E3 D3 E3 (F0)
............
8c E5 FC 4d eb 9f e5 F0 3c
0d eb F4 9f e5 e5 ()
EB 0d A0 E1 E5-A0 E3
OOB:
FF FF-FF FF FF FF FF FF
FF FF-FF FF FF FF FF FF
FF FF-FF FF FF FF FF FF
FF FF-FF FF FF FF FF FF
FF FF-FF FF FF FF FF FF
A6 AB 3c CF 5a
A7 CF F0 A6 3f
0c C3 C3 cc F3

NAND write-addr off size

This command is the same as NAND read, except that the direction is reversed, and the value of RAM is written to NAND flash, but the write can only change 1 to 0 and not 0 to 1. This command will automatically skipping bad blocks.
NAND Erase [clean] [off size]

Before the rub will check is not bad block, if it is bad block, you can not do the action of the rub.

DM365: >nand Dump 1cc000 10
Page 001cc000 Dump:
87 04 08 78 19 00 40 02
............
DF 5b (BB) 6e E7 5a 3d B9 C8 BF
OOB:
FF-FF FF FF FF FF 45
Ed CC 3a E0 8e F9 ad
DM365: >nand Erase 1cc000 100
NAND erase:device 0 Offset 0x1cc000, size 0x100
Warning:erase size 0x00000100 smaller than one Erase block 0x00004000
Erasing 0x00004000 instead
Erasing at 0x1cc000-100% complete.
Ok
DM365: >nand Dump 1cc000 10  
Page 001cc000 Dump:
FF-FF FF FF FF FF FF-FF-FF FF FF FF FF FF FF FF
............
FF-FF FF FF FF FF FF-FF-FF FF FF FF FF FF FF FF
OOB:
FF FF-FF FF FF FF FF FF
FF FF-FF FF FF FF FF FF
DM365: >MW 86000000 00000000
DM365: >MW 86000004 00000000
DM365: >MW 86000008 00000000
DM365: >MW 8600000c 00000000
DM365: >md 86000000
86000000:00000000 00000000 00000000 00000000 ........ ...
DM365: >nand write.oob 86000000 1cc000 10
NAND write:device 0 Offset 0x1cc000, size 0x10
Bytes Written:ok

Page 001cc000 Dump:
FF-FF FF FF FF FF FF-FF-FF FF FF FF FF FF FF FF

FF-FF FF FF FF FF FF-FF-FF FF FF FF FF FF FF FF
OOB:
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
DM365: >nand Erase 1cc000 100
NAND erase:device 0 Offset 0x1cc000, size 0x100
Warning:erase size 0x00000100 smaller than one Erase block 0x00004000
Erasing 0x00004000 instead
Skipping bad blocks at 0x001cc000
Ok

commands that are not commonly used

These commands are used during testing and are not used normally.

"NAND scrub-really clean NAND erasing bad blocks (UNSAFE) \ n"
"Nand Markbad Off-mark bad blocks at offset (UNSAFE) \ n"
"Nand Biterr off-make a bit error at offset (UNSAFE) \ n"
"NAND lock [tight] [status]\n"
" bring NAND to lock state or display locked pages\n"
"NAND unlock [offset] [size]-unlock section\n");

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.