Skip to content

100askTeam/OpenixCLI

 
 

Repository files navigation

OpenixCLI

License: MIT Rust

A command-line & tui firmware flashing tool for Allwinner chips, written in Rust.

4610154f-10af-4016-afdd-cf5bdebb59e2

Overview

OpenixCLI is a powerful and user-friendly CLI tool designed for flashing firmware to devices powered by Allwinner SoCs. It supports both FEL (USB Boot) mode and FES (U-Boot) mode, providing a complete solution for firmware deployment.

Features

  • Device Scanning: Automatically detect connected Allwinner devices
  • Firmware Flashing: Flash firmware images with multiple modes
  • FEL/FES Support: Handles both FEL (USB Boot) and FES (U-Boot) device modes
  • FES Retry Guard: Auto retry once when first FES handshake fails after FEL->FES transition
  • Verification: Optional write verification for data integrity
  • Progress Tracking: Visual progress indicators during flash operations
  • Partition Selection: Flash specific partitions or entire firmware
  • Verbose Logging: Detailed debug output for troubleshooting

Installation

Prerequisites

  • Rust toolchain (1.70 or later)
  • libusb development libraries

Build from Source

git clone https://github.com/YuzukiTsuru/OpenixCLI
cd OpenixCLI
cargo build --release

The compiled binary will be available at target/release/openixcli.

Usage

Scan for Devices

List all connected Allwinner devices:

openixcli scan

Flash Firmware

Flash firmware to a device:

openixcli flash <firmware_file> [options]

Flash Options

Option Short Description
--bus -b USB bus number
--port -P USB port number
--verify -V Enable verification after write (default: true)
--mode -m Flash mode: partition, keep_data, partition_erase, full_erase (default: full_erase)
--partitions -p Comma-separated list of partitions to flash
--post-action -a Post-flash action: reboot, poweroff, shutdown (default: reboot)
--reconnect-timeout-sec Reconnect timeout seconds after FEL->FES handoff (default: 90)
--reconnect-interval-ms Reconnect polling interval milliseconds (default: 500)
--verbose -v Enable verbose output

Flash Examples

Flash firmware to a specific device:

openixcli flash firmware.img --bus 1 --port 5

Flash only specific partitions:

openixcli flash firmware.img --partitions "boot,system"

Flash with verification disabled:

openixcli flash firmware.img --verify false

Flash and power off after completion:

openixcli flash firmware.img --post-action poweroff

When USB reconnect is slow in VM passthrough (e.g. VMware), increase reconnect wait:

openixcli flash firmware.img --reconnect-timeout-sec 180 --reconnect-interval-ms 300

Flash Modes

Mode Description
partition Flash specific partitions only
keep_data Flash while preserving user data
partition_erase Erase and flash specific partitions
full_erase Full erase before flashing (default)

Device Modes

OpenixCLI supports the following device modes:

  • FEL (USB Boot): Initial boot mode for firmware flashing
  • FES (U-Boot): Secondary mode after U-Boot is loaded
  • UPDATE_COOL/UPDATE_HOT: Update modes

Project Structure

OpenixCLI/
├── src/
│   ├── commands/      # CLI command implementations
│   ├── config/        # Configuration parsing (MBR, sys_config)
│   ├── firmware/      # Firmware image handling
│   ├── flash/         # Flashing logic (FEL/FES handlers)
│   ├── utils/         # Utilities (logging, errors)
│   ├── cli.rs         # CLI argument definitions
│   ├── lib.rs         # Library exports
│   └── main.rs        # Application entry point
├── Cargo.toml
└── LICENSE

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Built with libefex for Allwinner USB communication
  • Inspired by the need for a modern, reliable firmware flashing tool for Allwinner devices

About

Open Source CLI Tools for Flash Allwinner Firmware to Devices. Support Windows, Linux, macOS

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 90.8%
  • C 6.6%
  • PowerShell 1.7%
  • Shell 0.9%