Cheaper part search: something like a dual-access flash memory (USB and I2C)

I’m looking for an inexpensive IC that has a USB PHY, USB-MSC stack (composite MSC/CDC a bonus), FATFS capabilities, flash memory (or a fast interface to one), and a serial interface (I2C, SPI, etc.). The goal is to have very low power and low cost data storage accessible locally via, say, I2C, and accessible remotely from a PC or OTG phone via USB flash drive.

I’ve been able to do this with a Cortex-M0+ MCU that has half of its 256kB flash dedicated to a FATFS. The local MCU (MSP430FR4xxx) turns on power to the M0 and sends it data via I2C. The M0 (if it’s not connected to a USB host) saves the new data into a file on the FATFS.

That works great! Two problems, though:

  1. There is only 128KB of flash.
  2. The M0 is a $4+ IC.

For item 1, I’ve tried using an SD card (while preparing to use an eMMC IC). The problem there (other than cost, again) was that the M0 only had SPI access to the SD card. That, paired with the M0’s USB stack, resulted in extremely long (> 3 minutes) mount times on a PC (win/lin/osx/android).

I’ve also successfully used an M4 with an SDMMC interface to the SD card. That is super fast, but now the cost has gone way up.

An even higher cost (and higher complexity, though it does work) option is to use a TI 6ch DPST chip to switch an SD card between a USB2244 IC (USB to MMC) and a local MCU. But now the local MCU must have MMC.

Thanks for any ideas.
–Todd

There are some ST discovery/nucleo dev kits that do the USB composite device thing, with CDC and Mass storage. The device in question is an stm32 running STLink fw. Ideally that fw is open source, but I don’t know.

Maybe I’m missing something, but a quick search for ST parts under $4 that have USB turns up some M0 parts, but they don’t have as much flash as the $4 SAM L21 I’m already using. Code isn’t the issue - all of the methods above have been coded and are being used on hundreds of devices.

I’m hoping for a cheap chip along the lines of the MCUs in USB flash drives. There are $8 drives with 16GB of managed flash and a tiny, cheap MCU. If I had one of those that also had I2C pins exposed, and could program the MCU - that would be ideal.

If you’re at the point where cost per mcu matters, contact your rep and get them to beat atmel/whoever.

You should optimize for minimal FW dev hours, whatever vendor.

You should also consider M3/M4. Atmel does a lot of M0 parts, but M3/4 are better choices for dealing with multiple I/O due to the more sophisticated interrupt controller and bigger DMA. Cost isn’t really a big difference between M0/M3. Volume is a bigger driver. I buy USB capable M4s for under $1.

That’s good input. I hadn’t thought about scale. We’re looking at 1k-10k per year. This client is somewhat unique. Dev budget is not the limiting factor, and sales are not a consideration. Best case is that we create a well-field-tested reference platform that other companies could either use or implement and sell. Small companies may not be able to benefit much from scale, either.

Looking again for cheap flash drives, there are 8GB devices for $2. If only there were a couple extra pins and a programming interface. It might be time to approach a flash drive company and pay for a new product.

Flash and RAM are the most costly part of an MCU as they use quite a bit of area as compared to the CPU. Consider a flashless part and add cheap QSPI:

i.MX RT 1010

That’s a good idea. findchips.com shows < $2 cost for that MCU.

I’m spinning up a stripped-down prototype and writing a brief spec. Then I’ll get a quote for a custom IC or MCM.

I appreciate all the ideas!