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.

USB mass storage device without DMA

Hi,

I am using Tivaware 2.0.1 (driverlib + usblib) and the mass storage device class on a TM4C123. If I do not enable the uDMA prior to calling USBDMSCInit, the MCU goes into a Hard Fault.

According to the usblib documentation it should be possible to use the mass storage device class without DMA if not needed. I would really like to do this to save memory and power. Please advice!

To reproduce the error, use the usb_dev_msc example for dk-tm4c123g. Comment out the code under "Configure and enable uDMA" and connect the unit to a host PC.

Kind regards, Per

  • Hello Per,

    Unfortunately, the documentation is incorrect on this topic. At one point in the history of usblib, uDMA was optional in the mass storage class but that is not case now.  I will open an issue requesting the documentation be fixed.

     However, I don't believe having the MCU core copying the bytes to-and-from the buffers instead of using uDMA is going to be more power efficient. uDMA will also provide much better performance.

  • Hi Mitch,

    Thats too bad. And also a very general statement regarding DMA power efficiency that assumes that we just want to copy the data.

    I glanced over usbdmsc.c and it seems filled with DMA code. Do I need to modify this myself?

    Regards, Per

  • Hi Per,

    Per E said:

    Thats too bad. And also a very general statement regarding DMA power efficiency that assumes that we just want to copy the data.

    Would the bulk class work for what you are trying to do? That does not use uDMA.

    Per E said:
    I glanced over usbdmsc.c and it seems filled with DMA code. Do I need to modify this myself?

    It looks like I could provide you a much older version of the mass storage class module that does not have uDMA. It is, however, considerably different (pre-C99 type changes, missing bugfixes) and could not be used as-is with the current usblib.  But it would be beneficial as reference to removing DMA from the current msc module.

    If you can provide a use-case that would show universal benefit, I can try to get the feature scheduled for a future TivaWare release.  If your need is time-sensitive and you want to pursue TI adding this feature, you would need to contact your local TI FAE.

  • Hi Mitch,

    We want to present our device as a mass storage device for simplicity, but parse and handle incoming data on the fly (not storing it with a traditional file system approach).

    Please send me the latest version of the mass storage class that complies with the library documentation.

    Regards, Per