cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F7 HS over FS USB

sean thakur_2
Associate II
Posted on June 30, 2017 at 05:39

Board: Nucleo F746ZG

I configured USB for CDC Class over FS, and I was able to enumerate as a tty.usb serial device.

However, I need to configure HS over FS for an application. On STM32F4, I have been able to do so for the CDC class. Is there a limitation with F7 that does not allow for configuring HS over FS phy?

I referred to this doc, and HS over FS is not explicitly mentioned

http://www.st.com/content/ccc/resource/training/technical/product_training/group0/de/d3/cd/3d/72/0c/4d/4e/STM32F7_Peripheral_USB_OTG_FS_HS/files/STM32F7_Peripheral_USB_OTG_FS_HS.pdf/_jcr_content/translations/en.STM32F7_Peripheral_USB_OTG_FS_HS.pdf

 

However following alternate function for GPIO as defined in HAL libraries:

GPIO_AF12_OTG_HS_FS 

I have configured GPIOs PA11 and PA12 as DP, DM

Following Config does not enumerate:

   

/**USB_OTG_HS GPIO Configuration

   

PA12

   

------> USB_OTG_HS_DP

   

PA11

   

------> USB_OTG_HS_DM

   

*/

   

GPIO_InitStruct.

Pin

= GPIO_PIN_12|GPIO_PIN_11;

   

GPIO_InitStruct.

Mode

=

GPIO_MODE_AF_PP

;

   

GPIO_InitStruct.

Pull

=

GPIO_NOPULL

;

   

GPIO_InitStruct.

Speed

=

GPIO_SPEED_FREQ_VERY_HIGH

;

   

GPIO_InitStruct.

Alternate

=

GPIO_AF12_OTG_HS_FS

;

   

HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

   

/* Peripheral clock enable */

   

__HAL_RCC_USB_OTG_HS_CLK_ENABLE()

;

   

/* Peripheral interrupt

init

*/

   

HAL_NVIC_SetPriority(

OTG_HS_IRQn

, 6, 0);

   

HAL_NVIC_EnableIRQ(

OTG_HS_IRQn

);

Following Code enumerates:

/**USB_OTG_FS GPIO Configuration

   

PA12

   

------> USB_OTG_HS_DP

   

PA11

   

------> USB_OTG_HS_DM

   

*/

   

GPIO_InitStruct.

Pin

= GPIO_PIN_12|GPIO_PIN_11;

   

GPIO_InitStruct.

Mode

=

GPIO_MODE_AF_PP

;

   

GPIO_InitStruct.

Pull

=

GPIO_NOPULL

;

   

GPIO_InitStruct.

Speed

=

GPIO_SPEED_FREQ_VERY_HIGH

;

   

GPIO_InitStruct.

Alternate

=

GPIO_AF10_OTG_FS

;

   

HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

   

/* Peripheral clock enable */

   

__HAL_RCC_USB_OTG_FS_CLK_ENABLE()

;

   

/* Peripheral interrupt

init

*/

   

HAL_NVIC_SetPriority(

OTG_FS_IRQn

, 6, 0);

   

HAL_NVIC_EnableIRQ(

OTG_FS_IRQn

);

USB clock is off of PLLQ at 48 MHz

Please help clarify if HS over FS is supported in STM32F7

#usb-host-hs #usb #stm32f7
4 REPLIES 4
Khouloud GARSI
Lead II
Posted on June 30, 2017 at 10:44

Hi

godzilathakur@gmail.com

‌,

However, I need to configure HS over FS for an application.

Could you please clarify what do you mean exactly? Are you intending to configure the USB 2.0 high-speed/full-speed

device/host/OTG controller in FS mode?

0690X00000607ZcQAI.png

Khouloud.

sean thakur_2
Associate II
Posted on June 30, 2017 at 19:38

Hi Khouloud,

My CDC application has typically ran on STM32F4 in HS over FS configuration. e.g. for STM32F439, I would configure USB FS PHY in HS mode. This is allowed by ST HAL libraries. On F746ZG however, when I try to do the same by using configuration as I mentioned above, I am unable to get SETUP and ENUMERATION interrupts. 

I am trying to get an answer as to whether STM32F746ZG can in fact emulate HS over FS.

- Sean

Khouloud GARSI
Lead II
Posted on July 04, 2017 at 12:11

Hi

thakur.sushant

‌,

The STM32F746 and the STM32F439 devices embeds a:

  • USB 2.0 OTG FS = USB 2.0 FS device/host/OTG controller with on-chip FS PHY.
  • USB 2.0 OTG HS = USB 2.0 FS/HS device/host/OTG controller integrating the transceivers for FS operations and features an ULPI for HS operations: An external PHY device connected to the ULPI is required.

  1. If you want to perform HS operations, you need to add an external HS PHY.
  2. You may perform FS transfers:

  • On PA11/PA12 via the first controller described above.
  • On PB14/PB15 via the second controller described above.

I assume that, for your application, you want to use the second controller in FS mode. Thus, you should use PB14 and PB15 pins.

You may refer to

http://www.st.com/content/ccc/resource/technical/document/datasheet/96/ed/61/9b/e0/6c/45/0b/DM00166pdf/files/DM00166pdf/jcr:content/translations/en.DM00166pdf

,table12, to have a complete idea about the alternate functions mapping on the STM32F746 devices.

GPIO_InitStruct.Alternate = GPIO_AF12_OTG_HS_FS;

0690X00000607QjQAI.png

Khouloud.

sean thakur_2
Associate II
Posted on July 19, 2017 at 04:08

I could bring up CDC class over FS. It appears, FS over HS does not quite work well with STM32F7