cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F207VGT6 OTG FS doesn't start

denlok
Associate II
Posted on August 12, 2011 at 19:06

Hello.I have a problem with starting OTG FS in Device mode.

I will try to adapt project example ''STM32_USB-FS-Device_Lib_V3.3.0'' for this STM32F-2 chip, but USB doesn't run.

For new chip I'll do next:

1. Prepare system_stm32f2xx.c file with ext. crystal 25mHz, 120mHz core, 48mHz for OTG module, flag ''require 48mHz for USB is setted.

2. Change OTG FS clocking enable to next string:

    _RCC_AHB2PeriphClockCmd(RCC_AHB2Periph_OTG_FS, ENABLE) ;

When I turn ON the clocking for OTG FS module by AHB2, the pin USBDP pulls up but, it looks like okey, but the counter part of HFNUM register (Upper word) will stay stopped. Is it good for this chip?

Because when I open the same project for STM32F107RCT6 chip and look on this register after enable OTG clock, the counter in HFNUM will run.

Maybe problem is in USB clocking settings?

Can I do else for right setup USB clocking except preparing system_stm32f2xx.c?

This project maked on my target board.
4 REPLIES 4
js23
Associate III
Posted on August 15, 2011 at 13:01

My init for FS USB:

  GPIO_PinAFConfig(GPIOA, GPIO_PinSource11, GPIO_AF_OTG_FS);

  GPIO_PinAFConfig(GPIOA, GPIO_PinSource12, GPIO_AF_OTG_FS);

  // Configure PA11/12 as alternate function push-pull for USB

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11 + GPIO_Pin_12;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;

  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_25MHz;

  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;

  GPIO_Init(GPIOA, &GPIO_InitStructure);

  // Enable USB clock

  RCC_AHB2PeriphClockCmd(RCC_AHB2Periph_OTG_FS, ENABLE) ;

Regards,

Johannes

i51211314
Associate II
Posted on August 16, 2011 at 07:01

js23
Associate III
Posted on August 16, 2011 at 10:40

The only thing that caused problems for me was that I had not connected VBUS to PA9 so I had to set NOVBUSSENS in GCCFG. Therefore I modified the OTG controller init code in the lib. But that was the only thing that caused problems (as far as I remember at the moment).

Hope this helps,

Johannes

i51211314
Associate II
Posted on August 16, 2011 at 11:46