RT,在usb_proc.c里初始化端点5
/* Initialize Endpoint 5 */
SetEPType(ENDP5, EP_BULK);
SetEPTxAddr(ENDP5, ENDP5_TXADDR);
SetEPRxAddr(ENDP5, ENDP5_RXADDR);
SetEPTxCount(ENDP5, BULK_MAX_PACKET_SIZE);
SetEPRxCount(ENDP5, BULK_MAX_PACKET_SIZE);
SetEPRxStatus(ENDP5, EP_RX_VALID);
SetEPTxStatus(ENDP5, EP_TX_NAK);
/* EP5 */ 0x20字节
/* rx/tx buffer base address */
#define ENDP5_TXADDR (0x120)
#define ENDP5_RXADDR (0x140)
usb_endp.c
定义下面函数
void EP5_OUT_Callback(void)
{
//接收数据
Data_Len = USB_SIL_Read(/*ENDP5*/EP5_OUT, Bulk_Data_Buff);
}
void EP5_IN_Callback(void)
{
}
当STM32接收到HOST的数据“63 00 00 00 00 00 01 00 00 00”后再将“81 00 00 00 00 00 01 00 00 00”数据返回给HOST
UserToPMABufferCopy(Transi_Buffer, ENDP5_TXADDR, 0x0a
SetEPTxValid(ENDP5); /* enable endpointx for transmission */
通过USB Monitor观察HOST没收到数据,
001722: Bulk or Interrupt Transfer (DOWN), 01.04.2011 13:50:30.218 +0.156
Pipe Handle: 0x872bf7f4 (Endpoint Address: 0x5)
Send 0xa bytes to the device
63 00 00 00 00 00 01 00 00 00 c.........
001725: Bulk or Interrupt Transfer (UP), 01.04.2011 13:50:30.406 +0.187. Status: 0xc000000c
Pipe Handle: 0x872bf7d4 (Endpoint Address: 0x85)
Get 0x0 bytes from the device HOST没接收到数据
如果STM32不运行这两句程序的话
UserToPMABufferCopy(Transi_Buffer, ENDP5_TXADDR, 0x0a
SetEPTxValid(ENDP5); /* enable endpointx for transmission */
通过USB Monitor观察不到下面这句的反应。
001725: Bulk or Interrupt Transfer (UP), 01.04.2011 13:50:30.406 +0.187. Status: 0xc000000c
Pipe Handle: 0x872bf7d4 (Endpoint Address: 0x85)
Get 0x0 bytes from the device HOST没接收到数据
请问有人清楚这种只能接收数据不能发送数据的情况问题是出在哪吗?
|