# Expose SDRAM as a USB 3 mass storage device

Challenge: Build a device that can host one or more SDRAMs (e.g DDR2, DDR3) and expose them as a USB 3 (slave) mass storage device.

Goal: Allow a USB 3 host to mount the device and allow near 5Gbit transfer rates.

Attempt 1: Use a PC to build the device - fail - PC doesn't come with hardware necessary to use USB in slave mode.

Attempt 2: Use a micro controller, such as PIC or ARM. SAM9 has support for DDR2, but lacks support for USB 3. Perhaps there're other micro controllers out there which would be suitable?

What other configurations can you think of that might help in solving the challenge?

Note: Please disregard the fact that SDRAM is volatile and somewhat unsuitable for storage.. Also, I'm aware of the existence of i-RAM or HyperDrive, which basically does the same thing but connected over PCI.

-
Isn't this called a thumb drive? –  JonnyBoats Dec 21 '11 at 19:14
No, a thumb drive uses flash memories which are very slow (~20 MB/s). DDR SDRAM can reach over 30 gigabytes/s. So they're more than a thousand times faster :-) –  Mika Dec 21 '11 at 19:56
Have you considered something like this: edn.com/article/… –  Kellenjb Dec 21 '11 at 20:53
You won't get near 5Gbit transfer with a PIC. This seems like FPGA territory to me. –  markrages Dec 21 '11 at 22:29
@JonL I've registered with the thunderbolt people, but they aren't yet at the point where they're letting mere mortals get a hold of a spec, let alone hardware. :-( –  akohlsmith Jan 6 '12 at 2:33

Ok, I can disregard the sanity of this project. It is insane, by the way, with little or no practical value beyond "doing it"-- but that never stopped me before and it shouldn't stop you.

In my opinion, you need several things: A CPU, an FPGA, some SDRAM, and a USB interface. Cypress makes the EX USB FX3 that does 2 of the 4 things. It has an ARM 9 CPU and USB 3.0 interface. What it doesn't have is an SDRAM interface-- which is why you want an FPGA. The FPGA does both the SDRAM interface as well as the high-speed data interface to the USB3 logic.

What you absolutely do NOT want is for the CPU to do the bulk of the data transfer! A 100 MHz ARM 9 isn't going to be able to handle that kind of data throughput. For that matter, just about any 2 GHz CPU isn't going to be able to handle that amount of data either. The ARM9 is just there for the housekeeping, while the FPGA does the heavy-lifting.

The ideal FPGA for this project is a Xilinx Spartan-6. Relatively low-cost, easy to program, and has built-in hard cores for the DDR2 SDRAM interface.

-
@Majenko <Facepalm> Oh, where to start. The best option for a fast scratch drive would be to install more SDRAM in your PC and run some software for a RAM-Disk. That is the cheapest and fastest option. Using RAM-Disk (USB or otherwise) as a swap-drive is just silly. Add that same RAM to your PC's main memory so it doesn't have to swap at all! –  user3624 Dec 21 '11 at 23:44
@Majenko In that case you have to ask yourself: should I spend money to make the swap/scratch space faster, or would my money be better spent upgrading the entire computer? A fast USB3.0 RAM-Disk will speed up Photoshop, but a new computer will speed up everything. Keep in mind that today a USB3 RAM-Disk doesn't exist and will cost much more than US$2,000 to build (parts + labor + whatever). This would be a much different issue if it cost$100, but it will never be that cheap. –  user3624 Dec 22 '11 at 0:00
Yes, but a new computer doesn't have the geek factor that a super-fast external ram disk would have. And geek factor is important in a thing like this. –  Majenko Dec 22 '11 at 0:02
@Mika - Booting from a live CD already caches and buffers the information in RAM. Or, again, copy the CD to a RAM disk on the PC, and run it from there. That way, your CPU will avoid the overhead of translating everything to USB 3 (an overhead which you've thus far ignored) and directly access the memory (which has been noted already to be much faster). USB 3 has three differential pairs over which which you can push 5 gigabits/s, and requires protocol overhead. A stick of DDR3 has 64 data pins plus addressing pins, and can hit 17 gigabytes/s, or 136 gigabits/s (27 times faster!) –  Kevin Vermeer Dec 22 '11 at 15:29
@Majenko - Performance always trumps geek factor IMO. Besides, having absurd amounts of RAM in your laptop or PC carries plenty of geek cred. –  Kevin Vermeer Dec 22 '11 at 15:35

## protected by Kortuk♦Sep 10 '13 at 5:10

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.