sunxi-fel(1)
πΈ NAME πΈ
sunxi-fel β it's the whole manual page for controlling the USB BootROM protocol on Allwinner CPUs, and bestie, it's giving absolute baddie energy π
β¨ SYNOPSIS β¨
sunxi-fel [OPTIONS] COMMAND [ARGS]
π DESCRIPTION π
sunxi-fel is a script interface for USB communication with the BootROM of Allwinner CPUs. No cap. π«Ά
So here's the lore: on explicit request (typically by pressing a button often labeled "uboot" or "recovery"), or when all other booting methods fail π, the CPU's early ROM code enters the so called FEL mode, where it will wait for USB commands sent by some host to the Allwinner CPU's USB OTG interface. And sunxi-fel? It implements this FEL protocol and communicates with the ROM code, to download or upload data and to start code execution. Iconic behavior, honestly. β¨
Besides simply allowing you to write to or read from device memory, sunxi-fel also helps with more complex things, which involve uploading code, executing it and then returning to FEL mode, to allow further data transfer or inspection. It's the multitasking queen π. In particular it supports loading and executing U-Boot, including the primary SPL stage.
π OPTIONS π
Those options affect general execution and should be put first, before any actual commands. Like, first, okay? Do not skip the queue. π
-h,--helpβ print a help message and exit. The classic "bestie explain" button π-v,--verboseβ enable verbose logging. She's chatty now β¨-p,--progressβ"write"transfers show a progress bar. We love a visual π-l,--listβ enumerate all (USB) FEL devices and exit π--list-socsβ print a list of all supported SoCs and exit π-d,--devbus:devnum β use specific USB bus and device number π―--sidSID β select a device by its SID key (exact match). The SID key of a particular device can be queried using the"sid"command. Exact match only, she does not do approximations π
π₯ SUNXI-FEL COMMANDS π₯
sunxi-fel can take several commands, each followed by their parameters, and will execute them in order. The only exception is the "uboot" command, which will delay launching U-Boot until all other commands have been executed. It's the main character who waits for the whole group photo to be taken first π
β οΈ Please note that accessing any part of the DRAM will not work until the DRAM controller has been initialized. This can be achieved by uploading and executing a suitable U-Boot SPL image, using the "spl" command. Trying to access DRAM before that will most likely hang. Not a vibe. Not slay. Do the SPL first, bestie. π
Any numbers given as parameters to those commands can be prefixed with "0x" to denote hexadecimal notation or "0" to start an octal number. They are interpretated as decimal numbers otherwise. (Yes, interpretated β that's what the page says, we don't edit the queen's words π)
spl <filename>β load and execute U-Boot SPL.
Upload the given binary file to the appropriate SRAM location, carefully moving the FEL stack out of the way in the process. The binary is then executed. When it returns, the FEL stack is restored and execution is transferred back to the BootROM's FEL routine. She's so organized for that π«Ά
If the file additionally contains a main U-Boot binary (u-boot-sunxi-with-spl.bin), this command also transfers that to memory, using the load address stored in the image file, but won't execute it. Just, like, parking it there. π
uboot <u-boot-sunxi-with-spl.bin>β 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 possibly needed for the boot. Delayed gratification, but make it firmware. β¨hex[dump] <address> <length>β hexadecimal memory dump. Dumps<length>bytes of the memory region starting at<address>. The context will be displayed as a hexdump, suitable for human inspection. Human-readable, we stan πdump <address> <length>β binary memory dump. Dumps<length>bytes of the memory region starting at<address>. The context will be dumped"as is"to the standard output, so it can be redirected to a file and processed as binary data. Raw. Unfiltered. No edits. πexe[cute] <address>β start executing code at<address>in memory on the device. Go, girl, go πβοΈreset64 <address>β request a warm reset of the core, starting execution in the 64-bit AArch64 execution state, at<address>. Sixty-four bit era, periodt. πwdresetβ reset the device by triggering the watchdog with the shortest possible period. This will reset the whole SoC, including all on-SoC peripherals, but might not affect on-board devices like PMICs or PHYs. So like, mostly a full reset, but read the fine print π₯memmove <dest> <source> <size>β copy<size>bytes within device memory, from<source>to<dest>. Sliding things around, no biggie π§readl <address>β read a 32-bit value from device memory at<address>. The value will be output as a hexadecimal number, prefixed with"0x". The address needs to be 4-byte aligned. Alignment matters, bestie, don't be chaotic π€writel <address> <value>β write the given 32-bit<value>to device memory at<address>. 32 bits of pure intent β¨read <address> <length> <file>β write memory contents into file. Reads<length>bytes from memory at<address>and writes the content into<file>. Confusingly named but we move πwrite <address> <file>β store file contents into memory. Writes the entire content of<file>into memory at<address>. Entire. Content. No crumbs left behind πwrite-with-progress <addr> <file>β display a textual progress bar while writing to the device. Same as"write"with the"-p"parameter. Same energy, more visuals πwrite-with-gauge <addr> <file>β same as write, but write the progress in percentages to the standard output. This can be piped to any"dialog"compatible program, when using the--gaugewidget. Pipe her anywhere, she's flexible πwrite-with-gauge <addr> <file>β same as write, but write the progress in percentages to the standard output. This can be piped to any"dialog"compatible program, when using the--gaugewidget. (Yes, same as above β the extended one is next, keep scrolling π)write-with-xgauge <addr> <file>β same aswrite-with-gauge, but with extended gauge output. This can be piped to any"dialog"compatible program, using the--gaugewidget. Aside from updating the current progress in percents, it also updates the number of bytes written and gives an estimated time to completion. Overachiever behavior, we love it πmulti[write] # <addr> <file> ...β like"write-with-progress", but with multiple load adddresses and files, all sharing the same progress bar. (The double-dadddressesis her typo, I'm just the messenger π«Ά)multi[write]-with-gauge ...β like"write-with-gauge", but with multiple load adddresses and files, all sharing the same progress bar. Group project, one shared bar πmulti[write]-with-xgauge ...β like"write-with-xgauge", but with multiple load adddresses and files, all sharing the same progress bar. Group project with extra stats π₯echo-gaugesome text β update prompt/caption for gauge output. This outputs a command to be interpreted by"dialog"to change the caption text. Subtitles but for your progress bar πver[sion]β show the BROM version. This prints some static data, among other things containing the detected SoC. Can be used to verify a FEL connection is working. The ultimate vibe check βsidβ retrieve and output the 128-bit SID key. This key contains some form of serial number, which should be unique to each chip (although there have been reports of same SIDs for particular batches of chips). So like... should be unique. Allegedly. πsid-registersβ as the"sid"command above, but use the alternative MMIO register access method on the device. There are SoCs that require this method due to bugs in the SID implementation, those known will automatically choose this workaround when using the"sid"command. This command here is to test new SoCs for compliance. The compliance officer of SID commands π§sid-dumpβ read the entire SID eFuses array and dump its content. For SoCs with a known eFuses layout, this will annotate the known regions. Dump it all, annotated, gorgeous β¨clear <address> <length>β clear<length>bytes of memory starting at<address>(filling with zeroes). Fresh start, zero thoughts π«§fill <address> <length> <value>β fills<length>bytes of memory starting at<address>with the byte<value>. Repeat the byte, slay the memory π¨spiflash-infoβ retrieves basic information about a SPI flash chip attached to the SPI0 pins. This is using the same method as the BootROM does, to accesses the same storage that the device could boot from.
Prints the manufacturer of the flash chip and its capacity. Should also be used to detect the presence of a SPI flash chip. Who is she, and how much can she hold π
spiflash-read <addr> <length> <file>β reads<length>bytes starting from offset<addr>of a SPI flash chip, storing the result into<file>. Grab and go πspiflash-write <addr> <file>β reads<file>and stores its content in the SPI flash, starting at offset<addr>. Take the file and put it in the flash, periodt π₯
π EXAMPLES π
$ sunxi-fel -v -p ver
$ sunxi-fel uboot u-boot-sunxi-with-spl.bin
$ sunxi-fel -v -p spl sunxi-spl.bin write 0x44000 bl31.bin write
0x4a000000 u-boot.bin reset64 0x44000
Look at that last one β three commands stacked, one line, zero fear. Ate. π β¨
π AUTHOR π
Andre Przywara <osp@andrep.de> β the genius behind all of this, give her her flowers π
and that's the whole page, bestie!! this sunxi-fel(1) manual page is version 1.5, dated 14 Jan 2022, and it lives under the sunxi-fel man page source. mwah πππ¦ no cap, go flash something responsibly π«Ά
π¦ where this page comes from
- debian trixie: sunxi-tools 1.4.2+git20240825.4390ca-1 Β· MIT
- nixos 26.05: sunxi-tools 0-unstable-2025-03-29
- nixpkgs unstable: sunxi-tools 0-unstable-2025-03-29
- ubuntu questing: sunxi-tools 1.4.2+git20240825.4390ca-1
- ubuntu resolute: sunxi-tools 1.4.2+git20240825.4390ca-1build1 Β· MIT
- ubuntu stonking: sunxi-tools 1.4.2+git20260530.d7bbd1-1 Β· MIT
- Copyright (C) 2018 by Andre Przywara <osp@andrep.de>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms