cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F042K6 USB init. for VCP com. - ''This device cannot start (code 10)''

rohanne
Associate II
Posted on January 15, 2015 at 12:39

Hi all,

I have a problem with USB initialization for VCP communication using STM32F042K6. I used STSW-STM32092 package for F072 (Virtual_COM_Port file).  I create my own board at this moment mounted on breadboard - 2x33

�F for XTAL (not have 5-20

�F

)

 .

Firstly there was a problem in function USBD_Init -> 

DCD_DevConnect -> *BCDR|=BCDR

_

DPPU - enabling pull-up resistor on USB DP line - always got into 

HardFault

_

Handler, therefore I add external 1k5 resistor and now the device is recognized as FS device in my Win7 as intended, but still shows ''

This device cannot start (code 10)

''.

What I have already tried: 

�  I changed startup file for appropriate.

�  I tried to change the value of Stack_Size and Heap_Size.

�  I tried increasing & decreasing values in usbd_conf.h, usb_conf.h:

Endpoint IN & OUT Packet Size, max string

Descriptor Size, number of Endpoints used by the device etc.

�  Clock setting is configured (LEDs blink).

So my question is, what should I do to figure it out? Secondly, why there is the problem with enabling pull-up on DP line? Thanks in advance.

Jan

#stm32f0 #vcp #cdc #usb #stm32
2 REPLIES 2
erisson
Associate II
Posted on January 15, 2015 at 13:31

I had the same problem

Tip:

Connect a serial USB on your computer that recognizes

(As a USB-Serial cable for example)

And see which Windows driver that it uses.

(In my case was Serenum.sys rather than Usbser.sys)

See my topic:

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fcortex_mx_stm32%2fSTM32F103RBT6%20-%20USB%20DRIVER&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https%3A%2F%2Fmy...

Then locate the file (.inf) normally in:

C: \ Program Files \ STMicroelectronics \ Software \ Virtual COM Port Driver \ stmcdc.inf

Edit the file by changing the name (Usbser.sys) the driver recognizes.

Try adding the new driver in Device Manager.

Add new legacy driver and locating the file (stmcdc.inf) modified.

rohanne
Associate II
Posted on January 15, 2015 at 14:48

Thanks for response. I tried both available versions of VCP driver (v1.3.1 and v1.4.0) for my 64bit Win7. 

I am not sure I understand the ''adding a new legacy driver with the *.inf file''.

I renamed all of usbser

 to 

serenum

, then 

I uninstalled the driver in Device Manager and re-pluged the usb connection -> then automatic driver instalation launched, 

but finally message 

''Device driver software was not succesfully installed'' showed up. So I still think it's the code matter.