This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Limiting the speed to USB bulk transnfers

Hello,

I have a product flavor that sports a mass storage device. I don't really need it now, but it is connected to an internal RAM file system which could be handy to have (is security codes are provided), so I want to keep it. The problem is that I think that writing large files to the drive can prevent system tasks other than the USB tasks from running, hence triggering a watchdog reset. I was hoping to limit the transfer rate using the 'bInterval' parameter in the endpoint descriptor, but as long as I keep on using bulk transfers that will have no effect. Is there a way to limit the transfer rate except from answering the host with a NACK...?

Parents
  • > the USB tasks have a very high priority, as does the USB IRQ. It seems as if not all tasks in the system get executed while these high priority transactions take place.

    Tune the interrupt priority using VICVectPriority register.
    Do you have any task in main loop, which should be assigned higher priority than mass storage?



    > Is there something wrong with switching to interrupt transfers?

    Do you mean turn bulk IN/OUT endpoints of MSC into interrupt ones?
    In most case, it'll work but no guarantee, because MSC spec explicitly defines the endpoints as bulk.

    MSC-BOT spec (usbmassbulk_10.pdf)
    www.usb.org/.../usbmassbulk_10.pdf

    4.4 Endpoint Descriptors
    The device shall support at least three endpoints: Control, Bulk-In and Bulk-Out.

    Good for hobby project, but not for production design.

    Tsuneo

Reply
  • > the USB tasks have a very high priority, as does the USB IRQ. It seems as if not all tasks in the system get executed while these high priority transactions take place.

    Tune the interrupt priority using VICVectPriority register.
    Do you have any task in main loop, which should be assigned higher priority than mass storage?



    > Is there something wrong with switching to interrupt transfers?

    Do you mean turn bulk IN/OUT endpoints of MSC into interrupt ones?
    In most case, it'll work but no guarantee, because MSC spec explicitly defines the endpoints as bulk.

    MSC-BOT spec (usbmassbulk_10.pdf)
    www.usb.org/.../usbmassbulk_10.pdf

    4.4 Endpoint Descriptors
    The device shall support at least three endpoints: Control, Bulk-In and Bulk-Out.

    Good for hobby project, but not for production design.

    Tsuneo

Children