[--] USBSerial tx speed issue [SOLVED BY UPDATING TO THE LATEST VERSION OF THE REPO]

User avatar
Pito
Posts: 1739
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

[--] USBSerial tx speed issue [SOLVED BY UPDATING TO THE LATEST VERSION OF THE REPO]

Post by Pito » Sat Jul 15, 2017 6:03 pm

While messing with the TEK graphics emulator, which sends vector data to PC (Win7) via SerialUSB (under libmaple and Generic as well), the speed the F103 sends the data to the PC is highly questionable.. :?
The speed at 115k2 Serial is maybe 10x faster than the one via USB.
With the same code sending chars (via Serial.write(byte);).
Can somebody confirm?? (Updated the TEK demo sketch with elapsed time measurement).
PS: to draw the TEK demo screen takes

Code: Select all

4998 msecs via USB
433 msecs via 115k2
108 msecs via 460k8
63 msecs via 921k6
Last edited by Pito on Sun Jul 16, 2017 8:42 am, edited 2 times in total.
Pukao Hats Cleaning Services Ltd.

User avatar
RogerClark
Posts: 7683
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: [libmaple and Generic] USBSerial tx speed issue

Post by RogerClark » Sat Jul 15, 2017 10:05 pm

USB seems to have issues if you send it individual bytes

If you send long strings it goes much faster.

I thought this had been investigated and the issue partially lies with the host driver.
Your serial USB adapter probably uses its own driver.

User avatar
Pito
Posts: 1739
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: [libmaple and Generic] USBSerial tx speed issue

Post by Pito » Sun Jul 16, 2017 5:59 am

So you say when tx data from F103 via Serial.write() the Win7 USB host is 10x slower than the Prolific USB/Serial dongle at 115k2?

FYI: I tested the "USB read speed" with help of PaulS benchmark and I get ~230kB/second (the F103 reads data from PC via Serial.read()).
That is consistent with his measurements with Maple.
Pukao Hats Cleaning Services Ltd.

User avatar
RogerClark
Posts: 7683
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: [libmaple and Generic] USBSerial tx speed issue

Post by RogerClark » Sun Jul 16, 2017 6:08 am

That dongle uses its own driver.

We use window's built in CDC ACM driver

BTW. I'm saying there are no bugs, but please see if you can find the other thread about this, because it has been discussed at length in the past.

User avatar
Pito
Posts: 1739
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: [libmaple and Generic] USBSerial tx speed issue

Post by Pito » Sun Jul 16, 2017 6:12 am

Ok, that means the window's built in CDC ACM driver is 10x slower than the Prolific's at 115k2 serial.. :shock:
In other words, the window's built in CDC ACM works 9k6 when receiving bytes via Serial.write() from F103..

BTW, the window's built in CDC ACM works 2.3Mbit/sec when sending bytes to F103 (F103 receives them via Serial.read() in a loop)..
:o
Pukao Hats Cleaning Services Ltd.


User avatar
Pito
Posts: 1739
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: [libmaple and Generic] USBSerial tx speed issue

Post by Pito » Sun Jul 16, 2017 6:44 am

@stevestrong: great work! 82x faster :shock:

Code: Select all

4998 msecs via USB -- OLD CDC ACM driver
433 msecs via 115k2
108 msecs via 460k8
63 msecs via 921k6
61 msecs via USB -- NEW CDC ACM Steve's patch
Pukao Hats Cleaning Services Ltd.

User avatar
RogerClark
Posts: 7683
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: [libmaple and Generic] USBSerial tx speed issue

Post by RogerClark » Sun Jul 16, 2017 7:34 am

I'm a bit confused about the status of the PR for this,

Is there another PR that I need to merge ?

User avatar
Pito
Posts: 1739
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: [libmaple and Generic] USBSerial tx speed issue

Post by Pito » Sun Jul 16, 2017 7:45 am

@Roger - sorry I've put this thread in maybe a wrong board.. I have nothing to add re any PR's..
Pukao Hats Cleaning Services Ltd.

stevestrong
Posts: 2062
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany
Contact:

Re: [libmaple and Generic] USBSerial tx speed issue

Post by stevestrong » Sun Jul 16, 2017 7:45 am

Honestly, I am also confused about what and how exactly Pito tested.
As I can see, this commit should have solved the USB speed issue.

Pito, which core/files did you test?

Post Reply