2017-12-31 04:58 PM
I have some questions about usb implementation (both hw and fw). My controller is STM32F373VC and I use STM32CubeF3 v1.9.0
Bus 008 Device 009: ID 0483:5740 STMicroelectronics STM32F407
I wondered if I could use the VID and PID for a product that are present in the example (0483:5740
) or I have to change them. If I have to change them, are I obliged to request them from the usb consortium? or are they freely usable?best regards
Max
#usb #cdc #stm32-f32018-01-03 12:39 AM
1. The STM32_USB_Device_Library that is shipped with STM32CubeMX only supports one configuration and one interface, therefore it's not suitable for composite device implementation. This limitation doesn't apply to the hardware itself, and it has enough endpoints and packet memory to support your application needs. There are commercial USB device drivers that support multiple interfaces, you can check the list
.2. The Vendor IDs are assigned by the USB Consortium, so for commercial use you either buy one, or find a partner with an appropriate licence who can allocate Product IDs for you. If you are developing an open-source device, you may use one of these services:
http://wiki.openmoko.org/wiki/USB_Product_IDs
3. The CDC class is only complex in its descriptor, the actual data transfer is very straightforward: you can directly use USBD_LL_PrepareReceive() and USBD_LL_Transmit() functions to receive and transmit data through the VCP (packetizing is handled by the HAL, so you can call these with any length). Of course you should still rely on the CDC receive callback and TxState to determine if the previous transfer has completed.
2018-01-31 08:06 AM
Hello
cialdi
,There is a composite example proposed under
.In the example, the independent interfaces are : Mass Storage (MSC) and Custom HID.
Itcould befound under the path below: STM32_USB-FS-Device_Lib_V4.1.0\Projects\Composite_Examples\MSC_HID_Composite
I'd highly recommend you to take it as a reference.Khouloud.