USB descriptors larger than 127 bytes don't work (STM32 OTG)

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.
User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: USB descriptors larger than 127 bytes don't work (STM32

Postby Giovanni » Thu May 01, 2014 11:48 am

HI,

I committed an experimental fix in the *trunk*, could you confirm it solves your problem?

Giovanni

avrhack
Posts: 140
Joined: Tue Dec 24, 2013 1:42 pm
Has thanked: 17 times
Been thanked: 3 times

Re: USB descriptors larger than 127 bytes don't work (STM32

Postby avrhack » Thu May 01, 2014 5:46 pm

Giovanni wrote:HI,

I committed an experimental fix in the *trunk*, could you confirm it solves your problem?

Giovanni


Excellent Giovanni thanks. And yes I can confirm that it solves the problem on an STM32F4DISCOVERY with 2.6.3 at least.

Testing I did was to run it against the stable 2.6.3 snapshot (I add tags to your full git repo clone that I keep) and it worked <127, confirmed it failed >127 against 2.6.3. Applied the HLD patch and it worked, then removed that patch, confirmed it failed and then finally applied your LLD (which I made as a quick patch from diffs on your main trunk) and it worked again with a descriptor of length 141.

So I think that's a pretty conclusive test confirming that things fail against 2.6.3 and work with either the HLD patch or your new proper fix of the LLD.

Much appreciated!

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: USB descriptors larger than 127 bytes don't work (STM32

Postby Giovanni » Thu May 01, 2014 7:17 pm

Very well, I will merge the change in 2.6.4 and 3.0.0.

Thanks,
Giovanni

avrhack
Posts: 140
Joined: Tue Dec 24, 2013 1:42 pm
Has thanked: 17 times
Been thanked: 3 times

Re: USB descriptors larger than 127 bytes don't work (STM32

Postby avrhack » Thu May 01, 2014 8:46 pm

Giovanni wrote:Very well, I will merge the change in 2.6.4 and 3.0.0.

Thanks,
Giovanni


Excellent thanks!

etmatrix
Posts: 46
Joined: Sun Oct 21, 2012 10:05 pm

Re: USB descriptors larger than 127 bytes don't work (STM32

Postby etmatrix » Sat May 10, 2014 9:05 am

@avrhack have you an example? I tring with branch 2.6.4 but with my dualcdc example I have an error.

Code: Select all

usb 4-2.1: configuration #1 chosen from 1 choice
usb 4-2.1: can't set config #1, error -110


Single CDC is working without problem.
The error message is different from my previous thread viewtopic.php?f=3&t=699

Thank you

avrhack
Posts: 140
Joined: Tue Dec 24, 2013 1:42 pm
Has thanked: 17 times
Been thanked: 3 times

Re: USB descriptors larger than 127 bytes don't work (STM32

Postby avrhack » Sat May 10, 2014 10:11 am

etmatrix wrote:@avrhack have you an example? I tring with branch 2.6.4 but with my dualcdc example I have an error.

Code: Select all

usb 4-2.1: configuration #1 chosen from 1 choice
usb 4-2.1: can't set config #1, error -110


Single CDC is working without problem.
The error message is different from my previous thread viewtopic.php?f=3&t=699

Thank you


I don't have a simple main.c I can send as it's got a whole load of other stuff in there, but I've attached the usb descriptor / callbacks which are a modified version of Giovani's original single-CDC demo. Hopefully if you compare with yours / plug these in you'll get it working. If not let me know and I'll try and hack up a main.c to go with it that is just the CDC parts :)

usbcfg.zip
(3.85 KiB) Downloaded 248 times

etmatrix
Posts: 46
Joined: Sun Oct 21, 2012 10:05 pm

Re: USB descriptors larger than 127 bytes don't work (STM32

Postby etmatrix » Sat May 10, 2014 10:58 am

Thank you avrhack for your source, while I see the difference, I have found the problem. SDU2 is not initiliazed, so this make problem to usb init.

avrhack
Posts: 140
Joined: Tue Dec 24, 2013 1:42 pm
Has thanked: 17 times
Been thanked: 3 times

Re: USB descriptors larger than 127 bytes don't work (STM32

Postby avrhack » Sat May 10, 2014 11:56 am

etmatrix wrote:Thank you avrhack for your source, while I see the difference, I have found the problem. SDU2 is not initiliazed, so this make problem to usb init.


Excellent. And if it's any consolation I spent ages trying to figure out why things didn't work - the initialisation and order of that is particularly critical.

Great that you've got it working though as it gives a second confirmation to my testing of Giovani's fix in 2.6.4.


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 7 guests