cancel
Showing results for 
Search instead for 
Did you mean: 

usb library on windows 7 (does not work)

epataky
Associate II
Posted on May 01, 2014 at 18:46

I am trying to use the usb library found here:  

http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF257882#

I am on windows 7, I am using the port207z board here with the STM32f207z: 

http://www.wvshare.com/product/Port207Z.htm

I load the example under: 

\USB\stm32_f105-07_f2_f4_usb-host-device_lib\STM32_USB-Host-Device_Lib_V2.1.0\Project\USB_Device_Examples\VCP

or 

\USB\stm32_f105-07_f2_f4_usb-host-device_lib\STM32_USB-Host-Device_Lib_V2.1.0\Project\USB_Device_Examples\HID

In both cases, windows 7 cannot recognize the device, and even if install the driver it does not work .. i tried downloading some free usb trace software and it said enumeration failed ... 

ST told me the HID should work without needing to install any driver .. 

Has anyone gotten this to work on windows 7?
4 REPLIES 4
Posted on May 01, 2014 at 19:53

Have you ported it properly for your board? I have the VCP ported to several F2 and F4 board designs. Specific concerns would be the correct PLL settings for a 25 MHz HSE, the correct HSE_VALUE, and the correct 48 MHz Q-Tap from the PLL. The PLL must be running.

I have the VCP working in Windows 7 x64. It's important to use the correct 32-bit or 64-bit version of the 1.3.x VCP Driver.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
shorai
Associate III
Posted on May 15, 2014 at 12:07

Hi Ed,

Please let us know how you corrected this problem.

I have VCP_V1.3.1_Setup_x64  VCP driver loaded

I generated my code from Cube version 4.2.0

My clocks are defined 8MHz HSE, /8 *192 /4 for the 48MHz /Q clock

Windows reports ''Windows has stopped this device because it has reported problems (Code 43)''

Linux does not enumerate the device, there is no activity in dmesg

Any ideas?

Chris

Posted on May 15, 2014 at 20:24

I think you're grasping there, the Cube libraries are not the same as the V2.1.0 USB library examples, with a whole different set of issues. The OP likely had an Error Code 10

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
shorai
Associate III
Posted on May 16, 2014 at 07:57

Hi Clive,

Many thanks. Yes, I realise that the libs are different.

In the meantime, I went back to a new project which I started from the BOARDs tab rather than the MCU tab in Cube/New Project. I changed from a USB-OTG to Device Only and selected middleware for VCP.

This worked first time and installed the drivers correctly(well done to Cube developers). Yay I can go on with my project.

I then went back to the other project and it still has the same error(s) - so its a problem in my project, as you correctly  call.

I will get into the OP later today and try to find my error, which I will post back here. 

Many thanks for responding

Chris

Hi All

Update

The problems I had were resolved as follows

a) Clock dividers set to 8/336/7 in the USB (48MHz) chain\

b) In USB pin configuration, set VBUS on and SOF off

c) Config USB-FS set Global interrupt on, wakeup EXTI off

d) If you get a 'Device cant start (code 10) in Windows,

           Or in Linux you get device listed in lsusb, but no /dev/ttyACMx

     Then, if you are using HS device in FS mode you need to change the buffer length 

      from 512 to 64 in usbd_cdc.h at or about line 54

//#define CDC_DATA_HS_MAX_PACKET_SIZE        512  /* Endpoint IN & OUT Packet size */

#define CDC_DATA_HS_MAX_PACKET_SIZE         64  /* Endpoint IN & OUT Packet size */

 

                          

You probably 

I seem to remember reading that the 48MHz clock must be very accurate for USB to work.

 

Your project should now work 🙂

Chris