Skip to main content

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., COM3 on Windows or /dev/ttyUSB0 on Linux).
  • -b, --board: (Optional) Specify the board name. Defaults to M5_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 (hex 0x... 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


Download files

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

Source Distribution

ax520tool-0.1a0.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

ax520tool-0.1a0-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file ax520tool-0.1a0.tar.gz.

File metadata

  • Download URL: ax520tool-0.1a0.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.1

File hashes

Hashes for ax520tool-0.1a0.tar.gz
Algorithm Hash digest
SHA256 7cfeb0e6d44d3150507a01817c8bb9dcd4a10d85f48b9a1e373c4bdeab9c8bbc
MD5 6ad0a1efbff0f892013bd300972da147
BLAKE2b-256 ca3c2dffc3b750c06e84f9293dae66cef85d82f2be528044524adfdd2dcf5227

See more details on using hashes here.

File details

Details for the file ax520tool-0.1a0-py3-none-any.whl.

File metadata

  • Download URL: ax520tool-0.1a0-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.1

File hashes

Hashes for ax520tool-0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec2f03ac8497135a7fb922859bca91ef43f95e450c1b17253cf1acbec85bacea
MD5 e8e91041362242e36d7c142934e7cbe3
BLAKE2b-256 a307e5f9c9621d0c5898bc2433d2748720db7b8b905491d7b6ffc8e101ffaa9c

See more details on using hashes here.

Supported by

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