cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U5A9J-DK1 USB Device question

Robertson.Jamie
Associate III

I'm attempting to implement a USB MSC Device using the USB_OTG_HS on a STM32U5A9J-DK1. I'm using the STM32CubeMX version 6.14.1 and STM32Cube_FW_U5_V1.7.0 to create a USBX stand-alone (without THREADX) MSC device. The project builds and runs, with successful initialization of the USBX device subsystem. However, connecting to a host does not trigger the OTG_HS_IRQHandler() interrupt. A couple of questions:

A call to MX_USB_OTG_HS_PCD_Init() is generated in main by CubeMX, but I don't find anywhere in the code where PA11 and PA12 are initialized to the USB_OTG_HS alternate functions.

Since enabling VBUS Sensing via PA9 is not an available option for this device in the CubeMX, and I see from the schematic that VBUS_SENSE is connected to PG1, I'm not at all clear how connection to a host is detected to fire the USB_OTG_HS interrupt.

The STM32Cube_FW_U5 only contains examples for USBX Host, so I'm not sure where to look for guidance.

 

 

 
1 ACCEPTED SOLUTION

Accepted Solutions
FBL
ST Employee

Hi @Robertson.Jamie 

PA11 and PA12 are kept in default state (analog mode).

Check section 8.2 USB Type-C® (High Speed, sink only) in UM2967.

Also you can find some examples on STM32H5 provided without threadx.

About how connection is detected, check Figure 926. Interrupt hierarchy in RM0456. This figure should summarizes the flow, monitoring the host status registers for changes in connection.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


View solution in original post

2 REPLIES 2
FBL
ST Employee

Hi @Robertson.Jamie 

PA11 and PA12 are kept in default state (analog mode).

Check section 8.2 USB Type-C® (High Speed, sink only) in UM2967.

Also you can find some examples on STM32H5 provided without threadx.

About how connection is detected, check Figure 926. Interrupt hierarchy in RM0456. This figure should summarizes the flow, monitoring the host status registers for changes in connection.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


Robertson.Jamie
Associate III

Thank you for the response. I did get it working in the meantime. I've successfully implemented a MSC Device using the Standalone USBX drivers as well as a (separate) CDC Device using the legacy USB drivers. Both work without using VBUS Sensing.