cancel
Showing results for 
Search instead for 
Did you mean: 

The USB-Device State on a STM32F7508-DK Self powered USB-Device doesn't work.

LS.Sp.1
Associate II

I use a STM32F7508-DK as a USB-Device only as MSC with an SDCard.

The Board is self powered.

STM says to use VBUS sensing on self powered Devices. But with VBUS sensing enabled, the USB connection isn't registered and the USB connection doesn't work at all.

Without VBUS sensing, the USB-Device connects and gets in to configured State. Data from the SDCard can be seen on PC and copied etc.

But after disconnecting the hUsbDeviceFS.dev_state shortly turns to suspended State but immediately turns back to Configured State.

The USB Suspended State Register

((USB_OTG_DeviceTypeDef *) (USB_OTG_FS_PERIPH_BASE+USB_OTG_DEVICE_BASE))->DSTS

does not get set to 1

How do i ge the VBUS sensing working on the STM32F7508-DK?

THX for helping!

1 ACCEPTED SOLUTION

Accepted Solutions
LS.Sp.1
Associate II

In the schematic "en.mb1191-F750N8H6-B02_schematic" on page 9 you can see that the GPIO Pin PJ12 is connected to the OTG_FS_VBUS. I used an external Interrupt on this pin to determine USB connection and disconnection.

View solution in original post

2 REPLIES 2
LS.Sp.1
Associate II

The "UM1907 User manual Discovery kit for STM32F7 Series with STM32F746NG MCU"

on Page 34 says

1. By default OTG_FS_VBUS is driven by the software and not by the alternate function of the

STM32F746NGH6 (R64 = ON, R63 = OFF, R58 = ON and PA9 = VCP_TX (Virtual Com Port) and PJ12 =

OTG_FS_VBUS).

To use the alternate function OTG_FS_VBUS of the STM32F746NGH6, it is needed to have: R64 = OFF,

R63 = ON, R58 = OFF. In this configuration, VCP_TX is no longer available and PA9 = OTG_FS_VBUS,

PJ12 = not connected

So to get the VBUS sensing working, I have to solder some Resistors.

This is not possible in my case.

So i would like to use a software solution. But I still have the Problem with the dev_state turning to USBD_STATE_CONFIGURED after disconnecting the board from the PC.

The functions:

USBD_LL_DevConnected(USBD_HandleTypeDef *pdev)

USBD_LL_DevDisconnected(USBD_HandleTypeDef *pdev)

do not get called on connecting or disconnecting.

LS.Sp.1
Associate II

In the schematic "en.mb1191-F750N8H6-B02_schematic" on page 9 you can see that the GPIO Pin PJ12 is connected to the OTG_FS_VBUS. I used an external Interrupt on this pin to determine USB connection and disconnection.