SPI Flash Analyzer and enhancements

Hi! I just added a SPI flash analyzer: https://github.com/adafruit/Logic2-SPIFlash

Overall the process was really easy! It was cool to see how easy it was to add to the marketplace.

Now for a few questions:

  • How could I add Quad and Octal flash support?
  • Could we provide defaults for settings? For example address bytes should default to 3.
  • Could we have boolean settings? I have different classes of commands that it’d be nice to enable and disable independently.
  • Could we enter numeric values as hex? Addresses are awkward in decimal.
  • What format is the “format” value in result_types? I tried treating it like a Python string format to print the value as hex but it didn’t work.

Thanks! This has made Logic2 really helpful.

Hi Scott,

Awesome analyzer! Thanks for the feedback on the process too, that helps a lot! We consider the current state of the marketplace and the HLA api very rough, and we’re trying to get as much feedback as we can to help plan improvements.

How could I add Quad and Octal flash support?

In the current HLA API, there is no way to read the other inputs directly. That said, there are some low-level analyzers (C++ libraries) that other users have written for Quad SPI.
For example:



You could fork one of these, or write your own.
Out of the box these low-level analyzers (LLAs) won’t feed data into HLAs without some modifications. We haven’t made the API for this official yet, so it’s subject to change, but you can see how we added “FrameV2” support to our SPI analyzer here:

Could we provide defaults for settings? For example address bytes should default to 3.

Unfortunately not yet, but that’s something we’ll probably add directly to the settings classes as an optional parameter.

Could we have boolean settings? I have different classes of commands that it’d be nice to enable and disable independently.

Good catch. Any other types you would like to see?

Could we enter numeric values as hex? Addresses are awkward in decimal.

This could probably just be built in.
In this case, would you prefer to have more features built into the NumberSetting class (e.g. float vs. integer, custom validator, etc)?
Alternatively, you could just use a StringSetting setting and validate it yourself. We don’t have a super clean solution for this, but right now you can raise an exception when your class is constructed.

What format is the “format” value in result_types? I tried treating it like a Python string format to print the value as hex but it didn’t work.

This really needs to be in our documentation, sorry about that.
“format” is a handlebars format string that’s passed the complete frame object that was returned by the decode function.
It needs a lot of work. We’re planning on adding a number of custom helpers to make it easier to format values, but in the meantime, you might want to just store strings in your output object to get the display you want.
I think in 2.3.9, we now respect the display radix of the HLA, but I need to double check. (HLA display radix is set by right-clicking the HLA in the analyzer sidebar, it also affects the data table radix)
The most helpful thing to mention is that triple braces {{{ }}} tells the template to just display the string without any escape characters, which is needed for strings like “=” to display properly.

A few more things I would like to add. We’re currently working on big “under the hood” improvements for the data processing system, but when we get back to HLAs and the Marketplace, the first order of business will be to make improvements to the ability to discover, install, and manage extensions. Once that’s in reasonable shape, the next step for the marketplace and HLAs will be the developer experience, including documentation, tooling and the API. Speaking of the API, our current plan is to expand the API in a backward compatible way.

Thanks again for the feedback! I’m looking forward to making big improvements to this.

  • Mark

Ah! I’ve poked the low level API with the original Logic and didn’t realize it applied to V2 as well. I’ll take a look at modifying something next time I need it. :slight_smile:

Not that I can think of at the moment.

My hope was that’d be automatic. I expect that I’d get a float if the number has a decimal, otherwise I’d get an int. Something like python’s int() parsing which handles prefixes like 0x iirc.

Ok, awesome! That’s what I was wondering.

No problem! I was really impressed with it overall. I thought the creation, testing and publishing was all really easy. Easy enough that I can see hacking together one-off analyzers as needed. :smiley: