pymcuprog package

Subpackages

Submodules

AVR8 target

Device Specific Classes which use AVR8Protocol implementation

class pymcuprog.avr8target.AvrDevice(transport)

Bases: object

Generic AVR device wrapper (maps to avr8 protocol)

activate_physical()

Activate the physical interface

deactivate_physical()

Deactivate the physical interface

enter_progmode()

Enter programming mode

erase(mode=0, address=0)

Erase NVM

Parameters:
  • mode (int) – Flash erase mode to use

  • address (int) – Start address to erase from (not used by some modes)

static is_blank(data)

Checks if a buffer represents “blank” flash

Parameters:

data (bytearray) – Contents to check

Returns:

True if data represents blank flash

Return type:

boolean

leave_progmode()

Leave programming mode

memory_read(memory_name, start_address, numbytes)

Read device memory

Parameters:
  • memory_name (int) – Memory type identifier as defined in the protocol

  • start_address (int) – First address to read

  • numbytes (int) – Number of bytes to read

Returns:

Data read out

Return type:

bytearray

memory_write(memory_name, start_address, data)

Write device memory

Parameters:
  • memory_name (int) – Memory type identifier as defined in the protocol

  • start_address (int) – First address to write

  • data (bytearray) – Data to write

static memtype_read_from_string(memtype_string)

Maps from a string to an avr8 memtype for reads

Parameters:

memtype_string (str) – Friendly name of memory

Returns:

Memory type identifier as defined in the protocol

Return type:

int

read_memory_section(memory_type, start_address, bytes_to_read, read_chunk_size)

Reads a chunked section of memory

Parameters:
  • memory_type (int) – Memory type identifier as defined in the protocol

  • start_address (int) – First address to read

  • bytes_to_read (int) – Number of bytes to read

  • read_chunk_size (int) – Number of bytes in each separate read command to the debugger

write_memory_section(memory_type, start_address, data_to_write, write_chunk_size, allow_blank_skip=False)

Writes a chunked section of memory

Parameters:
  • memory_type (int) – Memory type identifier as defined in the protocol

  • start_address (int) – First address to write to

  • data_to_write (bytearray) – Raw data values to write

  • write_chunk_size (int) – Number of bytes in each separate write command to the debugger

  • allow_blank_skip (boolean) – Allow skipping write of locations with value 0xFF

class pymcuprog.avr8target.MegaAvrJtagTarget(transport)

Bases: AvrDevice

Implements Mega AVR (JTAG) functionality of the AVR8 protocol

setup_config(device_info)

Sets up the device config for a mega AVR device

Parameters:

device_info (dict) – Target device information as returned by deviceinfo.deviceinfo.getdeviceinfo

setup_prog_session()

Sets up a programming session on an Mega AVR (JTAG)

class pymcuprog.avr8target.TinyAvrTarget(transport)

Bases: AvrDevice

Implements Tiny AVR (debugWIRE) functionality of the AVR8 protocol

setup_debug_session()

Sets up a debugging session on an Tiny AVR (debugwire)

class pymcuprog.avr8target.TinyXAvrTarget(transport)

Bases: AvrDevice

Class handling sessions with TinyX AVR targets using the AVR8 generic protocol

activate_physical(use_reset=False, user_interaction_callback=None)

Override function for high-voltage activation for UPDI

Parameters:
  • use_reset (boolean) – Use external reset line during activation (only used for Mega JTAG interface)

  • user_interaction_callback (function) – Callback to be called when user interaction is required, for example when doing UPDI high-voltage activation with user target power toggle. This function could ask the user to toggle power and halt execution waiting for the user to respond (this is default behavior if the callback is None), or if the user is another script it could toggle power automatically and then return.

breakpoint_clear()

Clears the hardware breakpoint

breakpoint_set(address)

Sets the hardware breakpoint

Parameters:

address (int) – Address to break at

execute_instruction(instruction)

Execute an AVR instruction on the core

Parameters:

instruction (int) – Instruction to execute

execute_patch(instructions, flags=0)

Executes an instruction in the AVR core

Parameters:
  • instructions (bytearray) – Instructions to execute

  • flags (int) – Execution flags

static memtype_write_from_string(memtype_string)

Maps from a string to an avr8 memtype for writes

Parameters:

memtype_string (str) – Friendly name of memory

Returns:

Memory type identifier as defined in the protocol

Return type:

int

ocdregfile_read()

Read OCD registers

Returns:

OCD register file

Return type:

bytearray

read_device_id()

Reads the device ID from the part

Returns:

Device ID raw bytes (little endian)

Return type:

bytearray

run_with_power_nap()

Execute run with power-nap enabled. This command is deprecated.

setup_config(device_info)

Sets up the device config for a tinyX AVR device

Parameters:

device_info (dict) – Target device information as returned by deviceinfo.deviceinfo.getdeviceinfo

setup_debug_session(interface=pyedbglib.protocols.avr8protocol.Avr8Protocol.AVR8_PHY_INTF_PDI_1W, khz=100, use_hv=pyedbglib.protocols.avr8protocol.Avr8Protocol.UPDI_HV_NONE)

Sets up a debug session for a tinyX AVR device

Parameters:
  • interface (int) – Physical interface to use

  • khz (int) – Clock speed in kiloHertz / baud in kbps

  • use_hv (int) – Use high-voltage pulse to activate UPDI

setup_prog_session(interface=pyedbglib.protocols.avr8protocol.Avr8Protocol.AVR8_PHY_INTF_PDI_1W, khz=900, use_hv=pyedbglib.protocols.avr8protocol.Avr8Protocol.UPDI_HV_NONE)

Sets up a programming session for a tinyX AVR device

Parameters:
  • interface (int) – Physical interface to use

  • khz (int) – Clock speed in kiloHertz / baud in kbps

  • use_hv (int) – Use high-voltage pulse to activate UPDI

sib_read()

Reads the System Information Block

Returns:

SIB bytes

stack_pointer_read()

Reads the stack pointer

Returns:

Stack pointer

Return type:

bytearray

class pymcuprog.avr8target.XmegaAvrTarget(transport)

Bases: AvrDevice

Implements XMEGA (PDI) functionality of the AVR8 protocol

setup_config(device_info)

Sets up the device config for a XMEGA AVR device

Parameters:

device_info – target device information as returned by deviceinfo.deviceinfo.getdeviceinfo

setup_debug_session()

Sets up a debugging session on an XMEGA AVR

setup_prog_session(interface=pyedbglib.protocols.avr8protocol.Avr8Protocol.AVR8_PHY_INTF_PDI, khz=4000)

Sets up a programming session for a XMEGA AVR device

Parameters:
  • interface – physical interface to use

  • khz – clock speed in kiloHertz

AVR32 target (alpha)

Device Specific Classes which use AVR32Protocol implementation

class pymcuprog.avr32target.Avr32Device(transport, reset_domains=5)

Bases: object

Generic AVR32 device wrapper (maps to avr32 protocol)

activate_physical()

Activate the physical interface

deactivate_physical()

Deactivate the physical interface

setup_prog_session(interface='jtag')

Setup a programming session on AVR32

Parameters:

interface – jtag or awire

SAM target (alpha)

Access to SAM devices via CMSIS-DAP

Transport provided by HID inside pyedbglib

class pymcuprog.samtarget.SamD2xTarget(driver)

Bases: SamTarget

Programmer for SAMD21 and friends

CMD_EAR = 5
CMD_LR = 64
CMD_PBC = 68
CMD_UR = 65
CMD_WAP = 6
CMD_WP = 4
DAP_TRANSFER_IDLE_CYCLES = 0
DAP_TRANSFER_MATCH_RETRY = 0
DAP_TRANSFER_RETRY_COUNT = 250
DSU_ADDRESS = 1090527232
DSU_CHIP_ERASE_TIMEOUT_MS = 3000
DSU_CTRL_OFFSET = 0
DSU_CTRL_STATUS_CE_COMMAND_MASK = 16
DSU_CTRL_STATUS_DONE_MASK = 256
DSU_CTRL_STATUS_PROT_MASK = 65536
DSU_DID_OFFSET = 24
DSU_EXTERNAL_OFFSET = 256
FLASH_LOCK_REGIONS = 16
FLASH_LOCK_REGION_SIZE = 16384
NVM_CTRLB_MANW_BIT = 7
NVM_CTRL_ADDRESS = 1090535424
NVM_CTRL_ADDR_OFFSET = 28
NVM_CTRL_CTRLB_OFFSET = 4
NVM_CTRL_CTRL_OFFSET = 0
NVM_CTRL_INTFLAG_OFFSET = 20
NVM_CTRL_LOCK_OFFSET = 32
NVM_CTRL_STATUS_OFFSET = 24
NVM_INT_ERROR_BIT = 1
NVM_INT_READY_BIT = 0
NVM_STATUS_LOCKE = 3
NVM_STATUS_NVME = 4
NVM_STATUS_PROGE = 2
NVM_STATUS_SB = 8
chip_erase_dsu()

Perform a chip erase using the DSU

connect(clk_hz)

Connect to the DAP and initialise basics

disconnect()

Disconnect from the DAP

erase_user_row(address)

Erase the user row

Parameters:

address – address to erase

is_device_locked()

Checks if the device is locked

is_flash_ready()

Checks if Flash Controller is ready

Returns:

boolean ready state

nvm_command(command)

Write command in NVM controller

Parameters:

command – command to write

post_flash_write()

Wrap up flash write (done once)

pre_flash_write()

Prepare flash for write (done once)

read_device_id()

Read the device ID register

Returns:

Device ID raw bytes (little endian)

read_flash(address, numbytes)

Read flash content

Parameters:
  • address – start byte address to read from

  • numbytes – number of bytes to read

Returns:

array of bytes read

read_user_row(address, numbytes)

Read user row values

Parameters:
  • address – address to read from

  • numbytes – number of bytes to read

Returns:

bytes read

reinitialise()

Re-initialise

Required after certain operations which reset the DAP on the target

set_nvmctrl_address(address)

Set address in NVM controller

Parameters:

address – address to write

unlock_all_regions()

Unlock all regions of flash. This only issues the NVM UR command, and has no effect on for example BOOTPROT locks.

wait_flash_ready(timeout_ms=1000)

Wait for flash to be ready, or timeout

Parameters:

timeout_ms

Returns:

boolean True if flash is ready; False if timeout waiting

write_flash_page(data_buffer, address)

Write a page of flash memory

Parameters:
  • data_buffer – data to write

  • address – address to write to

write_user_row_word(address, value)

Write a word the user row

Parameters:
  • address – address of the user row

  • value – value to write

class pymcuprog.samtarget.SamM4Target(driver)

Bases: SamTarget

SAM M4 targets.

SAM M4 targets are not supported

class pymcuprog.samtarget.SamTarget(driver)

Bases: object

General SAM target interface

ap_read(reg)

Access port read

Parameters:

reg – register to read

Returns:

value read

ap_write(reg, value)

Access Port write

Parameters:
  • reg – register to write

  • value – value to write

dp_read(reg)

Debug Port read

Parameters:

reg – register to read

Returns:

value read

dp_write(reg, value)

Debug Port write

Parameters:
  • reg – register to write

  • value – value to write

read_idcode()

Reads the ID code from the DAP (not device ID)

Backend API (library functions)

Backend interface for the pymcuprog utility.

This module is the boundary between the Command Line Interface (CLI) part and the backend part that does the actual job. Any external utility or script that needs access to the functionality provided by pymcuprog should connect to the interface provided by this backend module

class pymcuprog.backend.Backend

Bases: object

Backend interface of the pymcuprog utility. This class provides access to all the functionality provided by pymcuprog

API_VERSION = '2.0'
connect_to_tool(toolconnection)

Connect to a tool

The tool can either be a USB HID tool or a serial port.

Parameters:

toolconnection (object) –

This is an instance of one of the ToolConnection sub-classes. This object wraps parameters needed to identify which tool to connect to like tool name and USB serial or serial port name (e.g. ‘COM1’).

For USB HID tools there are some special handling:

  • If both tool name and usb_serial are None any tool will be picked.

  • If usb_serial is None any tool matching the tool name will be picked

  • If tool name is None any tool matching the usb_serial will be picked

  • If more than one tool is connected that matches the tool name and usb_serial parameters a

    PymcuprogToolConnectionError exception will be raised.

Raises:
disconnect_from_tool()

Disconnect the connected tool

If no tool is connected nothing is done (i.e. no exception raised when not connected)

end_session()

End a programming session

This will take down the device model stack and stop the programming session on the tool. However the tool will not be disconnected and it will be possible to do another start_session without another connect_to_tool call. If no session has been started this function will do nothing (i.e. it won’t fail even if a session has not been started)

erase(memory_name='all', address=None)

Erase target device memory

If a single memory is specified it will only be erased if it won’t affect other memories

Parameters:
  • memory_name (object (MemoryNameAliases)) –

    Name of memory to erase. To unlock a device use the MemoryNameAliases.ALL MemoryNameAliases.ALL run the widest erase:

    • For PIC the widest bulk erase will be run.

    • For AVR a chip erase will be run

    • The following memories will not be erased:

      • AVR fuses

      • EEPROM if EESAVE fuse is set for AVR

      • EEPROM if the target device does not support EEPROM erase

      • EEPROM if Data Code Protection (CPD_n) is not enabled for PIC

      • PIC ICD memory (special memory used for Debug Executives)

  • address (int) – Optional address for erase command. If address is None the complete memory segment will be erased. Note that the address parameter will just propagate through the stack down to the device dependent implementation (devicesupportscripts for PIC and firmware for AVR). Normal use is to leave the address as None.

Raises:
  • PymcuprogToolConnectionError – if not connected to any tool (connect_to_tool not run)

  • PymcuprogSessionError – if a session has not been started (session_start not run)

  • ValueError – if the specified memory is not defined for the target device

  • PymcuprogEraseError – if the memory can’t be erased or if the memory can’t be erased without affecting other memories

get_api_version()

Returns the current pymcuprog API version

static get_available_hid_tools(serialnumber_substring='', tool_name=None)

Return a list of Microchip USB HID tools (debuggers) connected to the host

Parameters:
  • serialnumber_substring (str) – Can be an empty string or a subset of a serial number. Not case sensitive This function will do matching of the last part of the devices serial numbers to the serialnumber_substring. Examples: ‘123’ will match “MCHP3252000000043123” but not “MCP32520001230000000” ‘’ will match any serial number

  • tool_name (str) – Tool type to connect to. If None any tool matching the serialnumber_substring will be returned

Returns:

List of pyedbglib.hidtransport.hidtransportbase.HidTool objects

get_chiperase_effect(memory_name)

Get the effect of a chip erase (widest bulk erase) on the given memory

Parameters:

memory_name (str) – Name of memory

Returns:

One of the values defined by deviceinfo.eraseflags.ChiperaseEffect depending upon the settings in the device model for the configured device. If the chiperase_effect flag is missing in the device model ChiperaseEffect.NOT_ERASED will be returned.

Return type:

object (ChiperaseEffect)

Raises:

ValueError – if memory is not defined for the configured device

static get_device_info(device)

Get info about a device

Parameters:

device (str) – Name of the device

Returns:

Dictionary with device info as defined in the device files in pymcuprog.deviceinfo.devices

Return type:

dict

Raises:

PymcuprogNotSupportedError – if device is not supported

static get_supported_devices()

Return a list of devices supported by pymcuprog.

This will be the list of devices with a corresponding device file

Returns:

List of device names

Return type:

list

hold_in_reset()

Hold target device in reset

Raises:
is_isolated_erase_possible(memory_name)

Can the memory be erased without affecting other memories?

Parameters:

memory_name (str) – Name of memory

Returns:

True only if the memory can be erased without side effects, False if memory can’t be erased at all or if erasing it will erase other memories too.

Return type:

boolean

Raises:

ValueError – if memory is not defined for the configured device

read_device_id()

Read out the device id

Returns:

Byte array with device ID as raw byte values. Number of bytes will depend upon target type

Return type:

bytearray

Raises:
read_kit_device()

Read out the device name from kit configuration.

If the connected tool does not have any kit configuration (i.e. the tool is not an onboard debugger) None will be returned. connect_to_tool must have been called before calling read_kit_device, but start_session is not necessary. Typically read_kit_device is used to get the device name required to configure a session before calling start_session.

Returns:

Name of target device as given by the kit, None if the tool does not have any device configured.

Return type:

str

Raises:

PymcuprogToolConnectionError – if not connected to any USB HID tool (connect_to_tool not run)

read_memory(memory_name='all', offset_byte=0, numbytes=0)

Read target device memory

Parameters:
  • memory_name (object (MemoryNameAliases)) – Name of memory as defined in memorynames.py. MemoryNameAliases.ALL reads all memories defined in the device model (numbytes and offset_byte will be ignored).

  • offset_byte (int) – Byte offset within memory to start reading at.

  • numbytes (int) – Number of bytes to read. 0 means read all memory locations from offset_byte and until end of memory

Returns:

List of namedtuples with two fields: data and memory_info. data contains a byte array of raw data bytes and memory_info is a dictionary with memory information (as defined in deviceinfo.deviceinfo.DeviceMemoryInfo). Normally the list will contain one item, but when memory_name parameter is MemoryNameAliases.ALL there will be one namedtuple item per memory type read.

Return type:

list of namedtuple

Raises:
  • PymcuprogToolConnectionError – if not connected to any tool (connect_to_tool not run)

  • PymcuprogSessionError – if a session has not been started (session_start not run)

  • ValueError – if trying to read outside the specified memory

  • ValueError – if the specified memory is not defined for the target device

read_supply_voltage_setpoint()

Read tool power supply voltage setpoint

Returns:

Tool power supply voltage setpoint

Return type:

float

Raises:
read_target_voltage()

Read target voltage

Returns:

Measured target voltage

Return type:

float

Raises:
read_tool_info()

Interrogates tool (debugger) for useful info

Returns:

Dictionary with various info about the connected debugger

Return type:

dict

Raises:

PymcuprogToolConnectionError – if not connected to any USB HID tool (connect_to_tool not run)

read_usb_voltage()

Read USB voltage

Returns:

Measured USB voltage

Return type:

float

Raises:
reboot_tool()

Trigger a reboot of the tool (debugger)

Raises:

PymcuprogToolConnectionError – if not connected to any tool (connect_to_tool not run)

release_from_reset()

Release target device from reset

Raises:
set_supply_voltage_setpoint(setpoint)

Set tool power supply voltage setpoint

Parameters:

setpoint (float or int) – Power supply setpoint

Raises:
start_session(sessionconfig, user_interaction_callback=None)

Start a programming session.

This function will build the device model stack and initialize the tool for a programming session. If a session is already started calling start_session will do an end_session and start a new session from scratch.

Note connect_to_tool must have been called before start_session is called. If not an exception will be thrown.

Parameters:
  • sessionconfig (object) – SessionConfig object wrapping the parameters configuring the session

  • user_interaction_callback (function) – Callback to be called when user interaction is required, for example when doing UPDI high-voltage activation with user target power toggle. This function could ask the user to toggle power and halt execution waiting for the user to respond (this is default behavior if the callback is None), or if the user is another script it could toggle power automatically and then return.

Raises:
verify_hex(hexfile)

Verify target memory content against hexfile

Parameters:

hexfile (str) – Name of file to verify against

Returns:

True if contents match

Return type:

boolean

Raises:
verify_memory(data, memory_name='flash', offset_byte=0)

Verify target device memory

Parameters:
  • memory_name (str) – Name of memory as defined in DeviceMemoryInfo (deviceinfo.py)

  • offset_byte (int) – Byte offset within memory to start verifying at.

  • data (bytearray) – Raw data bytes to verify against

Returns:

True if contents match

Return type:

boolean

Raises:
  • PymcuprogToolConnectionError – if not connected to any tool (connect_to_tool not run)

  • PymcuprogSessionError – if a session has not been started (session_start not run)

  • ValueError – if trying to verify outside the specified memory

  • ValueError – if the specified memory is not defined for the target device

write_hex_to_target(hexfile)

Write hexfile to target device

Note no erase will be run (i.e. memory is assumed to already be erased)

Parameters:

hexfile (str) – Name of file to write

write_memory(data, memory_name='flash', offset_byte=0)

Write target device memory

Parameters:
  • memory_name (str) – Name of memory as defined in memorynames.py

  • offset_byte (int) – Byte offset within memory to start writing to.

  • data (bytearray) – Raw data bytes to write

Raises:
  • PymcuprogToolConnectionError – if not connected to any tool (connect_to_tool not run)

  • PymcuprogSessionError – if a session has not been started (session_start not run)

  • ValueError – if trying to write outside the specified memory

  • ValueError – if the specified memory is not defined for the target device

class pymcuprog.backend.SessionConfig(device)

Bases: object

Collection of all parameters needed when configuring a programming session

Used as input parameter for the start_session function

device = None
interface = None
interface_speed = None
packpath = None
special_options = None

Programmer API

Python MCU programmer

class pymcuprog.programmer.Programmer(transport)

Bases: object

Main programmer class.

erase(memory_name, address)

Erase the device

Parameters:
  • memory_name (object (MemoryNameAliases)) – Memory region to erase as defined in deviceinfo.memorynames MemoryNameAliases.ALL will run the widest erase (e.g. chip erase on AVR or the widest bulk erase on PIC)

  • address (int) – Address to erase

get_device_memory_info()

Exposes the device memory model to clients

get_device_model()

Exposes the device model in use to clients

hold_in_reset()

Hold the device in reset

load_device(device_name)

Loads the device from the device folder

Parameters:

device_name (str) – Name of device to be used

Raises:

PymcuprogNotSupportedError – if device is not supported

read_device_id()

Read the device ID

Returns:

Device ID raw bytes (little endian)

Return type:

bytearray

read_memory(memory_name, offset, numbytes=0)

Read device memory

Parameters:
  • memory_name (object (MemoryNameAliases)) – Memory type to read as defined in deviceinfo.memorynames MemoryNameAliases.ALL will read all memories defined in the device model for the configured device (numbytes and offset will be ignored)

  • offset (int) – Offset/start address within the memory to start reading from

  • numbytes (int) – Number of bytes to read. 0 means read all memory locations for given memory type (offset still applies)

Returns:

List of namedtuples with two fields: data and memory_info. data contains a byte array of raw data bytes and memory_info is a dictionary with memory information as defined in deviceinfo.deviceinfo.DeviceMemoryInfo. Normally the list will contain one item, but when memory_name parameter is MemoryNameAliases.ALL there will be one namedtuple item per memory type read.

Return type:

list of namedtuple

Raises:
  • ValueError – if trying to read outside the specified memory

  • ValueError – if the specified memory is not defined for the target device

release_from_reset()

Release the device from reset (i.e. let the device run)

set_options(options)

Stores options

Parameters:

options (dict) – Options to store

setup_device(interface=None, packpath=None, clk=None)

Sets up a programming session with a given device

Parameters:
  • interface (str) – Physical interface to use

  • packpath (str) – Path to packs to use (for PIC)

  • clk (int) – Clock frequency or baud rate to use

Raises:

SerialException – if unable to connect to serial port (if using serial port instead of physical debugger)

start(user_interaction_callback=None)

Starts the programming session with the device model

Parameters:

user_interaction_callback (function) – Callback to be called when user interaction is required, for example when doing UPDI high-voltage activation with user target power toggle. This function could ask the user to toggle power and halt execution waiting for the user to respond (this is default behavior if the callback is None), or if the user is another script it could toggle power automatically and then return.

stop()

Stops the programming session with the device model

verify_memory(data, memory_name, offset=0)

Verify memory content

Parameters:
  • data (bytearray) – Data to verify against

  • memory_name (str) – Memory type

  • offset (int) – Offset/address within that memory region

Returns:

True if contents match

Return type:

boolean

write_memory(data, memory_name, offset=0)

Write memory on the device

Parameters:
  • data (bytearray) – Data to write

  • memory_name (str) – Memory type to write

  • offset (int) – Offset/address within that region to write

Returns:

Boolean status

Return type:

boolean

Raises:
  • ValueError – if trying to write outside the specified memory

  • ValueError – if the specified memory is not defined for the target device

  • PymcuprogNotSupportedError – if memory can’t be written

AVR debugger API (alpha)

Python AVR MCU debugger

class pymcuprog.avrdebugger.AvrDebugger(transport, use_events_for_run_stop_state=True)

Bases: object

AVR debugger wrapper

Parameters:
  • transport (object(hid_transport)) – transport object to communicate through

  • use_events_for_run_stop_state (boolean) – True to use HID event channel, False to polling

attach(do_break=False)

Attach to the AVR core

Parameters:

do_break (bool) – set to True to force the core to stop during attach

detach()

Detach from the AVR core

eeprom_read(address, numbytes)

Read EEPROM content from the AVR

Parameters:
  • address – absolute address to start reading from

  • numbytes – number of bytes to read

eeprom_write(address, data)

Write EEPROM content to the AVR

Parameters:
  • address – absolute address in EEPROM to start writing

  • data – content to store to EEPROM

flash_read(address, numbytes)

Read flash content from the AVR

Parameters:
  • address – absolute address to start reading from

  • numbytes – number of bytes to read

flush_events()

Flushes all incoming events before or after a session

hardware_breakpoint_clear()

Clears the hardware breakpoint in the AVR OCD

hardware_breakpoint_set(address)

Sets a hardware breakpoint in the AVR OCD

Parameters:

address – byte address to set hardware breakpoint

poll_event()

Poll for events from the debugger Events are used to signal AVR core transitions from RUN mode to STOPPED mode

program_counter_read()

Reads the program counter register from the AVR

Returns:

PC value as word address

program_counter_write(program_counter)

Write a new program counter value (word) to the AVR

Parameters:

program_counter – new PC value to write (word address)

register_file_read()

Reads out the AVR register file (R0::R31)

Returns:

32 bytes of register file content as bytearray

register_file_write(regs)

Writes the AVR register file (R0::R31)

Parameters:

data – 32 byte register file content as bytearray

Raises:

ValueError – if 32 bytes are not given

reset()

Reset the AVR core. The PC will point to the first instruction to be executed.

run()

Put the AVR core into run mode

run_to(address)

Insert a breakpoint at the given address and put the core into run mode Does not wait for the address to be reached

Parameters:

address – byte address of the instruction to break at

setup_session(device, frequency=900000, options='')

Sets up the device for a debug session

Parameters:
  • device – name of the device to debug

  • frequency (int) – UPDI clock frequency in Hz

  • options (dict) – dictionary of options for starting the session

software_breakpoint_clear(address)

Clears a software breakpoint in the AVR flash and restores the original instruction

Parameters:

address – byte address to remove software breakpoint

software_breakpoint_clear_all()

Removes all software breakpoints immediately and restores flash to its original content

software_breakpoint_set(address)

Sets a software breakpoint in the AVR flash

Parameters:

address – byte address to set software breakpoint

sram_read(address, numbytes)

Read SRAM content from the AVR

Parameters:
  • address – absolute address to start reading from

  • numbytes – number of bytes to read

sram_write(address, data)

Write SRAM content to the AVR

Parameters:
  • address – absolute address in SRAM to start writing

  • data – content to store to SRAM

stack_pointer_read()

Reads the stack pointer

Returns:

Stack pointer

Return type:

bytearray

start_debugging(flash_data=None)

Start the debug session

Parameters:

flash_data – flash data content to program in before debugging

status_register_read()

Reads the status register from the AVR

Returns:

8-bit SREG value

step()

Single-step on protocol level Executes a single AVR instruction, regardless of number of cycles

stop()

Request the AVR core to halt and wait for it to enter stopped state

stop_debugging()

Stop the debug session and clean up

NVM Access (implementations)

NVM layer protocols

class pymcuprog.nvm.NvmAccessProvider(device_info)

Bases: object

Wrapper for device info

hold_in_reset()

Hold target in reset

release_from_reset()

Release target from reset

start(user_interaction_callback=None)

Start (activate) session

Parameters:

user_interaction_callback – Callback to be called when user interaction is required, for example when doing UPDI high-voltage activation with user target power toggle. This function could ask the user to toggle power and halt execution waiting for the user to respond (this is default behavior if the callback is None), or if the user is another script it could toggle power automatically and then return.

stop()

Stop (deactivate) session

class pymcuprog.nvm.NvmAccessProviderCmsisDapAvr(device_info)

Bases: NvmAccessProviderCmsisDapTool

AVR CMSIS DAP Tool

class pymcuprog.nvm.NvmAccessProviderCmsisDapTool(device_info)

Bases: NvmAccessProvider

General CMSIS-DAP Tool

pymcuprog.nvm.get_nvm_access_provider(transport, device_info, interface='', packpath=None, frequency=None, options='')

Returns an NVM provider with the requested properties

Parameters:
  • transport – Transport layer object

  • device_info – Device info dict

  • interface – Physical interface for NVM

  • packpath – Path to pack

  • frequency – Interface clock

  • options – Special options

Returns:

NVM access object

NVM implementation: UPDI

UPDI NVM implementation

class pymcuprog.nvmupdi.NvmAccessProviderCmsisDapUpdi(transport, device_info, frequency=None, options='')

Bases: NvmAccessProviderCmsisDapAvr

NVM Access for AVR UPDI devices

erase(memory_info=None, address=None)

Erase device, or parts of it

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class. If memory_info is None a chip_erase will be run

  • address – address info for erase (optional)

hold_in_reset()

Hold device in reset

read(memory_info, offset, numbytes)

Read the memory in chunks

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset in the memory type

  • numbytes – number of bytes to read

Returns:

array of bytes read

read_device_id()

Read the device info

Returns:

Device ID raw bytes (little endian)

Raises:

PymcuprogSessionError – if device ID does not match

release_from_reset()

Release device from reset

start(user_interaction_callback=None)

Start (activate) session for UPDI targets

Parameters:

user_interaction_callback – Callback to be called when user interaction is required, for example when doing UPDI high-voltage activation with user target power toggle. This function could ask the user to toggle power and halt execution waiting for the user to respond (this is default behavior if the callback is None), or if the user is another script it could toggle power automatically and then return.

stop()

Stop (deactivate) session for UPDI targets

write(memory_info, offset, data)

Write the memory with data

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset within the memory type

  • data – the data to program

NVM implementation: serialUPDI

pyupdi-esque NVM implementation

class pymcuprog.nvmserialupdi.Dut(dev_info)

Bases: object

Create a device object for UpdiApplication

class pymcuprog.nvmserialupdi.NvmAccessProviderSerial(transport, device_info, options='')

Bases: NvmAccessProvider

NVM Access the Python AVR way

erase(memory_info=None, address=None)

Do a chip erase of the device

hold_in_reset()

Hold device in reset

read(memory_info, offset, numbytes)

Read the memory in chunks

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset in the memory type

  • numbytes – number of bytes to read

Returns:

array of bytes read

read_device_id()

Read and display (log) the device info

Returns:

Device ID raw bytes (little endian)

Raises:

PymcuprogSessionError – if device ID does not match

release_from_reset()

Release device from reset

start(user_interaction_callback=None)

Start (activate) session for UPDI serial targets

stop()

Stop the debugging session

write(memory_info, offset, data)

Write the memory with data

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset within the memory type

  • data – the data to program

NVM implementation: PIC

PIC NVM implementation

class pymcuprog.nvmpic.NvmAccessProviderCmsisDapPic(transport, device_info, packpath, options='')

Bases: NvmAccessProviderCmsisDapTool

NVM access the PIC way

erase(memory_info=None, address=None)

Erase the device or parts of it.

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class If memory_info is None the default bulk erase will be run

  • address – address info for erase (optional)

hold_in_reset()

Hold the device in reset

read(memory_info, offset, numbytes)

Read the memory

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset in the memory type

  • numbytes – number of bytes to read

Returns:

array of bytes read

read_device_id()

Get the device info from the device

Returns:

Device ID raw bytes (little endian)

release_from_reset()

Release the device from reset

stop()

Stop programming session

write(memory_info, offset, data)

Write the memory with data

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset within the memory type

  • data – the data to program

NVM implementation: SAM M0+ (alpha)

M0+ NVM implementation

class pymcuprog.nvmmzeroplus.NvmAccessProviderCmsisDapMZeroPlus(transport, device_info, frequency=None)

Bases: NvmAccessProviderCmsisDapTool

SAMD programmer

erase(memory_info=None, address=None)

Do an erase of the device

read(memory_info, offset, numbytes)

Read the memory in chunks

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset in the memory type

  • numbytes – number of bytes to read

Returns:

array of bytes read

read_device_id()

Read out the DAP ID and Device ID

Returns:

Device ID raw bytes (little endian)

stop()

Stop programming session

write(memory_info, offset, data)

Write the memory with data

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset within the memory type

  • data – the data to program

NVM implementation: debugWIRE (alpha)

DebugWIRE NVM implementation NB: This is a stub - not all features are implemented

class pymcuprog.nvmdebugwire.NvmAccessProviderCmsisDapDebugwire(transport, device_info)

Bases: NvmAccessProviderCmsisDapAvr

NVM Access the DW way

erase(memory_info=None, address=None)

Do a chip erase of the device

static read(memory_info, offset, numbytes)

Read the memory in chunks

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset in the memory type

  • numbytes – number of bytes to read

Returns:

array of bytes read

read_device_id()

Read the device info

Returns:

Device ID raw bytes (little endian)

static write(memory_info, offset, data)

Write the memory with data

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset within the memory type

  • data – the data to program

NVM implementation: SPI (alpha)

SPI NVM implementation NB: This is a stub - not all features are implemented.

class pymcuprog.nvmspi.NvmAccessProviderCmsisDapSpi(transport, device_info)

Bases: NvmAccessProviderCmsisDapAvr

NVM Access the SPI way

erase(memory_info=None, address=None)

Do a chip erase of the device

hold_in_reset()

Hold device in reset

read(memory_info, offset, numbytes)

Read the memory in chunks

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset in the memory type

  • numbytes – number of bytes to read

Returns:

array of bytes read

read_device_id()

Read the device info

Returns:

Device ID raw bytes (little endian)

release_from_reset()

Release device from reset

stop()

Stop programming session

write(memory_info, offset, data)

Write the memory with data

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset within the memory type

  • data – the data to program

NVM implementation: TPI (alpha)

TPI/tinytiny NVM implementation NB: This is a stub - not all features are implemented

class pymcuprog.nvmtpi.NvmAccessProviderCmsisDapTpi(transport, device_info)

Bases: NvmAccessProviderCmsisDapAvr

NVM Access the TPI way

erase(memory_info=None, address=None)

Do a chip erase of the device

read(memory_info, offset, numbytes)

Read the memory in chunks

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset in the memory type

  • numbytes – number of bytes to read

Returns:

array of bytes read

read_device_id()

Read the device ID

Returns:

Device ID raw bytes (little endian)

stop()

Stop programming session

static write(memory_info, offset, data)

Write the memory with data

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset within the memory type

  • data – the data to program

NVM implementation: megaAVR (JTAG) - (alpha)

AVR mega JTAG NVM implementation NB: This is a stub - not all features are implemented

class pymcuprog.nvmmegaavrjtag.NvmAccessProviderCmsisDapMegaAvrJtag(transport, device_info)

Bases: NvmAccessProviderCmsisDapAvr

NVM Access the megaJTAG way

erase(memory_info=None, address=None)

Do a chip erase of the device

read(memory_info, offset, numbytes)

Read the memory in chunks

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset in the memory type

  • numbytes – number of bytes to read

Returns:

array of bytes read

read_device_id()

Read the device info

Returns:

Device ID raw bytes (little endian)

start(user_interaction_callback=None)

Start (activate) session for megaJTAG targets

stop()

Stop (deactivate) session for megaJTAG targets

static write(memory_info, offset, data)

Write the memory with data

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset within the memory type

  • data – the data to program

NVM implementation: XMEGA (alpha)

XMEGA NVM implementation NB: This is a stub - not all features are implemented

class pymcuprog.nvmxmega.NvmAccessProviderCmsisDapXmega(transport, device_info)

Bases: NvmAccessProviderCmsisDapAvr

NVM Access the Xmega way

erase(memory_info=None, address=None)

Do a chip erase of the device

static read(memory_info, offset, numbytes)

Read the memory in chunks

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset in the memory type

  • numbytes – number of bytes to read

Returns:

array of bytes read

read_device_id()

Read the device info

Returns:

Device ID raw bytes (little endian)

start(user_interaction_callback=None)

Start (activate) session for XMEGA targets

stop()

Stop (deactivate) session for XMEGA targets

static write(memory_info, offset, data)

Write the memory with data

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset within the memory type

  • data – the data to program

NVM implementation: AVR32 (alpha)

AVR32 NVM implementation NB: This is a stub - not all features are implemented

class pymcuprog.nvmavr32.NvmAccessProviderCmsisDapAvr32(transport, device_info, interface='jtag')

Bases: NvmAccessProviderCmsisDapAvr

AVR32 programmer

abstract erase(memory_info=None, address=None)

Do an erase of the device

abstract read(memory_info, offset, numbytes)

Read the memory in chunks

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset in the memory type

  • numbytes – number of bytes to read

Returns:

array of bytes read

read_device_id()

Read the device info

Returns:

Device ID raw bytes (little endian)

stop()

Stop programming session

abstract write(memory_info, offset, data)

Write the memory with data

Parameters:
  • memory_info – dictionary for the memory as provided by the DeviceMemoryInfo class

  • offset – relative offset within the memory type

  • data – the data to program

Utilities

Utility functions for pymcuprog

pymcuprog.utils.compare(data0, data1, offset, verify_mask=None)

Compares the two byte arrays

Parameters:
  • data0 – first array for compare

  • data1 – second array for compare

  • offset – address offset in the memory area, for printing

  • verify_mask – compare mask (for varying instruction width)

pymcuprog.utils.enum(**enums)

Emulates an Enum type

Needed for Python 2.7 compatibility as Python did not get built-in support for enums until version 3.4

pymcuprog.utils.pad_to_size(memory_block, chunk_size, pad_value)

Pads a chunk of memory

pymcuprog.utils.pagealign(data, address, page_size, data_size=1)

Aligns data to the start of a page

pymcuprog.utils.print_tool_info(info)

Print out various tool information

Parameters:

info – Dictionary with various tool info as returned from read_tool_info()

pymcuprog.utils.read_supply_voltage_setpoint(housekeeper)

Read supply setpoint

Parameters:

housekeeper – instance of pyedbglib.protocols.housekeepingprotocol.Jtagice3HousekeepingProtocol

pymcuprog.utils.read_target_voltage(housekeeper)

Read target voltage

Parameters:

housekeeper – instance of pyedbglib.protocols.housekeepingprotocol.Jtagice3HousekeepingProtocol

pymcuprog.utils.read_tool_info(housekeeper)

Interrogates tool (debugger) for useful info

Returns:

Dictionary with various info about the connected debugger

pymcuprog.utils.read_usb_voltage(housekeeper)

Read USB voltage

Parameters:

housekeeper – instance of pyedbglib.protocols.housekeepingprotocol.Jtagice3HousekeepingProtocol

pymcuprog.utils.read_voltage_parameter(housekeeper, offset)

Generic read voltage from tool parameter

Parameters:
  • housekeeper – Instance of pyedbglib.protocols.housekeepingprotocol.Jtagice3HousekeepingProtocol

  • offset – Tool parameter offset to read

pymcuprog.utils.set_supply_voltage_setpoint(housekeeper, voltage)

Set supply setpoint

Parameters:
  • housekeeper – Instance of pyedbglib.protocols.housekeepingprotocol.Jtagice3HousekeepingProtocol

  • voltage – New setpoint for target supply

pymcuprog.utils.showdata(data, address=0, page_size=None, line_wrap=16, phantom_bytes=0)

Show (print) the data

Parameters:
  • data – an array/list of data to show

  • address – byte address to data

  • page_size – page size in bytes

  • line_wrap – how many bytes to print per line

  • phantom_bytes – number of phantom bytes to be added per data byte Phantom bytes will show up as xx in the output

pymcuprog.utils.verify_from_bin(bin_filename, backend, offset=0, memory_name='flash')

Verify the contents of flash against a bin-file

Parameters:
  • filename – Name/path of bin-file to verify

  • backend – Reference the Backend class of pymcuprog

  • offset – Memory offset to start verify from

  • memory_name – Name of memory as defined in DeviceMemoryInfo (deviceinfo.py)

Returns:

Boolean value indicating success or failure of the operation

Hex file utilities

Module providing read and write functionality towards hex files with data intended for target device memories

pymcuprog.hexfileutils.read_memories_from_hex(filename, device_memory_info)

Read the content of a hexfile

Parameters:
  • filename – Name/path of hex file to read from

  • device_memory_info – DeviceMemoryInfo instance for the device the hex file is intended for

Returns:

list of namedtuples with three fields: data, offset and memory_info. data contains a byte array of raw data bytes, offset is the start address within the memory the data starts at and memory_info is a dictionary with the memory info as defined in pymcuprog.deviceinfo.deviceinfo

pymcuprog.hexfileutils.remove_phantom_bytes(data)

Remove every 2nd byte from the data

pymcuprog.hexfileutils.write_memories_to_hex(filename, memory_segments)

Write a collection of memory segments to a hex file

Each segment will be written from relative offset 0 (i.e. start of each memory segment)

Parameters:
  • filename – Name/path of hex file to write to

  • memory_segments – list of namedtuples with two fields: data and memory_info. data contains a byte array of raw data bytes and memory_info is a dictionary with memory information as defined in deviceinfo.deviceinfo.DeviceMemoryInfo.

pymcuprog.hexfileutils.write_memory_to_hex(filename, memory_segment, offset)

Write one memory segment to a hex file with data starting at relative offset given by offset parameter.

Parameters:
  • filename – Name/path of hex file to write to

  • memory_segment – namedtuple with two fields: data and memory_info. data contains a byte array of raw data bytes and memory_info is a dictionary with memory information as defined in deviceinfo.deviceinfo.DeviceMemoryInfo).

  • offset – Relative offset for the data within the memory segment

Tool connections

This module includes wrapper classes for Tool connection parameters

class pymcuprog.toolconnection.ToolConnection

Bases: object

Base class for ToolConnection classes used to wrap configuration parameters for tool connections

class pymcuprog.toolconnection.ToolSerialConnection(serialport='COM1', baudrate=115200, timeout=None)

Bases: ToolConnection

Helper class wrapping configuration parameters for a connection to a serial port

serialport = None
class pymcuprog.toolconnection.ToolUsbHidConnection(serialnumber=None, tool_name=None)

Bases: ToolConnection

Helper class wrapping configuration parameters for a connection to a USB HID tool

serialnumber = None
tool_name = None

pymcuprog errors

Pymcuprog specific exceptions

exception pymcuprog.pymcuprog_errors.PymcuprogDeviceLockedError(msg=None, code=0)

Bases: PymcuprogError

Signals that the device is locked and a chip erase is required to unlock it

exception pymcuprog.pymcuprog_errors.PymcuprogEraseError(msg=None, code=0)

Bases: PymcuprogError

Signals that an erase can’t be executed

Either the erase is not possible or the erase can’t be executed without side effects, i.e. erasing more memories than requested

exception pymcuprog.pymcuprog_errors.PymcuprogError(msg=None, code=0)

Bases: Exception

Base class for all Pymcuprog specific exceptions

exception pymcuprog.pymcuprog_errors.PymcuprogNotSupportedError(msg=None, code=0)

Bases: PymcuprogError

Signals that an attempted operation is not supported

exception pymcuprog.pymcuprog_errors.PymcuprogSerialUpdiError(msg=None, code=0)

Bases: PymcuprogError

Error class for SerialUPDI (pyupdi)

exception pymcuprog.pymcuprog_errors.PymcuprogSerialUpdiLockedError(msg=None, code=0)

Bases: PymcuprogSerialUpdiError

The device is locked

exception pymcuprog.pymcuprog_errors.PymcuprogSerialUpdiNvmError(msg=None, code=0)

Bases: PymcuprogSerialUpdiError

An NVM CTRL error condition occurred

exception pymcuprog.pymcuprog_errors.PymcuprogSerialUpdiNvmTimeout(msg=None, code=0)

Bases: PymcuprogSerialUpdiError

A timeout occurred waiting for NVM to be ready

exception pymcuprog.pymcuprog_errors.PymcuprogSerialUpdiProtocolError(msg=None, code=0)

Bases: PymcuprogSerialUpdiError

An UPDI protocol error occurred. This usually indicates an error in the code.

exception pymcuprog.pymcuprog_errors.PymcuprogSessionConfigError(msg=None, code=0)

Bases: PymcuprogError

Signals that a session is not configured correctly

exception pymcuprog.pymcuprog_errors.PymcuprogSessionError(msg=None, code=0)

Bases: PymcuprogError

Signals that a session is not active

exception pymcuprog.pymcuprog_errors.PymcuprogTargetVoltageError(msg=None, code=0)

Bases: PymcuprogError

Signals that the target voltage is out of spec

exception pymcuprog.pymcuprog_errors.PymcuprogToolConfigurationError(msg=None, code=0)

Bases: PymcuprogError

Signals that a tool was incorrectly configured

exception pymcuprog.pymcuprog_errors.PymcuprogToolConnectionError(msg=None, code=0)

Bases: PymcuprogError

Signals that an attempted connect failed

Module contents

Python MCU programmer utility

pymcuprog is a utility for programming various Microchip MCU devices using Microchip CMSIS-DAP based debuggers

Overview

pymcuprog is available:

Command-line interface usage

For using pymcuprog as a CLI, see help.md (https://github.com/microchip-pic-avr-tools/pymcuprog/blob/main/help.md)

Library usage

pymcuprog can be used as a library using its backend API. For example:

# Setup logging - pymcuprog uses the Python logging module
import logging
logging.basicConfig(format="%(levelname)s: %(message)s", level=logging.WARNING)

# Configure the session:
from pymcuprog.backend import SessionConfig
sessionconfig = SessionConfig("atmega4808")

# Instantiate USB transport (only 1 tool connected)
from pymcuprog.toolconnection import ToolUsbHidConnection
transport = ToolUsbHidConnection()

# Instantiate backend
from pymcuprog.backend import Backend
backend = Backend()

# Connect to tool using transport
backend.connect_to_tool(transport)

# Start the session
backend.start_session(sessionconfig)

# Read the target device_id
device_id = backend.read_device_id()
print ("Device ID is {0:06X}".format(int.from_bytes(d, byteorder="little")))

# Print the pymcuprog package version:
from pymcuprog import __version__ as pymcuprog_version
print("pymcuprog version {}".format(pymcuprog_version))

# In addition, the CLI-backend API is versioned for convenience:
print("pymcuprog backend API version: {}".format(backend.get_api_version()))

Logging

This package uses the Python logging module for publishing log messages to library users. A basic configuration can be used (see example), but for best results a more thorough configuration is recommended in order to control the verbosity of output from dependencies in the stack which also use logging. See logging.yaml which is included in the package (although only used for CLI)

Dependencies

pymcuprog depends on pyedbglib for its transport protocol. pyedbglib requires a USB transport library like libusb. See pyedbglib package for more information.

Supported devices and tools

Note: pymcuprog is primarily intended for use with PKOB nano (nEDBG) debuggers which are found on Curiosity Nano kits and other development boards. This means that it is continuously tested with a selection of AVR devices with UPDI interface as well as a selection of PIC devices. However since the protocol is compatible between all EDBG-based debuggers (pyedbglib) it is possible to use pymcuprog with a wide range of debuggers and devices, although not all device families/interfaces have been implemented.

The following Atmel/Microchip debuggers are supported:
  • PKOB nano (nEDBG)

  • MPLAB PICkit 4 ICD (only when in ‘AVR mode’)

  • MPLAB Snap ICD (only when in ‘AVR mode’)

  • Atmel-ICE

  • Power Debugger

  • EDBG

  • mEDBG

  • JTAGICE3 (only firmware version 3.x)

Although not all functionality is provided on all debuggers/boards. See device support section below.

The following device-types are supported:
  • All AVR UPDI devices, whether mounted on kits or standalone

  • PIC devices mounted on Curiosity Nano kits, or similar board with PKOB nano (nEDBG) debugger

  • Other devices (eg ATmega328P, ATsamd21e18a) may be partially supported for experimental purposes