i'm working on a SPI NAND Flash applet for #GlasgowInterfaceExplorer. i would like to add the ability to read (and write) data dumps... however, unlike with SPI NOR flashes where the data is located in an flat address space, SPI NAND devices are structured as pages (each consisting of data + spare + ECC)

how should i format these dumps? is there a standard format? is "use msgpack with a simple custom schema" good enough, considering msgspec promises fast (de)serialization for Python and other languages?

Client Challenge

if you have a #GlasgowInterfaceExplorer, please try out the new memory-25q applet and let me know if it works for you!

https://glasgow-embedded.org/latest/applets/memory/25q.html

memory-25q - Glasgow Interface Explorer

so!! i am excited!!! to have finally finished the complete reimplementation of the #GlasgowInterfaceExplorer memory-25x applet for managing SPI NOR flashes. it is called memory-25q and it took an enormous amount of effort, because i have decided to Build It Properly

want to jump to the docs (there are a lot of docs, including on the fundamentals of (Q)SPI flashes) or read the code? here we go:

now, why did i do that? two reasons. memory-25x is one of the first applets i made, ~7 years ago, and i had no idea what kind of UI i should be building (yet). to make it worse, i thought that SPI NOR flashes were "easy", you could "just send a few bytes and that's basically it".

nothing could be further from truth. first off, SPI NOR flashes don't really exist—there is no spec, no standard organization that can say "no, your thing is not compliant", no order to any of this. every vendor does whatever they want, and then every other year JEDEC writes down all of the unhinged shit they did. here is the list of six incompatible methods to turn a single bit on or off, as a warmup

second, SPI flashes have an absolutely absurd diversity of framings. you cannot even express it without building a meta-framework for abstracting over all the ways people have come up to squeeze 8 bits into 2 or 4 wires. then on top of it you have to manage a bunch of global state that affects framing in subtle or sometimes really fundamental ways, without having any way to find out that you've made an error besides "you compare the actual data with the expected data (or its checksum) and it is not equal"

anyway, the new applet should be excellent at any daily task and at least okay at >90% of the exotic ones. also it's easily generalized for the (completely incompatible on the wire) QSPI NAND 25N series, octal or DTR variants, etc

applet.memory.25q: new applet by whitequark · Pull Request #1130 · GlasgowEmbedded/glasgow

This is a complete functional replacement for the memory-25q applet and it obsoletes and deprecates the latter. To do: figure out why 1-2-2 and 1-4-4 modes are broken not broken, just crosstalk ...

GitHub
@tim @elly this is viable, you could do it on a #GlasgowInterfaceExplorer most likely; main concern is that PSRAM doesn't have all the commands that QSPI hosts may expect. eSPI solves this entirely by letting the device inject wait states, IIRC
I would like to formally announce that the #GlasgowInterfaceExplorer revD development (the next iteration: with the same FPGA but 32 digital I/Os and 8 single-ended analog channels that can be configured as 4 differential ones) is well underway with a CrowdSupply campaign planned later this year; stay tuned!

So #HackerBoxes dropped of number 124 today "Bus Driver", and I'm looking forward to using it. But I also realized that it has the basis for a good workshop on exploring hardware interfaces which I use #GlasgowInterfaceExplorer for.

https://hackerboxes.com/collections/past-hackerboxes/products/hackerbox-0124-bus-driver

HackerBox #0124 - Bus Driver

@joshua do you have a BSDL? if yes and you can access JTAG, I have a #GlasgowInterfaceExplorer applet for you that will tell you this in a single touch of a probe
#GlasgowInterfaceExplorer now has (or about to have) a first-class progress bar implementation with a nice API that takes into account terminal writes elsewhere in the Python application as well as nested or concurrent progress trackers resulting from applet composition!

today's project for #GlasgowInterfaceExplorer: reworking the memory-25x applet

this is a very old applet, one of the first introduced. it works mostly fine, but it was designed and implemented before I really knew how to make good applet UIs, and long before I added QSPI support, so it's not using all of the available bandwidth & it requires specifying a bunch of geometry parameters by hand even when it is trivially extracted from the flash itself

I am planning to redesign the Flash command engine to support not just 1-1-1 (normal SPI) commands, but every mode including 1-1-2 and 1-1-4 (dual/quad data) and 1-2-2 and 1-4-4 (dual/quad address and data). to do this I will implement an abstraction for a (Q)SPI command set, which can then be extended and specialized by an individual flash

this will also handle devices like Winbond's and Micron's QSPI NAND devices (W25N series and MT29F series, respectively).

This thing is an "ETEKCITY Voltson Smart Wi-Fi Outlet" model ESW01-USA, and it's supported by Tasmota. You _can_ actually disassemble it without breaking it, but it takes some persistence. Inside is a daughterboard with a bog standard ESP8266 12-E compatible module. Which thankfully has all the UART pins on the side I can access.

This is another success story for the #GlasgowInterfaceExplorer, which not only can do the ESP8266's weird 74880 baud rate, but it can also pretend to be a serial port over pty so you can use regular old esptool with it.