Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved debug functionality #51

Open
dihm opened this issue Jan 28, 2025 · 0 comments
Open

Improved debug functionality #51

dihm opened this issue Jan 28, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@dihm
Copy link
Contributor

dihm commented Jan 28, 2025

Working with the firmware, it would be nice if a little more debug functionality was baked directly into the firmware. In particular, the ability to dump the current instruction table would be very helpful for debugging how set commands are getting parsed. However, since the instruction memory is shared with the binary executable storage, I'm wary of adding too much new functionality to the firmware that is only useful for debugging. So I have three categories of things. Feel free to suggest others.

  1. New uC commands
    • readtable command that reads the current instruction memory as a single binary block (basically the reverse of setb).
    • getmode command that returns the current operational mode of the firmware, as well as instruction memory layout for that mode (including number of channels). Goal is that the string that comes out could be passed to a numpy structured array contructor with minimal processing, and then use that empty array as the container for the pyserial binary read command readtable.
    • clkstatus command that returns the current clock configuration (ie internal/external, frequency, mult)
    • getstate command that returns readable strings of the current output state of all channels. Probably not necessary if the python snippet for readregs is easily available
  2. Expanded/modified existing uC commands
    • setclock should probably contain mult as an optional parameter, and the setmult command removed
    • status should have finer resolution. By this, I mean that labscript integration tends to be smoother if the device mirrors the logical device states that labscript uses. For example: stopped, running (buffered), transitioning to manual/buffered, aborting, aborted (last execution)
    • readregs should be documented, potentially improved
  3. python snippets (given how little processing the uC does on debug commands, would should put together some standard python snippets that are easy to copy, or even import, for handling their output)
    • handler for readregs that prints current device state in human readable form, may be a good enough substitute for same functionality directly in uC (as a getstate command). Should probably also leverage a clkstatus command so results scale with clock frequency properly.
    • handler for getmode and readtable combo that prints human readable version of instruction table (ideal for small tables used in debugging only)
    • probably a step too far, but some simple code that documents clearly what the device specs are (ie max instructions and resolution) versus configuration (ie mode and clock frequency). Probably only useful for generating tables to include in the readme though...
@dihm dihm added the enhancement New feature or request label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant