libefex is a cross-platform library for interacting with Sunxi chips in both FEL and FES modes. FEL is a low-level subroutine contained in the BootROM on Sunxi devices used for initial programming and recovery. FES mode is another BootROM subroutine used for more advanced flash operations.
- Scan and connect to Sunxi devices in FEL and FES modes
- Read and write device memory
- Execute code in device memory
- Flash programming and management
- Support for multiple processor architectures (ARM32, AARCH64, RISC-V32 E907)
- C language API interface
- Python bindings - WIP
- Rust bindings
- CMake 3.16 or higher
- C compiler (GCC, Clang, MSVC, etc.)
- Linux:
libusb-1.0-0-devpackage
# Clone the repository with submodules
git clone --recursive https://github.com/YuzukiTsuru/libefex.git
cd libefex
# Create build directory
mkdir build && cd build
# Configure the project
cmake ..
# Build the project
cmake --build .| Option | Default | Description |
|---|---|---|
LIBEFEX_USE_SHARED_LIBUSB |
ON | Build libusb as shared library (LGPL compatible) |
USE_WINUSB |
ON (Windows) | Enable WinUSB backend on Windows |
To build with static libusb:
cmake -DLIBEFEX_USE_SHARED_LIBUSB=OFF ..Rust bindings are available in the rust/ directory.
libefex-sys uses the following strategy to find or build libusb:
- System libusb: First tries to find libusb via pkg-config (Linux/macOS)
- Build from source: If not found, builds libusb from source using CMake
| Platform | Library Source | Library Type |
|---|---|---|
| Linux | System (pkg-config) or CMake | Shared (.so) |
| macOS | System (pkg-config) or CMake | Shared (.dylib) |
| Windows | CMake | Shared (.dll) |
| Platform | Target |
|---|---|
| Windows x86_64 | x86_64-pc-windows-msvc |
| Windows ARM64 | aarch64-pc-windows-msvc |
| macOS ARM64 | aarch64-apple-darwin |
| Linux x86_64 | x86_64-unknown-linux-gnu |
| Linux ARM64 | aarch64-unknown-linux-gnu |
# In your Cargo.toml
[dependencies]
libefex-sys = { path = "path/to/libefex/rust/libefex-sys" }cd rust
cargo build --releaseRequirements:
- CMake 3.16+
- Linux:
libusb-1.0-0-devpackage (recommended) - macOS:
libusbvia Homebrew (optional)
libusb is linked as a shared library (LGPL compliant), users can replace the library.
| OS | Target | Tests |
|---|---|---|
| windows-latest | x86_64-pc-windows-msvc | ✓ |
| windows-latest | aarch64-pc-windows-msvc | ✗ |
| macos-latest | aarch64-apple-darwin | ✓ |
| ubuntu-latest | x86_64-unknown-linux-gnu | ✓ |
| ubuntu-24.04-arm | aarch64-unknown-linux-gnu | ✓ |
libefex is licensed under the MIT License. See the LICENSE file for more details.
libusb is licensed under the GNU Lesser General Public License v2.1. See lib/libusb-cmake/libusb/COPYING for details.