cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WBA65RI usb device on stm32WBA65RI-DK1

RPC
Associate III

Hello,

I'm trying to implement a usb cdc device on a stm32WBA65RI-DK1 board but seems like the only usb otg supported is the usb st-link port  CN6 that supports USB_OTG_HS. Using cube mx, Im trying to configure that usb as device with the vbus enable, to force that usb port to be powered through the usb, but the MX is not letting me do such thing. Can someone explain why I'm not able to enable it?

I wanted to ask if the CN5 connector could be enabled as USB_OTG_FS, although I dont see anything about that in the board manual nor in the mx.


Thanks in advance.

Best regards,

Rares

1 ACCEPTED SOLUTION

Accepted Solutions
TPITEL
ST Employee

Hello Rares,

The CN5 connector can be used as a USB_OTG_HS, you don't have to use the ST-Link one. You should be able to use it by enabling USB_OTG_HS on PD6 (USB_OTG_HS_DP) and PD7 (USB_OTG_HS_DM). If you need VBUS, it should be on PD9 so make sure you deactivate the led LD5 associated with PD9 in the GPIO section which is in conflict with it. You'll also need the USBX stack activated with CDC ACM device class in the Middleware section.

You can refer to the USBX examples available for NUCLEO-WBA65RI in the STM32WBA Cube Firmware package, they should work all the same on STM32WBA65I-DK1. You can also take a look at our USB Class audio github project on STM32WBA65I-DK1, which can give you a USBX standalone project on this discovery kit.

Best Regards,

Tom.

View solution in original post

5 REPLIES 5
TPITEL
ST Employee

Hello Rares,

The CN5 connector can be used as a USB_OTG_HS, you don't have to use the ST-Link one. You should be able to use it by enabling USB_OTG_HS on PD6 (USB_OTG_HS_DP) and PD7 (USB_OTG_HS_DM). If you need VBUS, it should be on PD9 so make sure you deactivate the led LD5 associated with PD9 in the GPIO section which is in conflict with it. You'll also need the USBX stack activated with CDC ACM device class in the Middleware section.

You can refer to the USBX examples available for NUCLEO-WBA65RI in the STM32WBA Cube Firmware package, they should work all the same on STM32WBA65I-DK1. You can also take a look at our USB Class audio github project on STM32WBA65I-DK1, which can give you a USBX standalone project on this discovery kit.

Best Regards,

Tom.

RPC
Associate III

Hello Tom,

Thank you very much for your response, it was very useful!

Best regards,

Rares

RPC
Associate III

Hello Tom,

After checking the examples of the nucleo about usbx, I noticed that it's necessary to have the threadx(freertos) enabled to use the usbx library. That was not the case of the old cdc class which could be used with and without freertos. 
Is there an option to use that older library or this one without an RTOS? Because I will be using the usb on baremetal.

Best regards,

Rares

TPITEL
ST Employee

Hello Rares,

The CDC ACM NUCLEO-WBA65RI project available in the firmware package uses ThreadX along with the USBX stack but it's also possible to use USBX in Standalone mode (baremetal, without ThreadX). You can check Ux_Device_HID_Standalone project also available in the same package to see how to use the standalone mode. There is also a Ux_Device_CDC_ACM_Standalone project available for STM32H7 in the x-cube-azrtos-h7 package if you want another example to help you develop your app. The USB Class audio app for STM32WBA Discovery kit I previously linked also uses USBX in standalone mode.

Best Regards,

Tom.

RPC
Associate III

Thank you very much, Tom.

Best regards!