2016-05-30 12:36 AM
Hi Everyone,
I'm currently working on a STM32F429NIH6 with the Cube library and I have some issue with the USB. I configured it as a cdc connection in device mode only. The problem is that on certain USB port (PC side) its working well, I send and recieve data correctly. But on other USB port I got the following error in the device proprety on windows : ''This device cannot start. (Code 10)''. I tested on more than just my PC and it's the same everywhere, some USB work and some don't. The version of the USB (v2 or v3) seems to have no direct influence, some USB3 work whereas other don't. Same for USB2. I ran out of idea, do some of you have any clue about this issue? Here are some additionnal information : * The PCB is custom * I generated the USB code with CubeMX v4.13.0 * The Cube library I use is v.1.2.1 * USB uses pins A12..11 without vbus. * USB is in Full Speed mode * USB uses intern PHY Thanks in advance and best regards edit : added some extra information #usb-stm32f-code102016-05-30 07:36 AM
Hi,
Refer to this and with same problem.I think it would be helpful for you. '' I also have a similar problem solved1) Increase the heap and the stack size.
2) If you use the embedded phy of the HS port, change the buffers size and HS max packet size from 512 to The maximum packet size for full speed devices is 64 bytes. I guess that maybe HS on the STM32 HAL drivers stands for HS port , not for HS mode.''
Regards2016-05-30 08:07 AM
Hi,
Yeah I already saw this discussion and tried the proposed solution but sadly no effect. Best regards2016-05-31 01:11 AM
​Hi,
It's ok I found the problem, bye. Naah, just kidding, here is the explanation for future purpose. It was indeed the max_packet_size problem forumstm32 mentioned and I was not lying while saying that I already tested this option. The problem was that this variable is defined twice in the code. Once in Core/Inc/usbd_def.h and once in Class/CDC/Inc/usbd_cdc.h. The variable in usbd_def.h isn't used at all, the useful one is in usbd_cdc.h and guess what, I kept changing the useless one. And yes I known that the file location was mentioned in the discussion, but I think my brain just ignored this information. Anyway, thanks for pointing me again to this solution. Have a great day. Bye.