cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429 USB error code 10

thibault
Associate II
Posted on May 30, 2016 at 09:36

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-code10
3 REPLIES 3
slimen
Senior
Posted on May 30, 2016 at 16:36

Hi,

Refer to this

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32F104RG%20VCP%20error%20This%20device%20cannot%20start%28code%2010%29&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE...

https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/USB%20CDC%20Bug%20in%20CubeMX%20firmware&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21&currentviews=11170

and

https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/USB%20CDC%20Bug%20in%20CubeMX%20firmware&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21&currentviews=11170

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32F104RG%20VCP%20error%20This%20device%20cannot%20start%28code%2010%29&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE...

with same problem.I think it would be helpful for you.

''

I also have a similar problem solved

1) 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.

''

Regards

thibault
Associate II
Posted on May 30, 2016 at 17:07

Hi,

Yeah I already saw this discussion and tried the proposed solution but sadly no effect.

Best regards
thibault
Associate II
Posted on May 31, 2016 at 10:11

​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.