STM32F4 USB device retrieve interface descriptor (setup stage)
MCU: STMF32F401CCU6
On a Black pill board.
STM32CubeIDE
Version: 1.10.1
Build: 12716_20220707_0928 (UTC)
OS: Linux, v.5.15.0-46-lowlatency, x86_64 / gtk 3.24.33
Java vendor: Eclipse Adoptium
Java runtime version: 11.0.14.1+1
Java version: 11.0.14.1
Ubuntu 22.04.01
The device code is based on the CDC class
The device is just plugged in, no drivers are using it. After plugging in the device Linux transacted the the address (0x05) and configure (0x09) and retreved the string descriptors successfully.
No drivers are install as the class in not CDC but a custom class.
Using (linux) Libusb function (written in C code) to retrieve an class specific intetrface descriptor. Type:0x81 Request 0x06, Value:0x2601 . This fails
Added debug code in USBD_StatusTypeDef USBD_LL_SetupStage in usbdcore.c. All seems fine and this function is reached for retrieving device descriptor, serialnumber etc.. (request type 0x80). (See tranasctions below)
When making a USB transfer with bRequestType 0x81 or 0x82 (interface or endpoint ) This function is not called. Example: Type:0x81 Request 0x06, Value:0x2601.
Libusb return an error -1: Input/Output Error
When changing this call to retrieve a device descritpor: Type:0x80 Request 0x06, Value:0x2601 the USBD_LL_SetupStage function is reached.
Any hints how to debug the HAL code why this is ?
Trying to figure out if this is due to uslib or the HAL code.
Per UM1734 p 17 :Most of the requests specified in Table 4 of the USB specification are handled as standard requests in the library. Table 4 lists all the standard requests and their valid parameters in
the library. Requests that are not in Table 4 are considered as non-standard requests.
Thus: it states that CONFIGURATION 0x80 are standard, As such 0x81 is non standard,
The library passes all the non-standard requests to the class-specific code with the
callback pdev->pClass->Setup (pdev, req) function. user code is responsible, in the pdev->pClass->Setup (pdev, req) to parse the content of the SETUP packet (req). If a request is invalid,
.. but ,, it seems USBD_StatusTypeDef USBD_LL_SetupStage is never called to handle this.
USBD_ClassTypeDef does contain the pointer to the function.
