USB HOST get report feature #2044
Replies: 2 comments
-
I solved it with call tuh_control_xfer() |
Beta Was this translation helpful? Give feedback.
0 replies
-
@sadykowich could you explain how you solved it ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
i'm using an RP2040 as USB HOST, and i would like send a GetReport control request to USB device. This is works on Arduino with USB HOST (by Felis) library with this:
pUsb->ctrlReq(dev_addr, ep_addr, bmREQ_HID_IN, HID_REQUEST_GET_REPORT, reportId, reportType, 0x00, 64, 64, buffer, NULL);
(dev_addr=1, ep_addr=0, reportType=0x03)
I tried it with TinyUSB:
const tusb_control_request_t xfer_ctrl_req = {
.bmRequestType_bit.recipient = TUSB_REQ_RCPT_INTERFACE,
.bmRequestType_bit.type = TUSB_REQ_TYPE_CLASS,
.bmRequestType_bit.direction = TUSB_DIR_IN,
.bRequest = HID_REQ_CONTROL_GET_REPORT,
.wValue = (HID_REPORT_TYPE_FEATURE << 8) + cR.usbRequest.reportId,
.wIndex = 0,
.wLength = cR.usbRequest.reportLen
};
tuh_xfer_t xfer;
xfer.daddr = dev_addr;
xfer.ep_addr = ep_addr;
xfer.setup = &xfer_ctrl_req;
xfer.buffer = &cR.buf[0];
xfer.buflen = cR.usbRequest.reportLen;
xfer.actual_len = 0;
xfer.complete_cb = NULL;
bool b = tuh_control_xfer(&xfer);
but i got the followings:
[0:1] Class Request: 47 30 BF FD E7 F4 46 00
hw_endpoint_init dev 1 ep 0 out xfer 0
dev 1 ep 0 out setup buffer @ 0x50100180
endpoint control (0x50100100) <- 0xa0000180
Transfer complete
Sent setup packet
on EP 00 with 8 bytes
hcd_edpt_xfer dev_addr 1, ep_addr 0x0, len 70
Prepare BufCtrl: [0] = 0xb440 [1] = 0xc406
Stall REC
on EP 00 with 0 bytes
[0:1] Control STALLED, xferred_bytes = 0
Could you check what could be the problem? The response is STALLED. What is wrong?
Many thanks,
Peter
Beta Was this translation helpful? Give feedback.
All reactions