
STM32_USB-FS-Device_Lib_V4.1.0 file :usb_core.c funciton name: RESULT Standard_ClearFeature(void) code : if (wIndex0 & 0x80) { /* IN endpoint */ if (_GetTxStallStatus(Related_Endpoint )) { ClearDTOG_TX(Related_Endpoint); SetEPTxStatus(Related_Endpoint, EP_TX_VALID); } } else { /* OUT endpoint */ if (_GetRxStallStatus(Related_Endpoint)) { if (Related_Endpoint == ENDP0) { /* After clear the STALL, enable the default endpoint receiver */ SetEPRxCount(Related_Endpoint, Device_Property.MaxPacketSize); _SetEPRxStatus(Related_Endpoint, EP_RX_VALID); } else { ClearDTOG_RX(Related_Endpoint); _SetEPRxStatus(Related_Endpoint, EP_RX_VALID); } } } question: i saw that status of IN endpint was set to VALID(EP_TX_VALID) after recover from HALT; i wonder why we don't set the status to NAK; The USB spec doesn't specify how to leave the endpoints after a halt is cleared. but for an interrupt IN endpoint such as a HID device,at that point when the endpoint recover from halt status,the device will send an packet with uncertain data to the host,since the host automatically query the device by IN token in a determined interval constantly,and it can be quite possible for the packet buffer contains uncertain data at that point; possible advice: just set the status to NAK,firmware could set it to VALID if necessary data get ready to transfer to host later. 主要意思是在一个端点从HALT状态恢复后,发送是有效的,那样的话,比如对于一个中断型的IN端点,会自动发给主机一个数据包,这个数据包的内容是不定的,很可能包含未知的数据; 疑问就是为何不在端点恢复后将发送端点设置为NAK,在固件准备好数据后在由固件设为VALID。 |
ART-PI H750-USB-MSC 设备描述符异常
stm32h743 usbh msc 读写 u盘 新购买的 u盘只能识别到但不能进行读写 ?
stm32哪个系列芯片支持2个USB,主设备,且usb可以支持标准的uvc协议,哪里可以下载usb开发库
新手小白,SMT32 TP Tool Windows无法安装驱动怎么处理
如何用c#使用ST25R3911DISCOComm.dll来读取和写入NDEF区的数据,需要相关例程,感谢各位大佬拯救一下我啊!????
USBx配置有哪些小的需要注意的细节?
H743ZIT6 USB虚拟串口 CDC电脑无法识别(获取描述符失败)
STM32F407的高速USB,采用的是虚拟串口方式,VCP驱动有linux系统的吗
STM32H533的USB使用问题
stlink 串口驱动安装前面有叹号软件里无法找到