Skip to content

Repository files navigation

Harp Toolkit

Tool for inspecting, updating and interfacing with Harp devices, with automatic firmware and interface code generation.

Getting Started

  1. Navigate to the Harp.Toolkit NuGet tool package

  2. Click .NET CLI (Local) and copy the two suggested commands. E.g.:

    dotnet new tool-manifest # if you are setting up this repo
    dotnet tool install --local Harp.Toolkit
  3. To view the tool help reference documentation, run:

    dotnet harp.toolkit --help
  4. To list all available system serial ports:

    dotnet harp.toolkit list
  5. To display info about a device connected to a specific serial port:

    dotnet harp.toolkit --port COM4

    Each read waits up to 2000 milliseconds for a response. Pass --timeout to change that default, or --timeout -1 to wait indefinitely.

  6. To restore the tool at any point, run:

    dotnet tool restore

Firmware Update

harp.toolkit can write a firmware image to a connected device, checking that the image is compatible before writing anything:

dotnet harp.toolkit update --port COM4 Behavior-fw3.3-harp1.15-hw2.0-ass0.hex

An update resets the device, so avoid updating firmware that is part of a running experiment, since interrupting an update leaves the device in bootloader mode until one completes successfully.

See Firmware Update for the naming convention used by firmware images, how to recover a device left in bootloader mode, and the available options.

Code Generation

harp.toolkit can also generate device interface and firmware code from a device.yml metadata file. With a device.yml in the current directory, the following generates the .NET device interface, targeting Bonsai.Harp:

dotnet harp.toolkit generate interface

To generate the Harp Python interface instead:

dotnet harp.toolkit generate interface python

See Code Generation for authoring device metadata, generating firmware, and the available options.

Device Verification

harp.toolkit can also check a device against the Harp specification, reporting where its behavior departs from the standard and writing the result as a shareable HTML report:

dotnet harp.toolkit verify --port COM4 --report report.html

Verification writes to device registers and assumes a freshly powered device, so avoid running it against a device that is part of a running experiment.

See Device Verification for the specification used to check the device, the report structure, and the available options.

Contributing

Bug reports and contributions are welcome at the GitHub repository.

License

Harp.Toolkit is released as open-source under the MIT license.

About

A tool for inspecting, updating and interfacing with Harp devices from the command-line.

Topics

Resources

Stars

2 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages