esp-iot-solution icon indicating copy to clipboard operation
esp-iot-solution copied to clipboard

How to change usb host cdc baudrate? (AEGHB-610)

Open Kevincoooool opened this issue 10 months ago • 3 comments

Answers checklist.

  • [X] I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • [X] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • [X] I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

This is set dtr\rts:

#define USB_CTRL_REQ_CDC_SET_LINE_STATE(ctrl_req_ptr, itf, dtr, rts) ({  \
        (ctrl_req_ptr)->bmRequestType = 0x21;   \
        (ctrl_req_ptr)->bRequest = 0x22;    \
        (ctrl_req_ptr)->wValue = (rts ? 2 : 0) | (dtr ? 1 : 0); \
        (ctrl_req_ptr)->wIndex =  itf;    \
        (ctrl_req_ptr)->wLength = 0;   \
    })

But how to set baudrate?Now I test the cdc transfer speed is about 11 kb/s,that means the normal baudrate is 115200. So if there is one way to set baudrate,that's perfect.

Kevincoooool avatar Apr 05 '24 04:04 Kevincoooool

@Kevincoooool The SET_LINE_STATE and SET_LINE_CODING only used to set the UART's params of USB-to-UART device. For common USB CDC device, this configuration won't affect the speed of the USB side.

leeebo avatar Apr 06 '24 14:04 leeebo

@Kevincoooool The SET_LINE_STATE and SET_LINE_CODING only used to set the UART's params of USB-to-UART device. For common USB CDC device, this configuration won't affect the speed of the USB side.

Yes, but i need to set baudrate for USB-to-UART device....

Kevincoooool avatar Apr 13 '24 02:04 Kevincoooool

@Kevincoooool using cdc_acm_host_line_coding_set for baudrate and databits set.

leeebo avatar Apr 15 '24 01:04 leeebo

@Kevincoooool using cdc_acm_host_line_coding_set for baudrate and databits set.

The demo can not work

Kevincoooool avatar May 27 '24 05:05 Kevincoooool