I'm currently trying to run the SAM L21 as both a CDC and an MSD over USB. Thankfully there is example code here to get me started. I can move files into the on-board ram just like any other storage device. I can also send and receive data from a PC through a virtual COM Port created by the CDC code.
However, this is not the full implementation I have planned. I need to use a fat32 formatted SD card to save collected data. Usually one would connect an SD card to an MCU via SPI. However, I'm not sure that will work with my setup.
Can my MCU be made to write data over SPI into a fat formatted SD card? If this is possible, will the computer still recognize the SD card as formatted and usable?
If this is not possible with SPI, does anyone have experience integrating full SDC compatibility into an MCU? Links to documents or example code would be fantastic!
The end result will be a single usb connection that can sends and receive communication/data, as well as allow a user access to a formatted SD card for direct access to all data collected.