Loaders

Loaders represent the interface for loading the test firmware onto the target platform. All loaders conform to the interface and can be extended to include customer loaders if needed to integrate into the cli tool.

Pyetta provides a set of built-in loaders for common scenarios.

class pyetta.loaders.Loader
abstract load_to_device(progress: Optional[Callable[[int], None]] = None) None

Loads the target data into the device. Optionally can report progress to a callback if one is given.

Parameters

progress – Callback to allow progress to be reported. Callback should take in a single int representing the percentage completion [0-100].

abstract reset_device() None

Resets the device. This can be either a software or hardware reset depending on the implementation. The expected result of this reset is that all internal states of the device are reset into their default values on startup.

abstract start_program() None

Starts the loaded program from the beginning. Each subsequent run of the program should have its state unaffected by previous run.

Implementations

The pyetta library comes with some default loaders for use to upload test runners to devices.

class pyetta.loaders.PyOCDDeviceLoader(firmware_path: pathlib.Path, target: Optional[str] = None, probe: Optional[str] = None)

Bases: pyetta.loaders.Loader

Basic built-in pyOCD loader with minimal configurations. Superclass this if you need to override the calls with extra functions.

__init__(firmware_path: pathlib.Path, target: Optional[str] = None, probe: Optional[str] = None)