Friday morning dead-bugging a 1GB SPI NAND flash chip.
The Bus Pirate has a shared SPI bus with the LCD, IO expanders and SD card. The bus can run at 64MHz, but SD cards are limited to about 20MHz. Even if the SD card isn’t selected, speeds above 30MHz cause most cards to become misconfigured.
SPI NAND works to 103MHz so everything on the bus could run at full speed. However, if we use NAND then wear leveling, bad block detection and garbage collection all have to happen in the RP2040. Fortunately there’s an open source library to handle it.
What I really don’t like is that it will eventually wear out. There’s 15-16 year old bus pirates out there, it feels irresponsible to include limited life components. However, it’s not hosting an operating system or intended for intensive use so it will probably last quite a long time.
The other thing: it’s a big chip and pretty easy to replace with a hot air rework tool. Chips come in 128, 256, 512, and 1000 megabytes, so user upgrades are also possible.
It works. I attached it to the main bus pirate header and swapped everything to run from the NAND. There were some issues and quirks getting it to format properly, but after that it seems to work well. 1Gbit formats to 90meg/FAT16 after the spare blocks and such are allocated.
I’m going to test with the 4Gbit version as well (because it’s what I can find), but it has a larger sector size.
Whats the cost difference between the 1 and 4Gbit?
This has all happened so fast I haven’t had a chance to do sourcing yet. My local (RS components) had none. I got 1Gb from Mouser (feels retro!) to test. I ordered the 1Gb and 4Gb that were available at szlcsc to build a couple test boards to be built this week in china.
Cost and availability at szlcsc are absolutely not correlated with reality though. But here’s the prices:
The difference, ignoring sale price, is ¥3, which is 40ish cents at the moment. But it’s not really linked to actual market availability or price.
There are also domestic chips that are drop in replacements (almost! Different jedec id, well maybe?!?) for half price. But I’m begrudgingly adding flash, I want it to be top quality at least.
I was curious so I checked 1688 and taobao. Just absolute nonsense. We need to call around a bit tomorrow to know what’s up.