embflasher
Cross-platform CMSIS-DAP firmware programmer driven by CMSIS FLM flash algorithms, built on pyOCD.
CLI
↓
Python API (embflasher.flash)
↓
pyOCD
↓
DAPLink / CMSIS-DAP
↓
MCU
Supports macOS, Windows, and Linux (Ubuntu).
Installation
pip install embflasher
Local development:
git clone <repo-url>
cd embflasher
pip install -e .
Usage
embflasher --help
embflasher probe list
embflasher flash firmware.hex --flm chip.flm
Minimal usage — only firmware and --flm are required, everything else uses a sensible default (sector erase, verify on, reset on, 100k SWD frequency, cortex_m target):
embflasher flash firmware.bin --flm NS800RT50x9.FLM
If more than one DAPLink/CMSIS-DAP probe is connected, select one explicitly:
embflasher probe list
embflasher flash firmware.hex --flm chip.flm --probe <unique-id>
Full option list:
embflasher flash firmware.{bin,hex,elf} --flm chip.flm
[--probe <unique-id>]
[--erase auto|sector|chip] (default: sector)
[--no-verify]
[--no-reset]
[--bin-address 0x...] (.bin only; default: FLM's Flash start)
[--frequency 100k] (default: 100k)
[--connect halt|pre-reset|under-reset|attach] (default: under-reset)
[--target cortex_m] (default: cortex_m)
[--ram-start 0x20000000] (default: 0x20000000)
[--ram-size 0x...] (default: max(64KiB, FLM minimum))
Python API
from embflasher import flash, list_probes
flash(firmware="app.hex", flm="chip.flm")
# with overrides
flash(
firmware="app.bin",
flm="chip.flm",
probe="0123456789ABCDEF",
target="cortex_m",
frequency="4M",
erase="chip",
verify=True,
reset=True,
)
print(list_probes())
Requirements
- Python >= 3.10
- A DAPLink or CMSIS-DAP compatible debug probe
- pyOCD (installed automatically as a dependency)
USB permissions on Linux
On Ubuntu/Linux, the debug probe usually needs a udev rule to be accessible without root. pyOCD ships one:
python -m pyocd pack update # optional, first run
sudo curl -o /etc/udev/rules.d/50-cmsis-dap.rules \
https://raw.githubusercontent.com/pyocd/pyOCD/main/udev/50-cmsis-dap.rules
sudo udevadm control --reload-rules
sudo udevadm trigger
Then unplug and replug the probe.
License
MIT
Metadata
Release files for embflasher 0.1.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 | |
|---|---|---|---|
| embflasher-0.1.0.tar.gz | 9.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| embflasher-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.4 kB
Release files / embflasher-0.1.0.tar.gz
| Download URL | embflasher-0.1.0.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b67b298bc6858b6277a5fa9f1fc9502579c86a52ca39516447360b14d45c0b7
|
|
BLAKE2b-256 checksum How to use checksums |
d197ee5aa5ae1000826f4eb37b78b9a9368deb8376e8dc0496d6624c80494840
|
| 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 Sep 20, 2026.
Transparency logRelease files / embflasher-0.1.0-py3-none-any.whl
| Download URL | embflasher-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
de376af58f8c7c847812790c20c8d183d1f33433a8bd441ed09585bf127e307e
|
|
BLAKE2b-256 checksum How to use checksums |
fd69021c58bcef2ac003f6f3a4375c5412ac3f3f36414c95589fe758d3b1ee50
|
| 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 Sep 20, 2026.
Transparency log