Page 1 of 4

ChibiOS/testhal/STM32F4xx/USB_CDC

Posted: Fri May 04, 2012 1:09 pm
by henk
I've compiled ChibiOS/testhal/STM32F4xx/USB_CDC from the git repository [using arm-none-eabi-gcc (Sourcery CodeBench Lite 2011.09-69) 4.6.1].

When I program this in my STM32F4-DISCOVERY a blue LED (comments mention RED led) flickers 500ms on/off.
Via the micro USB (OTG) connector the board responds to GET DESCRIPTOR REQUESTs, however when monitoring with wireshark I see that most (if not all) responses are (partially) corrupted.

Is there a known issue for this?
Is the this test-code supposed to work on the STM32F4-DISCOVERY?

Thanks,

Henk.

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Posted: Fri May 04, 2012 1:18 pm
by Giovanni
Hi,

The USB driver for the STM32 F4/F2/F107 is still work in progress, it compiles but the code is not yet complete. I hope to finish it within May.

Giovanni

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Posted: Fri May 04, 2012 1:30 pm
by henk
Then, for a work in progress this already works pretty good.

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Posted: Thu May 10, 2012 10:41 am
by E-B Felix
Hi

just wanted to compile the testhal/STM32F4xx/USB_CDC application from Trunk. I got an undefined reference during the linking.

It seems that there is a "Typo" in serial_usb.c at line 107

static chnflags_t getflags(void *ip) {
_ch_get_and_clear_flags_impl(ip);
}

should be:

static chnflags_t getflags(void *ip) {
_chn_get_and_clear_flags_impl(ip);
----^ the n is missing
}


Thanks
Felix

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Posted: Thu May 10, 2012 10:43 am
by Giovanni
Hi,

Thanks for finding, the channels code is under rework so that bug is very recent.

Please note that the STM32F4xx USB driver is not complete yet so that demo will not work anyway.

Giovanni

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Posted: Thu May 31, 2012 12:19 pm
by ErikZalm
Hello Giovanni,

Can you give an update on the STM32F4 USB status?

Do you have a todo list and development branch so we can help implementing and testing the driver?

Erik

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Posted: Thu May 31, 2012 12:33 pm
by Giovanni
Hi,

I will resume the work on the driver in next weekend then I will update the status, last time I tested it there was a problem with packet queues, enumeration didn't work.

Giovanni

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Posted: Sun Jun 03, 2012 5:14 pm
by Giovanni
Hi,

The status: Now the code is complete enough for enumeration but there is a problem somewhere, the driver sends a device descriptor and receives a zero length status packet but then the host resets it again and the cycle restarts, after 3 attempts the host gives up.
Probably there is something wrong while sending the descriptor.

I gave a try to a software analyzer but it is nearly useless for this kind of problems, any suggestion for a cheap USB analyzer? Alternatively could somebody make a trace and post it? (from plug insertion onward until the OS rejects the peripheral).

Giovanni

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Posted: Sun Jun 03, 2012 5:26 pm
by ErikZalm
Hello Giovanni,

Thanks for working on the USB driver.

I can make USB traces with an ellisys analyzer.

Do you want cvs traces or ellisys native format. You can download the software to view it from ellisys.
(http://www.ellisys.com/products/usbex200/download.php)

Erik

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Posted: Sun Jun 03, 2012 5:35 pm
by Giovanni
Thanks, I'll install the software.

Giovanni