cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 USB FS and PA8 as output not working

Kuikui
Associate III
Posted on May 17, 2017 at 15:52

Hi,

I'm using the STM32F446ZE.

I'm using PA11 and PA12 for USB FS DM and DP, but I don't need PA8 as SOF, I need it as a simple output.

USB is runing fine only if PA8 = 0 !

If I set PA8 output to 1, the USB disconnects.

It looks like the PA8 is in Alternate function mode, but after double-check, the PA8 mode is in Output mode ( MODER8 = 1, AFR8 = 0 ).

Did someone already faced this issue ?

Thanks and best regards,

Vincent.

#usb-fs #stm32f4
27 REPLIES 27
Posted on June 08, 2017 at 15:02

Hi

Waclawek.Jan

‌,

Does that mean that SOF is not available on PA8 for OTG_FS and PA4 on OTG_HS?

And that they both are not available as optional input to TIM2_ITR1 ?

->The OTG_FS_SOF and OTG_HS_SOF are available as alternate functions respectively on PA8 and PA4 pins.

Or does this mean that SOF is available out from OTG_FS/OTG_HS at all times, regardless of how OTG_GCCFG bit 20 is set; and it is gated only at the GPIO/TIM2 level?

-> Correct.

Is this a 'F446-specific change, as compared to other 'F4 and 'L4 and 'F2 and 'F7?

->The modification is for devices where GCCFG configuration register is different from:

0690X00000607H9QAI.png

The register is defined differently, so a new configuration should be applied.

Khouloud.

Posted on June 08, 2017 at 16:14

Khouloud

Thanks for the explanation.

I am using STM32F407. In RM0090, the OTG_FS_GCCFG register is different from what you've shown above:

0690X00000607HcQAI.png

Does this mean that for OTG_FS in STM32F407 SOFOUTEN is not available?

---

Also, once mentioned, the I2CPADEN (which *is* present in the 'F407's OTG_HS_GCCFG) appears to enable some extra functionality which has no explanation in the RM, can you please go into further details? Onto which pins are the mentioned I2C pads connected?

Thanks,

Jan

Posted on June 09, 2017 at 11:45

Hi Jan,

  • Regarding my previous comment: The modification is for devices where GCCFG is different from OTG_FS_GCCFG:
0690X00000607IlQAI.png

      I have given the OTG_HS_GCCFG figure by mistake.

      For the F407, the SOFOUTEN bit is available in FS and HS modes.
  • The USB OTG HS core embeds an I2C interface allowing to connect an external FS PHY.

    The I2CPADEN is used to enable or disable the I2C bus connection for this interface.

Khouloud.

Posted on June 09, 2017 at 11:54

Hi Khouloud,

Thanks for the clarification.

The USB OTG HS core embeds an I2C interface allowing to connect an external FS PHY.

The I2CPADEN is used to enable or disable the I2C bus connection for this interface.

On which pins?

Can you please give an example of such FS PHY and its connection to the 'F407?

Thanks,

Jan

Posted on June 09, 2017 at 12:10

Hi Jan,

Could you please create a new thread regarding this. 

Khouloud

Posted on June 09, 2017 at 13:18

Hi Vincent,

Using the ''CustomHID_Standalone'' example, I have:

  • Disabled the VBUS sensing : hpcd.Init.vbus_sensing_enable = 0;
  • Connected the PA9 (configured as input) to GND.
  •  Using F446_EVAL board.

-> I'm not able to reproduce the issue. The device is correctly enumerated as an HID compliant one.

So,again, I advise you to verify your hardware connection. Are you respecting the required connection showed below:

0690X00000607IkQAI.png

Khouloud.

Posted on June 09, 2017 at 13:32

https://community.st.com/0D50X00009XkaCPSAZ

Posted on June 15, 2017 at 14:31

Hi Khouloud,

Thank you for your answer.

I'm sure the hardware part is OK, since I can program my boards using DFU, and since I can make USB HID working fine as long as PA9 is set as OUTPUT and 1.

So for me, there's only a software problem for disabling the VBUS sensing feature.

As I lack time to look deeper at STM32F4Cube, I will wait for the update of the SPL.

Do you know when the VBUS sensing feature will be fixed in the SPL ?

Thanks.

Best regards,

Vincent.