cmsis-pack-manager is a Python module, Rust crate, and command-line utility designed for managing CMSIS-Pack indexes and caches. It enables users to query for embedded device information such as processor types, flash algorithms, and memory layouts within Python programs or via its `pack-manager` CLI. The library leverages a fast Rust backend for performance. The current stable Python version is 0.6.0, with ongoing development and updates released periodically.
pip install cmsis-pack-managerVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the CMSIS-Pack manager and access its cache path. It also shows how to list installed packs, noting that an update is required to fetch packs from online sources. The `update_pdsc_idx()` and `get_device_by_name()` calls are commented out to make the example immediately runnable without network interaction or requiring pre-installed packs, highlighting where user action would be needed.
Prefer installing pre-built wheels via `pip install cmsis-pack-manager`. If building from source is necessary, check GitHub issues for specific workarounds, which may involve installing a particular `maturin` branch or temporarily removing `cmsis-pack-manager` from `install_requires` in a `setup.py`/`setup.cfg` file for related projects (e.g., `pyocd`). Ensure a stable Rust compiler is installed and up-to-date if building from source.
Ensure your project uses Python 3.7 or newer. Python 3.11 is explicitly supported in recent releases.
This is generally handled by the `pip install` process. If building from source, ensure `maturin` is correctly installed and configured in your build environment.
The cache location can be queried using `cmsis_pack_manager.Cache().data_path()`. If a different location is desired, the existing cache might need to be manually moved or cleared, and packs re-downloaded to the new location.
Ensure you have a stable Rust toolchain installed (`rustup install stable`), Python development headers (e.g., `python3-dev` on Debian/Ubuntu, `python-devel` on Fedora), and try `pip install maturin cffi` before installing `cmsis-pack-manager`.
Ensure your Python environment's script directory (e.g., `venv/bin` or `Python/Scripts`) is added to your system's PATH. Alternatively, invoke the CLI directly using `python -m cmsis_pack_manager.pack_manager <command>`.
This is often a server-side issue. Workarounds include manually downloading the problematic packs from the vendor's website and installing them locally, or ensuring no firewall/proxy is interfering with the connection.
Install the package using pip: `pip install cmsis-pack-manager`. If using a virtual environment, ensure it is activated. Verify that the Python interpreter running your code is the one where the package was installed.