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
  • On the USB side, unfortunately, there is no easy way to tune bulk transfer speed, like bInterval of interrupt and isoc. Bulk transactions are scheduled in "best effort" manner on PC host controller.

    You have to tune it on the firmware by managing task priority.
    Bulk IN transactions is delayed when the firmware delays to write to the bulk IN endpoint.
    For bulk OUT transaction, firmware delays read out from the bulk OUT endpoint.
    In both directions, no data loss occurs thanking to NAK hardware flow control on USB line.

    Anyway, detailed discussion depends on the task scheduling structure of your firmware, RTOS or co-operative multitask using superloop. Which MSC example are you based on, RL-ARM, KEIL "USB Mass Storage Device Example", or any other?

    Tsuneo

Reply
  • On the USB side, unfortunately, there is no easy way to tune bulk transfer speed, like bInterval of interrupt and isoc. Bulk transactions are scheduled in "best effort" manner on PC host controller.

    You have to tune it on the firmware by managing task priority.
    Bulk IN transactions is delayed when the firmware delays to write to the bulk IN endpoint.
    For bulk OUT transaction, firmware delays read out from the bulk OUT endpoint.
    In both directions, no data loss occurs thanking to NAK hardware flow control on USB line.

    Anyway, detailed discussion depends on the task scheduling structure of your firmware, RTOS or co-operative multitask using superloop. Which MSC example are you based on, RL-ARM, KEIL "USB Mass Storage Device Example", or any other?

    Tsuneo

Children
More questions in this forum