ChibiOS/testhal/STM32F4xx/USB_CDC

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
henk
Posts: 2
Joined: Fri May 04, 2012 10:32 am

ChibiOS/testhal/STM32F4xx/USB_CDC

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Post 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
henk
Posts: 2
Joined: Fri May 04, 2012 10:32 am

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Post by henk »

Then, for a work in progress this already works pretty good.
E-B Felix
Posts: 9
Joined: Thu May 10, 2012 10:30 am

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Post 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
ErikZalm
Posts: 10
Joined: Fri May 11, 2012 9:10 pm

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Post 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
ErikZalm
Posts: 10
Joined: Fri May 11, 2012 9:10 pm

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ChibiOS/testhal/STM32F4xx/USB_CDC

Post by Giovanni »

Thanks, I'll install the software.

Giovanni
Post Reply