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
@whitequark One of these days I want to get my mitts on a Glasgow, but the issue is that I don't really know what I'd do with the thing outside of a few "use it once" things, so it would just spend 99% of the time on a shelf...
@becomethewaifu tbh i think half the campaign buyers got it for that reason
@whitequark @becomethewaifu tbf i also havent really used my Glasgow since i got it, it feels so overkill for most things i do. (Also feel like i could damage it with my stupidity)

@byteturtle @becomethewaifu i mostly use mine for dumping spi flashes (i dump a lot of spi flashes) and like poking at i2c; this is entirely within expectations

as for damage: only times i've heard of it was like "i connected a car battery to a pin" and "my engine traction controller blew up and took it with it". i'd be impressed if you managed it, unless you connected more than 6V to a pin

@whitequark whats your preferred way of connecting them? any reliable'ish chip clamps that go well for that? also one thing i'd really like to have would be a solid uart converter, which isnt affected by shitty kernel drivers - but tbh havent used the one in Glasgow even once i think... so might be just what i need.

@byteturtle the clamps are all garbage IME regardless of price, but i found a pogo pin thingy on aliexpress that actually works well (but requires a lot of pressure while in use... hence why i optimized the glasgow qspi core)

glasgow uart should be pretty good nowadays

@whitequark just tried uart, and i think my targets indeed fried xD

```
glasgow run uart -V 3.3 --rx A7 --tx A1 -b 1500000 tty
```

@byteturtle 926 is a weird number of frames, r u sure the baud is right?
@whitequark according to the FriendlyELEC Wiki its: Baud rate 1500000 Data bit 8 Parity check None Stop bit 1 Flow control None - but it only spews out garbage, no matter what baud rate i set, and even with -a (propably the target boards fault, not glasgows - a ch341-uart also only outputs garbage or nothing at all, hence my conclusion of target fried.
the why is still a mystery to me, propably electrostatic...