0

I am making a communication web app that connects the usb device using stm32 mcu to the Chrome browser.

When I run the code I wrote, I'm fetching data at a rate of about 1.2 mbytes / sec.

This is based on the execution speed of the pure "transferIn" function except for encoding and data interpretation. In my case, transferIn uses a bulk endpoint.

I know that 1.2 mbytes / sec is only about the speed of usb 1.1.

Is this normal?

I am wondering if there is a more advanced method, but I do not know.

Reddol18
  • 57
  • 5

1 Answers1

1

You can increase throughput by having multiple transferIn() requests queued. This makes sure that the host is always ready to received more data from the device rather than waiting for your application to process the data before asking for more.

Reilly Grant
  • 5,590
  • 1
  • 13
  • 23
  • 1
    Many STM devices are only FS so 1.2MB is 100% OK. – 0___________ Jan 14 '19 at 23:49
  • thnx~ Reilly Grant, thnx~ P__J___ – Reddol18 Jan 15 '19 at 00:30
  • @Reilly Grant You mentioned "multiple trasferIn () request queued", but it is not clear how this should be implemented specifically. I used the Web Worker to call several postMessages containing the trasferIn () command, but this also did not exceed 1.2mb / s. – Reddol18 Jan 15 '19 at 08:34
  • Are you sure that your device is operating in high-speed mode? Even if it is a USB 2.0 device it can still be limited by the hardware capabilities to low-speed mode. – Reilly Grant Jan 23 '19 at 23:18