Page 2 of 4

Re: Serial over USB problem

Posted: Tue Dec 11, 2012 11:09 pm
by alexblack
Hi,
Giovanni wrote:Just a note "sd" functions are specific of the serial driver, they do work with the "sdu" driver but are not meant for that. you should use chnReadTimeout() instead.

Thanks, I got it.

About the timeout, what is the state of the system when it hangs? crashed or just some thread hung and others working?

The state is normal, all threads are working, except "USB_THREAD" (maybe I can look at its state too, but I did not think to do it), USB driver even responding to system requests. When I unplug USB cable the cable detection function resets the USB queues as I wrote once before and likely this is resume the USB thread.
In addition I have saw that data in "USB hang state" still sent succesfully from device to host (hangs only receive function).

Maybe it is only my problem, could someone check it on on their board?

Re: Serial over USB problem

Posted: Wed Dec 12, 2012 8:48 am
by Giovanni
My idea is to create a stress test and benchmark starting from your code, my problem is that right now I am very busy with other tasks, please be patient.

Giovanni

Re: Serial over USB problem

Posted: Wed Dec 12, 2012 1:54 pm
by alexblack
Giovanni wrote:My idea is to create a stress test and benchmark starting from your code, my problem is that right now I am very busy with other tasks, please be patient.
Giovanni

Yes, I will wait. But I do some tests to help you to understand the problem.
Today I tested STM32 USB-FS-Device-Driver library and VirtualComPort example with my usb_test program.
After some modifications it started to work without such problems. Also I measured exchange speed - it is ~330 kB/sec in each direction, ie 600kB/sec in one. The ChibiOS driver give max speed 75 - 100kB/sec from device to host direction. In both tests it is raw transfer speed without data processing.

Re: Serial over USB problem

Posted: Fri Dec 21, 2012 10:48 am
by Giovanni
Could you post your executable? I don't have Delphi where I am.

Giovanni

Re: Serial over USB problem

Posted: Mon Dec 24, 2012 4:09 pm
by alexblack
Yes.

Re: Serial over USB problem

Posted: Sun Jan 06, 2013 2:55 pm
by alexblack
Hi. Happy New Year!
Are there any news ?

Re: Serial over USB problem

Posted: Sun Jan 06, 2013 4:18 pm
by Giovanni
I Alex,

Probably I will able to give it a try next week.

Giovanni

Re: Serial over USB problem

Posted: Mon Jan 21, 2013 9:52 am
by alexblack
Hi...
Up!

Re: Serial over USB problem

Posted: Mon Jan 21, 2013 10:14 am
by Giovanni
Hi Alex.

I am not ignoring the issue not you :) I am just taken by problems of various kind lately.

Giovanni

Re: Serial over USB problem

Posted: Sun Feb 24, 2013 12:22 am
by sven.984
Hi...

I had a similar problem with the serial usb. After the first line of text sent from device to host, the usb analyzer shows a lot of zero size packets. I think the problem can be found in the following line (serial_usb.c: sduDataTransmitted):

Code: Select all

else if (!(usbp->epc[ep]->in_state->txsize &
    (usbp->epc[ep]->in_maxsize - 1))) {
...
    usbPrepareQueuedTransmit(usbp, ep, &sdup->oqueue, 0);


Running once into this "else if" the controller is running into a dead lock (including an interrupt)

It should be:

Code: Select all

else if ((usbp->epc[ep]->in_state->txsize &
    (usbp->epc[ep]->in_maxsize - 1))) {
...
    usbPrepareQueuedTransmit(usbp, ep, &sdup->oqueue, 0);


Best regards

Sven