Uboot SF Command Usage

Source: Internet
Author: User

If SPI/QSPI Flash is supported in Uboot, then you can use SF's erase, read, and write command to manipulate SPI Flash


SF read is used to read flash data to memory

SF Write write memory data to Flash

SF Erase erase the specified position, specify the length of the Flash content, erase the content after 1


Specific Usage

SF probe [[Bus:]cs] [Hz] [mode]-init flash device on given SPI bus and chip select

SF Read addr offset len-read ' len ' bytes starting at ' offset ' to memory at ' addr '

SF Write addr offset len-write ' len ' bytes from memor in ' addr ' to flash at ' offset '

SF erase offset [+]len-erase ' len ' bytes from ' offset ' ' +len ' round Up ' len ' to block size

SF Update addr Offset len-erase and write ' len ' bytes from memory in ' addr ' to flash at ' offset '


usage Examples

SF probe

Be sure to call the SF probe before using the SF read SF write


SF Write 0x82000000 0x0 0x20000

Put the memory 0x8200 0000 data, write to flash offset 0x0, write data length of 0x20000 (128KB), operation offset and length of the smallest unit is byte


SF Read 0x82000000 0x10000 0x20000

The Flash offset 0x10000 (64KB), the length of 0x20000 (128KB) of data, written to the memory 0x82000000, operation offset and length of the smallest unit is byte


SF Erase 0x0 0x10000

Erases the erase block between the offset 0x0 and the 0x10000, and the erase operation is in erase blocks, requiring the offset and Len parameters to be erase block aligned


from the SF command, you can see several points:

1. SPI Flash has no OOB data, that is, no EDC ECC, no bad block management concept.

2. Support for byte-level read and write operations, support random access.


How to verify read-write effects

Can combine uboot MD command, SF Read, SF write all involve memory operation, can use MD to view memory data

MD 0x82000000 0X100

Print 0x82000000 start, length range 256 bytes of memory data


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.