A high-performance .NET communication library for Allwinner processors. It supports memory read/write, code execution via FEL mode, and FES protocol operations. Designed for firmware flashing, bootloader development, and system debugging tools.
Install via NuGet:
dotnet add package FirmwareKit.Comm.FexIt is recommended to use EfexContext.Open for automatic device probing and verification:
using FirmwareKit.Comm.Fex;
// Default uses Allwinner standard VID: 0x1F3A, PID: 0xEFE8
using var ctx = EfexContext.Open();
if (ctx == null)
{
Console.WriteLine("No device detected in FEL mode.");
return;
}
Console.WriteLine($"Device Detected: {ctx.Resp.DeviceName}");Easily perform memory operations and execute code in FEL mode:
// Read memory from device
byte[] buffer = new byte[1024];
var readResult = ctx.FelRead(0x40000000, buffer, progress => {
Console.WriteLine($"Read {progress} bytes...");
});
// Write data to device memory
byte[] dataToLoad = File.ReadAllBytes("u-boot-spl.bin");
var writeResult = ctx.FelWrite(0x40000000, dataToLoad);
// Execute code at specified address
var execResult = ctx.FelExec(0x40000000);
if (execResult == SunxiEfexError.Success)
{
Console.WriteLine("Execution command sent successfully.");
}The library provides a detailed enum to describe operation results:
SunxiEfexError result = ctx.FelExec(0x8000);
if (result != SunxiEfexError.Success)
{
Console.WriteLine($"Operation failed: {result.ToErrorMessage()}");
}Built-in payload factories for specific boot-time operations across different architectures:
- AArch64: 64-bit ARM support.
- Arm32: Traditional 32-bit ARM support.
- RISC-V: Experimental RISC-V support.
• .NET Standard 2.0/2.1: Compatible with legacy .NET Framework and Unity environments. • Modern .NET (8/9/10): Deeply optimized with support for Native AOT and high-performance I/O. • Multi-backend Support: - Windows: Uses WinUSB drivers. - Linux: Powered by LibUsb. - macOS: Native IOKit support.
This project is licensed under the MIT License.