Tool for inspecting, updating and interfacing with Harp devices, with automatic firmware and interface code generation.
-
Navigate to the Harp.Toolkit NuGet tool package
-
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 -
To view the tool help reference documentation, run:
dotnet harp.toolkit --help
-
To list all available system serial ports:
dotnet harp.toolkit list
-
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
--timeoutto change that default, or--timeout -1to wait indefinitely. -
To restore the tool at any point, run:
dotnet tool restore
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.hexAn 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.
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 interfaceTo generate the Harp Python interface instead:
dotnet harp.toolkit generate interface pythonSee Code Generation for authoring device metadata, generating firmware, and the available options.
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.htmlVerification 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.
Bug reports and contributions are welcome at the GitHub repository.
Harp.Toolkit is released as open-source under the MIT license.