Background -- I recently discovered
https://github.com/stacksmashing/pico-serprog and since I have a ton of picos and no rom programmers I thought I'd give it ago, except flashrom doesn't detect it as a programmer. Then I discovered the fork
https://codeberg.org/libreboot/pico-serprog except that it doesn't implement all commands. So today I forked it:
https://github.com/opensensor/pico-serprog and implemented remaining commands.
I think started refactoring the primary rom read command
S_CMD_O_SPIOP -- seems to be the problem is related to flashrom reading the entire 16 MB rom I can read from the chip as long as I read a subset that can fit into pico memory and send it one go -- as soon as I chunk the payload the communications with flashrom break.
I've started trying to implement pio spi in a branch, but I am kind of confused. It compiles, but no data is received for the large chunks, meaning the new pio code I added isn't quite right:
https://github.com/opensensor/pico-serprog/pull/1/files