Using CP210x in Linux embedded platform, when host sends requests to CP210x, it returns below error:
"cp210x ttyUSB1: failed set request 0x7 status: -32"
How to interpret the error message?
Table 6 Interface Commands in AN571 lists all API commands that CP210x device supports. Viewing from this Table, request of 0x7 represents SET_MHS command, which is used to set modem handshaking (DTR and RTS lines) states.
The negative error is returned by the underlying call to usb_control_msg() from the cp210x.c driver.
If this function is not successful, a negative error number is returned.
How does CP210x handle the SET_MHS request from host?
For CP210x SET_MHS (0x07) command, as AN571 stated, the DTR and RTS values can be set only if the current handshaking state of the interface allows direct control of the modem control lines.
When the device receives the SET_MHS command intending to change the state of DTR or RTS pin, CP210x device will then check current Flow Control setting in the device base on the SET_FLOW() from host, and then make a different response.
If the hardware Flow Control is currently enabled, it means the handshaking lines have been managed by the CP210x device itself rather than host, the device will not response the current SET_MHS request, and a STALL would be returned.
I have this error and am trying to fix it. From your post and AN571:
"The DTR and RTS values can be set only if the current handshaking state of the interface allows direct control of the modem control lines"
What does this mean? Does this mean some of the flow control lines (DTR,DSR,DCD,RI,CTS,RTS) are in a bad state?
Now my drivers can not work on ttyUSB1, at first. there is no ttyUSB1 interface. after i changed num_port from 1 to 2. I can find ttyUSB1.
But it can not be read by serial port read cmd. Is there any suggestion? thanks.