Pycmsisdapswitcher Utility

Last modified by Microchip on 2025/05/09 05:48

What is pycmsisdapswitcher?

pycmsisdapswitcher is a command-line-based Python® utility that switches the firmware on various Microchip tools between the Microchip implementation and the Arm® CMSIS-DAP v2 implementation. This enables customers who use third-party Integrated Development Environments (IDEs) that support CMSIS-DAP v2 to use Microchip tools.

List of Supported Tools

  • MPLAB® PICkit™ Basic
  • Curiosity Ultra Development Boards

Limitations

Only one MPLAB PICkit Basic tool or evaluation board/kit can be supported at a time.

Installation via pypi

 pip install pycmsisdapswitcher 

Usage

pycmsisdapswitcher target --source=<firmware source> --fwtype=<firmware type> --version --help
  • target: Either the tool name or the kit name.
    • Currently supported values:
      • picktibasic
      • evalboard

Optional Arguments

  • -h ~-~-help: Shows the command line help
  • ~-~-version: Shows the pycmsisdapswitcher version
  • ~-~-source: Specifies the source of the firmware (default: server)
    • Currently supported values:
      • server: (default) latest firmware downloaded from Microchip tool packs public server
      • firmware file name with relative or absolute path
      • cache: firmware retrieved from a user directory, created and updated from server usage
  • ~-~-fwtype: Specifies the firmware type (default: cmsis)
    • Currently supported values:
      • mplab: Microchip implementation
      • cmsis: Arm CMSIS-DAP v2 implementation

Back to Top

Usage Examples

  • pycmsisdapswitcher pickitbasic
    • Switches the MPLAB PICkit Basic firmware to the latest CMSIS-DAP v2 implementation using the Microchip server
  • pycmsisdapswitcher pickitbasic ~-~-source=pickit_basic_app.hex
    • Switches the MPLAB PICkit Basic firmware to the one in the pickit_basic_app.hex file
  • pycmsisdapswitcher pickitbasic ~-~-source=cache ~-~-fwtype=mplab
    • Switches the MPLAB PICkit Basic firmware to the Microchip implementation available in the cache

Note for Linux® Users

USB devices need udev rules to be added to a .rules file in /etc/udev/rules.d.

Example: File pycmsisdapswitcher.rules content

# PICkit Basic (bootloader)
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="9057", MODE="0666"
# PICkit Basic (app,  vendor)
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="9054", MODE="0666"
# PICkit Basic (app,  vendor + CDC)
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="9055", MODE="0666"
# PICkit Basic (app,  vendor + CDC + vendor)
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="9056", MODE="0666"
# PICkit Basic (cmsis2, vendor)
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="90ab", MODE="0666"
# PICkit Basic (cmsis2,  vendor + CDC)
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="90ac", MODE="0666"
# PICkit Basic (cmsis2,  vendor + CDC + DGI)
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="90ad", MODE="0666"
# PICkit Basic (cmsis2,  vendor + CDC + DGI + MSD)
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="90ae", MODE="0666"

# Eval board (bootloader)
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="810a", MODE="0666"
# Eval board (app)
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="8109", MODE="0666"
# Eval board (app, vendor + CDC)
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="810b", MODE="0666"
# Eval board (app, vendor + MSD)
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="810c", MODE="0666"
# Eval board (app, vendor + CDC + DGI)
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="810d", MODE="0666"
# Eval board (cmsis2, vendor)
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="904a", MODE="0666"
# Eval board (cmsis2, vendor + CDC)
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="904b", MODE="0666"
# Eval board (cmsis2, vendor + CDC + DGI)
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="904c", MODE="0666"
# Eval board (cmsis2, vendor + CDC + DGI + MSD)
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="904d", MODE="0666"  

Note for Windows® Users

The following is an example of an error message:

The device has no langid (permission issue, no string descriptors supported or device error)

If the output shows such an error message, double-check in the Device Manager that the target (MPLAB PICkit Basic or evaluation board) has been bound to WinUSB. If it has not, you can manually bind the target to WinUSB by using either Zadig or the Microchip USB installer.

Back to Top