SD cards are the literal worst.

they've expanded to be the size of small hard drives, and devices like the rpi keep using them as boot media, but they:

- use garbage tier low endurance flash cells internally
- have little to no overprovisioning for wear
- perform only the most basic wear levelling
- have no protocol level integrity checking
- have few internal error correction features, if any
- decay comparatively quickly without patrol scrubs
- do not perform patrol scrubs
- cannot do PLP

I've been mad about this pretty much forever. Don't use SD cards for stuff where there's literally any other option.
@gsuberland I agree with you, but what other options are there at the moment? I guess USB drives might work.

@kelpana @gsuberland USB-attached SATA or NVMe SSDs.

USB flash drives are the exact same (or often worse). Don't use them either.

@manawyrm @gsuberland I know some USB flash drives are bad, or even just SD cards. But what can be used to interface to a microcontroller project? Is it even possible to interface NVMe in a small system?

@kelpana @gsuberland SD cards can be okay, if you use them read-only-only and buy from reputable vendors (e.g. Samsung).

If you really need R/W storage -- SPI NOR flash is a good option (together with proper wear leveling, etc.).

eMMC storage ICs are also available, often slightly more reliable and available from reputable vendors with a proper datasheet. They might work in some situations.

Otherwise, things get tricky...

No, NVMe won't work.

@kelpana @manawyrm for MCUs it generally makes more sense to use an EEPROM most of the time. that way you can select parts with known longevity properties that you can engineer around. depends what the project requirements are though.
@kelpana @manawyrm @gsuberland wouldn't NAND or NOR flash be better? If you have a Linux kernel, you have UBIFS

@raito @kelpana @gsuberland Yes, if you have a Linux kernel, you suddently have more good options.

"Microcontroller project" just didn't sound like Linux to me :)

@manawyrm @kelpana @gsuberland agreed; as we talked about RPIs in the start, I was considering the large spectrum of microcontroller projects

Nonetheless, I suppose that even ESP32 grade stuff could get access to a good implementation of something like UBIFS?

@raito @kelpana @gsuberland I'm sure you could implement something -- but I'm not sure if it exists yet. Haven't seen it yet.
@kelpana @manawyrm @gsuberland (also: are eMMC as bad as SD cards? I felt like they had better properties)

@raito @kelpana @gsuberland You can at least buy them from a proper source, with a datasheet and can be pretty much guaranteed to not get fake chips.

That helps a lot. Otherwise they're basically the same.

@raito @kelpana @manawyrm eMMC is a bit better, but more than anything the manufacturers are just more transparent about their performance.

@gsuberland @raito @kelpana
Look at this datasheet: https://wmsc.lcsc.com/wmsc/upload/file/pdf/v2/lcsc/2007301503_Samsung-KLM8G1GETF-B041_C499918.pdf

You can also often configure/partition eMMC flash to work in pseudo SLC mode (trading size for reliability).

I know that at least some Micron eMMC has working built-in data refresh... Not sure about other vendors.

@manawyrm oh neat. I know the eMMC protocol has much better guarantees about operation timings and caching, so that helps a lot with designing stuff for data integrity.
@kelpana @manawyrm @gsuberland eMMC or raw qspi connected flash.