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: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

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

Post by Giovanni »

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

Post by avrhack »

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: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

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

Post by Giovanni »

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

Post by avrhack »

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

Post by etmatrix »

@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

Post by avrhack »

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 566 times
etmatrix
Posts: 46
Joined: Sun Oct 21, 2012 10:05 pm

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

Post by etmatrix »

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

Post by avrhack »

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.
Post Reply