Skip to main content

Event-driven asynchronous USB flasher for SMHUB

Project description

SMHUB USB Flasher

A utility for flashing OS firmware images onto the SMHUB over USB.

The process is fully automatic: the tool speaks directly to the chip's BootROM, negotiates a dynamic U-Boot bootloader into DRAM, then streams the disk image to the board's eMMC.

🖥️ 1. Graphical Interface (GUI)

We offer a standalone graphical flasher for Windows, macOS, and Linux. Please download it from the Releases page. The GUI provides a native, click-to-flash experience without requiring terminal commands or manual environment setups.

Note: The macOS GUI build is currently a work-in-progress and will be released soon!


🛠️ 2. CLI Setup (Cross-Platform)

The Python CLI tool smhub-flasher is fully cross-platform and works natively on Linux, macOS, and Windows. If this is your first time using this tool, you need to install its dependencies. On Linux, you also need to grant your terminal the correct permissions to talk to the raw USB ports.

Install Software

You will need to install fastboot using your system's package manager, and then install the Python flasher using pipx (or pip).

# Ubuntu/Debian
sudo apt-get update
sudo apt-get install fastboot

# Fedora/RHEL
# sudo dnf install android-tools

# macOS
# brew install android-platform-tools


# 2. Install the flasher package
pipx install smhub-flasher
# or
pip install smhub-flasher

Grant USB Permissions

By default, Linux forbids regular user accounts from modifying low-level USB devices for security. Rather than running the flashing tool as sudo (which is dangerous), we can install a permanent "rule" allowing your account safe access.

Simply copy and paste these exact commands into your terminal one-by-one:

# 1. Download the permission rules directly from the repository
sudo curl -Lo /etc/udev/rules.d/99-smhub-flasher.rules https://raw.githubusercontent.com/smlight-tech/smhub-flasher/main/99-smhub-flasher.rules

# 2. Tell Linux to reload these newly installed rules
sudo udevadm control --reload-rules
sudo udevadm trigger

# 3. Add your current user account to the 'dialout' allowed group
sudo usermod -a -G dialout $USER

Important: If you had to run step #3, you must completely log out of your computer and log back in, or restart your computer, for Linux to recognize your new group permissions!


⚡ 3. CLI Usage

Once the setup is complete, you are ready to flash your SMHUB board. The easiest way is to let the tool automatically download the latest official firmware release using the --online flag.

Basic Flashing

Run the flasher tool from your terminal:

# Automatically download and flash the latest stable release (Recommended)
smhub-flasher --online

# Or, if you have your own local firmware directory (containing fip.bin and emmc.img)
smhub-flasher --image-dir /path/to/my/firmware/

# Or explicitly defining specific local files
smhub-flasher --fastboot --fip /path/to/fip.bin --image /path/to/emmc.img

The Flashing Process

Once you hit enter, the tool will sit quietly and wait:

  1. Press the Reset button on your SMHUB board (or plug it in if it's currently disconnected).
  2. The terminal will instantly detect it and begin the ROM Handshake.
  3. You will see the board disconnect and reconnect automatically as it transitions out of hardware-mode into U-Boot. Do not unplug it!
  4. It will smoothly transition into sending your emmc.img payload.
  5. Once flashing is complete, the board will reboot automatically and it is safe to unplug.

Command Line Options

SMHUB USB Flasher

options:
  -h, --help            show this help message and exit
  --image-dir IMAGE_DIR
                        Path to directory containing fip.bin and emmc.img
  --fip FIP             Explicit path to fip.bin
  --image IMAGE         Explicit path to emmc combined image
  --list                List available online OS images
  --online [ONLINE]     Download and flash an online OS image (default: latest)
  -v, --verbose         increase output verbosity (-v: debug, -vv: packet trace)
  --fastboot            Flash the device using Fastboot mode
  --expert-help         Show help for advanced / expert-only options

Expert Options

The flasher also contains several advanced commands for development and slot-based flashing. See the Expert Mode Features documentation for full details on testing bootloaders (--test-bootloader), slot-based flashing (--kernel, --rootfs, --slot), and standalone bootloader flashing (--flash-bootloader).

🔧 Troubleshooting

  • Permission Denied / USBError: If it immediately crashes claiming it has no access, your Linux user permissions aren't set correctly. Ensure you followed the First-Time Setup completely and have logged out/in.
  • I want to see what is failing: Add the -v flag to the end of your command for verbose output (including standard Fastboot activity logs). For deeper debugging, use the -vv flag instead, which dumps the raw hexadecimal USB traffic onto the screen so developers can see what the hardware is complaining about at the transport layer.

License

License: GPL v3

Copyright © 2026 SMLIGHT

This project is licensed under the GNU General Public License v3.0. You are free to use, modify, and distribute this software under the terms of that license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smhub_flasher-1.0.0.tar.gz (50.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smhub_flasher-1.0.0-py3-none-any.whl (53.1 kB view details)

Uploaded Python 3

File details

Details for the file smhub_flasher-1.0.0.tar.gz.

File metadata

  • Download URL: smhub_flasher-1.0.0.tar.gz
  • Upload date:
  • Size: 50.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for smhub_flasher-1.0.0.tar.gz
Algorithm Hash digest
SHA256 797cf3c25ea3d293f113ee22cc490d530732ffb5e82a5efc4108886a546b6e8d
MD5 d12258978175233a2589aecadc48c4bd
BLAKE2b-256 6a79645b7b088b7391b6470199ad5c7303305371852490dd708bbd54715479cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for smhub_flasher-1.0.0.tar.gz:

Publisher: publish.yaml on smlight-tech/smhub-flasher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smhub_flasher-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: smhub_flasher-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 53.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for smhub_flasher-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d690036c6f4ffac71e84e0ba4865c7309953778e060d9d7f5f8a11d91296368
MD5 37226836a33911e3b57a6730b39d79eb
BLAKE2b-256 cf51e87c8adaca841a39f39851869a4485f6b069aa6b48e76b98fd493ba8d1d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for smhub_flasher-1.0.0-py3-none-any.whl:

Publisher: publish.yaml on smlight-tech/smhub-flasher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page