This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new a60ee84197b arch/arm/src/common/stm32: accept interface-recipient 
GET/SET_DESCRIPTOR
a60ee84197b is described below

commit a60ee84197ba6ab0b6d81d6b5a24d4f8e40bb7f7
Author: Huskya <[email protected]>
AuthorDate: Tue Sep 8 12:46:43 2026 +0000

    arch/arm/src/common/stm32: accept interface-recipient GET/SET_DESCRIPTOR
    
    HID class devices fetch the HID Report Descriptor with a
    GET_DESCRIPTOR setup packet whose recipient is an interface
    (bmRequestType 0x81, wValue 0x2200).  stm32_ep0out_stdrequest() only
    dispatches device-recipient descriptor requests and stalls the rest,
    so HID class devices cannot enumerate.  Dispatch interface-recipient
    requests to the class driver as well.
    
    Signed-off-by: Huskya <[email protected]>
---
 arch/arm/src/common/stm32/stm32_otgfsdev_m3m4_v1.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/src/common/stm32/stm32_otgfsdev_m3m4_v1.c 
b/arch/arm/src/common/stm32/stm32_otgfsdev_m3m4_v1.c
index 34dd2e726c2..a9724600c61 100644
--- a/arch/arm/src/common/stm32/stm32_otgfsdev_m3m4_v1.c
+++ b/arch/arm/src/common/stm32/stm32_otgfsdev_m3m4_v1.c
@@ -2447,7 +2447,9 @@ static inline void stm32_ep0out_stdrequest(struct 
stm32_usbdev_s *priv,
         {
           usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_GETSETDESC), 0);
           if ((ctrlreq->type & USB_REQ_RECIPIENT_MASK) ==
-              USB_REQ_RECIPIENT_DEVICE)
+              USB_REQ_RECIPIENT_DEVICE ||
+              (ctrlreq->type & USB_REQ_RECIPIENT_MASK) ==
+              USB_REQ_RECIPIENT_INTERFACE)
             {
               stm32_req_dispatch(priv, &priv->ctrlreq);
             }

Reply via email to