pydebuggerupgrade
pydebuggerupgrade is a combined Command Line Interface and library utility for upgrading firmware on Microchip debuggers with DFU based bootloaders.
These tools are currently supported:
- PKOB nano (nEDBG): Embedded debugger found on kits
Usage
pydebuggerupgrade can be used as a command-line interface or a library
Command-line usage
for help, use:
pydebuggerupgrade --help
Upgrade using local firmware artifact
pydebuggerupgrade supports firmware artifact zip files and hex files
Example: Upgrade PKOB nano (nEDBG) with zip
pydebuggerupgrade -t nedbg nedbg_fw-1.13.458.zip
Example: Upgrade PKOB nano (nEDBG) with hex
pydebuggerupgrade -t nedbg nedbg.hex
Upgrade using pack server
pydebuggerupgrade is capable of fetching firmware artifacts from the Microchip pack server (https://packs.download.microchip.com)
Example: Upgrade PKOB nano (nEDBG) with firmware from the latest released pack
pydebuggerupgrade -t nedbg latest
Example: Upgrade PKOB nano (nEDBG) with firmware from a specific pack version Note: This version indicates the pack version and not the firmware version inside it
pydebuggerupgrade -t nedbg 1.0.33
Report firmware versions
The -r/--report option makes pydebuggerupgrade only report firmware versions and not do any upgrade. Both the version of the currently loaded firmware and the version of the upgrade candidate is reported
Example: Report versions using latest release from pack server
pydebuggerupgrade -t nedbg -r latest
Command-line switches
Many of these switches are optional, and many parameters are automatically set when using a Curiosity Nano kit.
- -t TOOL to select which tool to use. Optional if only one is connected.
- -s SERIALNUMBER to select which tool instance to use. Optional if only one is connected. Substring matching on end of USB serial number is supported.
- -v LEVEL for selecting logging verbosity ('debug', 'info', 'warning', 'error', 'critical')
- -T TIMEOUT to configure the timeout in seconds when attempting to connect to tool
- -a to upgrade all tools matching tool type and USB serial number
- -b to upgrade all tools matching the tool type that are already in boot mode before doing the upgrade of the tool with the specified USB serial number
- -r to report (i.e. no upgrade) version of upgrade candidate and version of currently loaded firmware
- -f to force upgrade or downgrade (no version checking)
- -V to print pydebuggerupgrade version number and exit
- -m to use Microchip internal artifact server
Library
pydebuggerupgrade can be used as a library using its "backend API". For example:
# Print the pydebuggerupgrade version
from pydebuggerupgrade.version import VERSION as pydebuggerupgrade_version
print("pydebuggerupgrade version {}".format(pydebuggerupgrade_version))
# Print the backend API version
print("pydebuggerupgrade backend API version: {}".format(backend.get_api_version()))
# Instantiate backend
from pydebuggerupgrade.backend import Backend
backend = Backend()
# Choose from one of these:
# Upgrade to latest published pack
backend.upgrade_from_source(source="latest")
# Upgrade with a specific zip
backend.upgrade_from_source(source="nedbg_fw.zip", tool_name="nedbg")
# Upgrade with a specific hex file
backend.upgrade_from_source(source="nedbg.hex")
Linux systems
Create udev rules for the debuggers in HID mode as well as DFU mode:
Example udev rules file
Store in /etc/udev/rules.d
# PKOB nano (nEDBG) - debugger on Curiosity Nano
SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2175", MODE="0666"
# PKOB nano (nEDBG) in DFU mode - bootloader of debugger on Curiosity Nano
SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2fc0", MODE="0666"
Note that udev rules are required for both DFU (boot) mode and normal debugger (application) mode. These rules are detailed in the pyedbglib package: https://pypi.org/project/pyedbglib
Dependencies
pydebuggerupgrade depends on pyedbglib for its transport protocol. pyedbglib requires a USB transport library like libusb. See pyedbglib package for more information.
pydebuggerupgrade depend on pyusb for the USB communication with the DFU bootloader of the debugger.
Versioning
pydebuggerupgrade version can be determined using the CLI:
pydebuggerupgrade -V
or using the library:
from pydebuggerupgrade.version import VERSION as pydebuggerupgrade_version
print("pydebuggerupgrade version {}".format(pydebuggerupgrade_version))
In addition, the CLI-backend API is versioned for convenience:
from pydebuggerupgrade.backend import Backend
backend = Backend()
print("pydebuggerupgrade backend API version: {}".format(backend.get_api_version()))
Metadata
Release files for pydebuggerupgrade 3.7.1.60
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pydebuggerupgrade-3.7.1.60-py3-none-any.whl | Python 3 | none | any | Details |
Release files / pydebuggerupgrade-3.7.1.60-py3-none-any.whl
| Download URL | pydebuggerupgrade-3.7.1.60-py3-none-any.whl |
|---|---|
| Size | 49.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f4fe2fe379dfa1793be1b0d4d5680d65d5d062affe8cf7633902319949790419
|
|
BLAKE2b-256 checksum How to use checksums |
8ac466809eb1b94b67a75b8df1f7ab671203a7f3a9c64462ff6ef0994fca584a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.6
|
Security for pydebuggerupgrade 3.7.1.60
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.