Fully pythonic flash programmer tool for Axera AX520
Project description
AX520Tool
Description
AX520Tool is a versatile command-line tool designed for programming firmware onto AX520 series devices via a serial port. It facilitates various operations such as flashing firmware, reading and verifying memory, erasing flash, and managing device execution. Whether you're a developer or an embedded systems enthusiast, AX520Tool streamlines the process of interacting with AX520-based hardware.
Features
- Firmware Downloading: Upload firmware to AX520 devices with precise memory address targeting.
- Memory Operations: Read, write, and erase device memory regions.
- Firmware Verification: Ensure the integrity of flashed firmware by comparing device memory with source files.
- Command-Line Interface: Intuitive and flexible CLI for executing various operations.
- Progress Indicators: Real-time feedback during lengthy operations using progress bars.
- Error Handling: Comprehensive exception handling to guide users through issues.
Installation
pip install ax520tool
Usage
AX520Tool is operated via the command line. Below are the instructions to perform various operations.
Basic Syntax
python ax520tool.py -p <serial_port> [options] <command> [command_options]
-p,--port: (Required) Specify the serial port connected to the AX520 device (e.g.,COM3on Windows or/dev/ttyUSB0on Linux).-b,--board: (Optional) Specify the board name. Defaults toM5_TimerCamera520.-r,--reboot: (Optional) Reboot the device after flashing.-c,--check: (Optional) Verify firmware after flashing.
Commands
1. Write Flash
Download firmware to the device.
Syntax:
python ax520tool.py -p <serial_port> write_flash <address1> <firmware1> [<address2> <firmware2> ...]
<address>: Starting memory address (hex0x...or decimal).<firmware>: Path to the firmware binary file.
Example:
python ax520tool.py -p COM3 write_flash 0x3000000 firmware.bin
2. Read Flash
Read firmware from the device.
Syntax:
python ax520tool.py -p <serial_port> read_flash <address> <size> <output_file>
<address>: Starting memory address.<size>: Number of bytes to read.<output_file>: Path to save the read firmware.
Example:
python ax520tool.py -p COM3 read_flash 0x3000000 1048576 read_firmware.bin
3. Erase Flash
Erase a region of the device's flash memory.
Syntax:
python ax520tool.py -p <serial_port> erase_flash <address> <size>
<address>: Starting memory address.<size>: Number of bytes to erase.
Example:
python ax520tool.py -p COM3 erase_flash 0x3000000 65536
Examples
Flashing Firmware
Download firmware.bin to address 0x3000000 and reboot the device after flashing:
python ax520tool.py -p COM3 -r write_flash 0x3000000 firmware.bin
Reading Firmware
Read 1MB of firmware starting from address 0x3000000 and save it to read_firmware.bin:
python ax520tool.py -p COM3 read_flash 0x3000000 1048576 read_firmware.bin
Erasing Flash Memory
Erase 64KB of flash memory starting at address 0x3000000:
python ax520tool.py -p COM3 erase_flash 0x3000000 65536
Verifying Firmware
After flashing, verify the integrity of the firmware:
python ax520tool.py -p COM3 -c write_flash 0x3000000 firmware.bin
Note: The -c flag enables verification after flashing each file. It will never check overlapping.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ax520tool-0.1.1a0.tar.gz.
File metadata
- Download URL: ax520tool-0.1.1a0.tar.gz
- Upload date:
- Size: 20.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63e4e8d9c4e8fd462d5777297b5aa4a8cde49fbe8a2122b504058ef942b40aa3
|
|
| MD5 |
9380154c425c9a5068c4a7b2f2ca5192
|
|
| BLAKE2b-256 |
29c6f45ead74795899e7f5b65a07c0a6b85e720923654c6559852ec2a4e76254
|
File details
Details for the file ax520tool-0.1.1a0-py3-none-any.whl.
File metadata
- Download URL: ax520tool-0.1.1a0-py3-none-any.whl
- Upload date:
- Size: 20.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4afbacea2302496b9375785eb933f6325d09b4abcf418bce01a614065c403285
|
|
| MD5 |
067f26d55dfe0f853a16100381fea56c
|
|
| BLAKE2b-256 |
e8d0c58745e83bc82142e395a8b3351e2a7c3614087f3bcfd022e5fd32f70898
|