2011-08-03 02:48 AM
I have a big problem with configuration of USB on STM32f105VBT6. I'm trying to run HID example from ST USB Library but it doesn't respond at all. Message that I get is USB Device not recognized. I've tried to run the same code on EVAL3210B and it worked correctly. In example from STM code is prepared for EVAL3210C and processor STM32f107, maybe there is a difference between 105 and 107? Did anyone have similar issue? How to resolve this?
#stm32-stm32f105-usb2011-08-03 09:24 AM
There is no difference in USB between F105 and F107.
If USB causes problems, the first thing I would suggest to check is the clock setting: When using the ST-LIb it is necessary to use an external 25MHz clock to derive the 48MHz USB clock. So make sure that is stable and frequency is within 0,5%. Hope this helps, Johannes2011-08-03 12:46 PM
2011-08-04 02:57 AM
Of course it is possible to use a 8MHz crystal. But then the PREDEV and PLLMUL settings have to be modified in the code of the lib. (This is what you already did?)
To verify that was done correctly, you might output the SYSCLK on the MCO pin. When using USB this always has to be 72MHz or 48MHz.
2011-08-08 02:39 AM
Hi,
I am having the same problem of not recognised by Windows XP when my USB HID application (running under STM32F103VB and Keil's RL-ARM). I checked the clock coming out from MCO pin and is 72 MHz.
I also checked that I had enabled the USB in RCC_APB1ENR, as well as set the USBPRE to PLLCLK/1.5 in RCC_CFGR register.
I wonder, besides clock, what else can lead to the unrecognisation issue?
I sincerely appreciate somebody can share their experience with me.
Thank you.
CB
2011-08-08 03:46 AM
My personal USB checklist looks like that:
1. Make sure that hardware is working On F105/107/2xx the internal boot loader supports USB and can be used for this purpose. Simply pull BOOT0 high and attach to PC. If the device is recognised by the DFuSe tool, hardware is OK and any further problems have to be searched in the SW. According to the manual, the bootloader supports 8Mhz and 25MHz HFE. Note: Check erratasheet for specific device - there are some known problems with the bootloader.2. Connecting to PC has no effect at all This is the case when the 1.5k pullup for soft disconnect is not activated. If step 1 showed that HW is working then the only reason can be that the USB driver is not running. Therfore IRQ config should be checked. Another reason could be that the compiler setting is wrong (Lib compiled for connectivity line devices?) Or maybe simply the clock for USB peripherial was not enabeld?3. Connecting to PC shows popup ''Device not recognized''USB clock is not configured for 48MHz or IRQs are not configured correctly. Make sure that the USB IRQ routine in the lib gets called by placing a breakpoint. Remember that Stop mode cannot be used when using USB. Unfortunately step 1 is not possible for F103. If an eval board is used, the HW can be assumed as running. But maybe one should never assume anything... Hope this helps, Johannes
2011-08-08 02:39 PM
Do you have PA9/USB_OTG_VBUS connected to +5V? This is required for USB device to work.