CONTROL OUT transfer failed with Error Code:997

curEndpt.TimeOut = 25000;
success = curEndpt.XferData(ref buf, ref len);

if (success)
{
    OutputBox.Text += stat + " Write Success";
    BuildDataCaption();
    DisplayXferData(buf, len, true);

    OutputBox.SelectionStart = OutputBox.Text.Length;
    OutputBox.ScrollToCaret();
}
else
{
    OutputBox.Text += stat + " Transfer failed with Error Code:" + curEndpt.LastError + "\r\n";
    OutputBox.SelectionStart = OutputBox.Text.Length;
    OutputBox.ScrollToCaret();
}

windows error lookup:997 重叠 I/O 操作在进行中。
这里写图片描述
CyU3PUsbSendEP0Data (8, (uint8_t *)buf);
CyU3PUsbAckSetup ();

/** \brief Complete the status handshake of a USB control request.

    **Description**\n
    This function is used to complete the status handshake of a USB control
    request that does not involve any data transfer. If there is a need for
    OUT or IN data transfers to process the control request, the CyU3PUsbGetEP0Data
    and CyU3PUsbSendEP0Data calls should be used instead.

    This function should only be used if a positive ACK is to be sent to the
    USB host. To indicate an error condition, the CyU3PUsbStall call should be
    used to stall the endpoint EP0-OUT or EP0-IN.

    **Return value**\n
    * None

    **\see
    *\see CyU3PUSBSetupCb_t
    *\see CyU3PUsbRegisterSetupCallback
    *\see CyU3PUsbSendEP0Data
    *\see CyU3PUsbGetEP0Data
 */
extern void
CyU3PUsbAckSetup (
        void);

正确回应(发送的数据长度为0,8字节的最后两字节为0x00 0x00):
CONTROL OUT transfer
Zero-length data transfer completed

wLength:Number of bytes to transfer if there is a Data
stage.如果非0长度,但是没接收到所谓的非0数据(data stage),也会返回997错误。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值