This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1294NCZAD: File transfer via USB

Part Number: TM4C1294NCZAD

Hello

In our project we need to use USB as a serial port (CDC class already implemented and working) and as a transfer media from an external flash. We don't want to implement a file system because it seems quite costly... We tried to implement a MSC class, and the PC host recognizes the device as an external disk but asks for formatting. 

Is there any way to transfer data using this class, without a file system?

Otherwise, we thought to configure our device as a USB bulk device. Using usb_dev_bulk example we can communicate with a PC host, but we can't see the difference from a CDC implementation... It's very similar to a virtual port! What are the advantages of using this class instead of MSC? We read that it is useful for large amount of transfer data, but what rate can it achieve?

Thank you

  • Hello Mirco,

    I don't believe it's possible to use MSC without some sort of file system as Windows and other OS will treat any MSC device as being like data storage such as a hard drive. I have not heard of using MSC how you are describing it.

    For transferring media, is it just transferring data and then accessing it later, or are you needing to have a steady stream such as playing audio?

    The bulk device example is more or less a CDC but the example just uses simple endpoint transfers rather than supporting ACM which is part of the differentiation with CDC.

    Presuming you use maximum packet size for all transfers, maximum rate in theory would be 1.216MB/s or just under 10 Mbit/s, but with overhead from MCU including TivaWare it wouldn't be possible to go that fast.

    Also one prior user suggested using a double buffer to help get TivaWare transfer speeds closer to that maximum, but that may be costly like the file system as well, not sure: e2e.ti.com/.../1535533
  • Thank you Ralph
    We need to write data (i.e. periodic readings of peripheral sensors) on the external flash and we access it later (i.e. once a day). Once data are read, we erase it, and the flash is ready to store new data.
    We'd like to implement a file system, in order to have all this data divided in single files. Do you have any reference to implement a file system on an external NAND flash?
    Thank you
  • Hello Mirco,

    If you want to write to external flash then you shouldn't use USB for that but rather use the EPI bus available on your device which is intended for interfacing with external memory like NAND Flash.

    We don't have a design specifically for NAND Flash, but I would recommend you look into this TI design to see an example of an EPI-based system: www.ti.com/.../TIDM-TM4C129SDRAMNVM

    As far as file systems are concerned, the best example we would have is for FAT formatted SD cards. The example can be found in TivaWare under [Install Path]\TivaWare_C_Series-2.1.4.178\examples\boards\dk-tm4c129x\sd_card
  • Thank you Ralph

    I don't want to communicate with my NAND Flash via USB, but with SPI.
    On my board, Tiva MCU is connected via EPI to an external RAM, and with QSSI to a NAND flash. Does it make sense to start from the SD card example, replacing the EPI interface with my SPI driver (interface with the NAND flash)? Or maybe it needs other interface layers?
  • Hello Mirco,

    QSSI to Flash is part of the TI Design I linked actually, so you wouldn't need to replace the EPI interface, it actually would be easier than what I was thinking where you would have needed to implement EPI to talk with your NAND Flash. From the description:

    "The implementation is made possible by using the EPI Interface of the Microcontroller to interface a 256Mbit SDRAM at 60MHz and QSSI Interface at 60MHz for Non Volatile Memory's like SD Card and Quad Serial Flash which allows developers to expand code and data space above the maximum Internal Memory of the TM4C1294 microcontroller."

    I would recommend starting from there and if needed then implementing your file system needs onto that example project. Note that TivaWare has 3rd party support for fatfs under [Install Path]\TivaWare_C_Series-2.1.4.178\third_party\fatfs