Spark Logic

USB Serial starts going slow if buffer on PC is not emptied

RogerClark Fri Aug 07, 2015 3:51 am

Hi Guys,

I was testing some code that writes to a ILI9341 display and also sends the same debug information to Serial.

I left it doing a soak test and after about sending several thousand chars to the serial without the serial console being open, I get a strange effect where Serial.print seems to start taking a noticeable amount of time to write something like “Sending ….” ( around 250ms)

If I open the Serial monitor, the issue goes away, but if I close the serial monitor and wait a for a few more thousand characters to be sent, the problem comes back.

I’ve written a test program yet to investigate what the issue is, but there does appear to be a problem.

The only other test I did so far is to run my test rig from a USB PSU and in this case there isn’t an issue.

i.e I’t only seems to occur if there is USB host.

Replies

fredbox Mon Sep 14, 2015 3:27 am

I may also have a shot at blacklisting the maple device so modemmangler doesn’t attempt to enumerate it. That would provide a more general solution. See https://mail.gnome.org/archives/network … 00038.html and http://cgit.freedesktop.org/ModemManage … list.rules for a head start with this idea.
That also works. I reinstalled modemmanager and created /lib/udev/rules.d/77-mm-usb-custom.rules with this line:
ATTRS{idVendor}=="1eaf", ATTRS{idProduct}=="0004", ENV{ID_MM_DEVICE_IGNORE}="1"

RogerClark Mon Sep 14, 2015 5:46 am

HI fredbox

I dont think its the same issue, but thankyou for letting us know of the problem and the solution.

I think I may need to start a “Not so frequently asked questions” section in the wiki ;-)

Sign in to reply