sunxi-fel 的相关命令

文章目录

  • 简介
  • 常用命令说明
    • 获取flash的相关信息
    • 列出所有的FEL设备
    • 显示BROM信息
    • 烧写程序到内存
    • 烧写程序到flash

简介

这个命令是全志芯片的烧写程序。有很多写法。
例如 : F1C100S 、F1C200S
这个命令有很多隐藏的相关问题(这里不讨论)

常用命令说明

获取flash的相关信息

$ ./sunxi-fel.exe -p spiflash-info
Manufacturer: Winbond (EFh), model: 40h, size: 33554432 bytes.

意思是 连接了 32MB 的FLASH,至于是NAND还是NOR。
flash的类型可能对板子有很大的影响。

这是一个 f1c200s开发板(使用了128MB NAND flash)的返回。(应该坏了)
$ ./sunxi-fel.exe -p spiflash-info
Manufacturer: Unknown (00h), model: C8h, size: 131072 bytes.

列出所有的FEL设备

$ ./sunxi-fel.exe -l
USB device 001:006   Allwinner F1C100s

显示BROM信息

这是F1C100S里面的信息

$ ./sunxi-fel.exe ver
AWUSBFEX soc=00001663(F1C100s) 00000001 ver=0001 44 08 scratchpad=00007e00 00000000 00000000

烧写程序到内存

这种方式,板子重启程序就没了。
将程序写到内存中并运行。
有好几中方法

./sunxi-fel.exe uboot ./uboot-with-spl-usb.bin 

这里运行uboot对应的bin之后,进入uboot模式,然后就可以执行对应的uboot命令了。

烧写程序到flash

这种方式,板子重启之后程序还在。

./sunxi-fel.exe -p spiflash-write 0x0 "u-boot-sunxi-with-spl.bin"
./sunxi-fel.exe -p spiflash-write 0x6000 "spl-separated.bin"
./sunxi-fel.exe -p spiflash-write 0x400000 "logo.bin"

解释:-p 是为了显示程序进度
0x0 是程序写入的地址
正常情况下写一个bin就好了,有的情况会写两个。写到0地址的负责引导,写到其他地址的是实际的程序。

全部命令
补充:

sunxi-fel.exe [options] command arguments... [command...]
        -h, --help                      Print this usage summary and exit
        -v, --verbose                   Verbose logging
        -p, --progress                  "write" transfers show a progress bar
        -l, --list                      Enumerate all (USB) FEL devices and exit
        -d, --dev bus:devnum            Use specific USB bus and device number
            --sid SID                   Select device by SID key (exact match)

        spl file                        Load and execute U-Boot SPL
                If file additionally contains a main U-Boot binary
                (u-boot-sunxi-with-spl.bin), this command also transfers that
                to memory (default address from image), but won't execute it.

        uboot file-with-spl             like "spl", but actually starts U-Boot
                U-Boot execution will take place when the fel utility exits.
                This allows combining "uboot" with further "write" commands
                (to transfer other files needed for the boot).

        hex[dump] address length        Dumps memory region in hex
        dump address length             Binary memory dump
        exe[cute] address               Call function address
        reset64 address                 RMR request for AArch64 warm boot
        memmove dest source size        Copy  bytes within device memory
        readl address                   Read 32-bit value from device memory
        writel address value            Write 32-bit value to device memory
        read address length file        Write memory contents into file
        write address file              Store file contents into memory
        write-with-progress addr file   "write" with progress bar
        write-with-gauge addr file      Output progress for "dialog --gauge"
        write-with-xgauge addr file     Extended gauge output (updates prompt)
        multi[write] # addr file ...    "write-with-progress" multiple files,
                                        sharing a common progress status
        multi[write]-with-gauge ...     like their "write-with-*" counterpart,
        multi[write]-with-xgauge ...      but following the 'multi' syntax:
                                          <#> addr file [addr file [...]]
        echo-gauge "some text"          Update prompt/caption for gauge output
        ver[sion]                       Show BROM version
        sid                             Retrieve and output 128-bit SID key
        clear address length            Clear memory
        fill address length value       Fill memory

        spiflash-info                   Retrieves basic information
        spiflash-read addr length file  Write SPI flash contents into file
        spiflash-write addr file        Store file contents into SPI flash

你可能感兴趣的:(单片机)