ak7802-usbboot
USB boot/download tool for Anyka AK7802 SoC, reverse-engineered from the bootrom.
The bootrom calls this mode "Usbboot". It supports three operations: loading a program into internal or external memory over USB, writing arbitrary memory and register values, and transferring execution to a specified address.
Note: USB boot does not initialize external RAM. If DDR (0x30000000) is the target, initialize the memory controller first with poke commands before using write.
Install
See the repository root README for workspace setup.
On Linux, install the udev rule for non-root access:
sudo cp 99-ak7802.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger
Usage
Enter USB boot mode by pulling DGPIO[2] (DL_JUMP or USB_BOOT pin) high on the AK7802 before power-on.
All commands wait for the device automatically if it is not yet connected.
uv run ak7802-usbboot devices
uv run ak7802-usbboot write payload.bin --addr 0x30000000
uv run ak7802-usbboot read --addr 0x30000000 --len 0x1000 dump.bin
uv run ak7802-usbboot exec --addr 0x30000000
uv run ak7802-usbboot exec --addr 0x30000000 --wait
uv run ak7802-usbboot poke --addr 0x08000054 --value 0x03000000
Addresses and values accept both decimal and 0x-prefixed hexadecimal.
On-chip memory (L2 buffer at 0x48000200) requires no initialization.
exec is fire-and-forget by default. With --wait, the tool actively probes for the BootROM to resume USB boot mode by reading 0x0:4 until it sees the BootROM entry instruction bytes 06 00 00 EA.
Protocol
The device enumerates as 0471:0666 (USB 1.1 full-speed). The host communicates via EP3 OUT (bulk, 64B) for commands/data and EP2 IN (bulk, 64B) for uploads.
Commands are 64-byte frames with a fixed sync pattern, header/tail magic, and a one-byte opcode. See protocol.py for the full frame layout and opcode table.
Release files for ak7802-usbboot 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ak7802_usbboot-1.0.0.tar.gz | 6.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ak7802_usbboot-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.6 kB
Release files / ak7802_usbboot-1.0.0.tar.gz
| Download URL | ak7802_usbboot-1.0.0.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71c61b3b82b11461e306977f03ba44d15b4829ffb199c815a101f9f347999def
|
|
BLAKE2b-256 checksum How to use checksums |
3f3f1c01b0d506b3630fb053c73245ea077f6f304f2abd58e07e34766800e07c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / ak7802_usbboot-1.0.0-py3-none-any.whl
| Download URL | ak7802_usbboot-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0221f3e1d78b4c07109429136424dbe9567e99db3aa72f9a838b046fb65a12c7
|
|
BLAKE2b-256 checksum How to use checksums |
a9fab0eb4a4857e723929c45678a11f5305bdaeebfe78ff5998f9e069e5e15fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency log