Large external storage for microcontroller - Page 1
Forum section: electronics / projects

author: steaky1212
author_rank: Regular Contributor
timestamp: October 09, 2020, 09:37:02 am
content: Hey,I am working on a project where I need to store a lot of data to be used by a microcontroller (lots of reads, much fewer writes) - unfortunately I can't go into details.I need to use the MSP430 (for reasons), I need to have the storage device soldered onboard (again for reasons), and I need usable storages in the 1-8gb range (lots of data).My normal plan would be use:- SPI EEPROM (not enough storage)- SD card (physically too large and not solderable in volume)- microSD card (not solderable in volume)So now I'm looking at SPI flash devices (like Micron MT29F2G01 or KIOXIA TC58CVG0S3), but I need to manage bad blocks with these.Have I overlooked any storage technologies?Or does anyone have any experience with implementing a file system for SPI NAND devices on resource contrained microcontollers?Thanks in advanced,Steaky

author: Yansi
author_rank: Super Contributor
timestamp: October 09, 2020, 09:49:04 am
content: Your one of the overlookings is probably using MSP430 for that. Use an MCU with suitable interface for managing large storage devices, such a NAND FLASH controller, or proper SDIO interface.Not sure what for would one use a wimpy MSP430 with a 8 GBytes of data storage. But that is not our business, sure, we understand. But maybe, this is yet another XY problem. So what do you need the storage for?Thinking that an 8GByte chip will be smaller than an micro SD card is probably wrong, unless you are going for an HDI PCB design and pretty fine pitch BGA chips.MicroSD cards may be not solderable at volume, but what volume exactly are we talking here? Have seen one soldered few times in different products, so have I seen a microSD card glued into a user inaccessible uSD slot inside of the device.

author: tszaboo
author_rank: Super Contributor
timestamp: October 09, 2020, 09:53:16 am
content: You have two types of Flash memory, NOR and NAND. Some NOR flash memory will be sold guaranteed without bad blocks. They sell with SPI interface or sometimes QSPI which is faster. You could easily get ~100MB NOR flash. You can handle a NOR flash without file system.One other option is PSRAM. I dont see these being sold cheap by big vendors. They seem to be all the rage in China though. So you have a DRAM with a controller, that makes it act like an SRAM, so you dont need to have it refreshed by the micro. It is obviously volatile.

author: mikerj
author_rank: Super Contributor
timestamp: October 09, 2020, 10:28:07 am
content: Quote from: steaky1212 on October 09, 2020, 09:37:02 amGigabitor Gigabyte?Quote from: steaky1212 on October 09, 2020, 09:37:02 amThe MT29F2G01 is a 2 Gigabit part, if you actually need 8 Gigabyte of storage you're going to need 32 of these devices.If you did mean 2 gigabit, then you might look at the MRAM devices from Everspin.

author: jbb
author_rank: Super Contributor
timestamp: October 09, 2020, 10:37:06 am
content: Maybe eMMC?

author: steaky1212
author_rank: Regular Contributor
timestamp: October 09, 2020, 10:45:38 am
content: Quote from: mikerj on October 09, 2020, 10:28:07 amIt's gigabits.The plan is to store lots of files all around the 64kbyte size, and pushing one of the files over SPI every minute of so.1gb gives me 2048 files.Quote from: Yansi on October 09, 2020, 09:49:04 amMSP430 is good for the low power mode, fairly simple architecture, simple to develop for, low cost, etc.Yes I could go down the ARM route, that has all the bells and whistles, but a lot of that isn't needed.

author: chintal
author_rank: Newbie
timestamp: October 09, 2020, 03:41:29 pm
content: There are file systems for SPI SD cards that run on MSP430s and the like. The one I've used many years ago is EFFS-THIN (https://www.pumpkinspace.com/store/p140/HCC-Embedded_MSP430_EFFS-THIN_SD_Card_Library_for_the_CubeSat_Kit.html). This is pretty expensive, though. I'm sure there are many others available, even open source ones. I simply have not used any in particular to recommend. These can be used with eMMC chips which support the SD card protocols as well, which reduces the high risk of SD card failure.I would not want to try to do a hand-rolled file system and block maintenance and wear levelling and dozen or so other headaches you'd need to do with to work with bare NAND flash on an MSP430. I did come across some open source libraries for Cortex-M3s which do those things a couple of years ago, and even with the ARM peripherals taking on some of the load, there's no way I'd be comfortable running that on something as small as an MSP430.

author: EverydayMuffin
author_rank: Regular Contributor
timestamp: October 09, 2020, 03:45:17 pm
content: You could look at these options:Serial NOR Flash - e.g. Cypress S70FL01GS (1Gb)Parallel NOR Flash - e.g. Cypress S70GL02GS (2Gb)ONFI NAND Flash - e.g SkyHigh S34ML08G3 (8Gb)eMMC NAND Flash - e.g. SkyHigh S40FC004 (4GB)

author: Benta
author_rank: Super Contributor
timestamp: October 09, 2020, 04:21:03 pm
content: +1 for eMMC.It'll do just what you want. The nice thing is that error correction etc. is all on-chip. And the BGA packages are small.

author: daqq
author_rank: Super Contributor
timestamp: October 09, 2020, 09:02:16 pm
content: Interestingly enough youcansolder microSD cards:https://hackaday.com/2015/08/18/reflow-solder-your-micro-sd-to-ensure-it-doesnt-go-anywhere/Bit of a hack, your manufacturing house will be WTFied, but hey, it works.

author: Peabody
author_rank: Super Contributor
timestamp: October 09, 2020, 09:32:05 pm
content: Well, the standard microSD holder is certainly solderable. The microSD modules used in the Arduino community are churned out by the metric ton by the module makers of the Far East, and the holders are clearly reflow-soldered just like everything else on the board. But then you would have to insert an SD card into the holder before shipping, or the user would have to after he receives it. Are you saying that having the card be removable and replaceable violates your requirements?

author: steaky1212
author_rank: Regular Contributor
timestamp: October 12, 2020, 08:49:22 am
content: Quote from: daqq on October 09, 2020, 09:02:16 pmIf you read through they didn't actually use that in production due to the high risk.I have a high vibration environment that I was initially nervous about connector contacts, and although microSD cards are cheap that's only if you want to put Amazon on your BOM (and you don't mind arguing with your supply chain manager).(I am aware that BGA needs additional care with high vibration environments)It looks like I might be dropping the MSP430 in favour of an STM32F4 then as this gives me the SDIO interface to use the eMMC.I have also bought some Kioxia NAND flash ICs that I'm going to do some read/write tests with, but I don't want to roll my own filesystem so I'll probably look at one of these:https://github.com/bnahill/FLogFShttps://github.com/aviadzuc/NANDFShttps://github.com/rickyzheng/uffs

author: Berni
author_rank: Super Contributor
timestamp: October 12, 2020, 09:09:39 am
content: Don't use raw NAND flash chips as the error correction and bad block remapping is too much hassle.So i also suggest eMMC, as it is pretty much simply a SD card in BGA form. You can also bring its pins out to test points and connect it to a USB SD card reader to production flash the data into it. Same test points can also be used to bodge on a SD card socket so that you can use easily replaceable SD cards during development, then just solder the eMMC chip for production.

author: voltsandjolts
author_rank: Unknown
timestamp: October 12, 2020, 10:00:32 am
content: Simplest solution would be serial NOR FLASH which is easy to connect to any SPI-equipped microcontroller and doesn't need bad block management.The OP said '1-8gb' (gigabit) so serial NOR could work for that. If the OP meant '1-8GB' (gigabyte), then probably not.Another option might be bare NAND FLASH with LittleFShttps://github.com/ARMmbed/littlefs

author: mikerj
author_rank: Super Contributor
timestamp: October 12, 2020, 10:01:28 am
content: Quote from: Berni on October 12, 2020, 09:09:39 amExcept eMMC doesn't have the simple one bit SPI interface that SD cards do.

author: cgroen
author_rank: Unknown
timestamp: October 12, 2020, 01:16:33 pm
content: I'm also looking for filesystem alternatives...I have looked at littleFS, but I don't like the list of errors/"features", maybe I'm just too nervous:https://github.com/ARMmbed/littlefs/issuesalso, the uffs does seem somewhat fine, but not much seem to have happened to it the last (many) years ?Anyone actually used one of these in some serious work (bad/good results) ?

author: bson
author_rank: Unknown
timestamp: October 12, 2020, 08:02:02 pm
content: Quote from: Berni on October 12, 2020, 09:09:39 amPlus if it's mainly used for continuous logging probably also think about wear leveling...