本帖最后由 hmjack2008 于 2013-1-23 12:44 编辑
请问一件事:
stm32 USB FS Device Lib (v3.4.0)中的范例:
Custom_HID与Mass_Storage范例中的 #define ENDP0_RXADDR (0x18) 是否与ENDP1_RXADDR或ENDP2_RXADDR 地址重迭了吗 ??
因为按照PMAAddr 起始地址0x40006000计算如下:
EndPoint | Direction | Register | Length | PMA_Addr_Begin | PMA_Addr_End | 40006000 | | | Hex | Hex | Hex | EP0 | Tx0 | AddrTx0 | 4 | 40006000 | 40006003 | | | CountTx0 | 4 | 40006004 | 40006007 | | Rx0 | AddrRx0 | 4 | 40006008 | 4000600B | | | CountRx0 | 4 | 4000600C | 4000600F | EP1 | Tx1 | AddrTx1 | 4 | 40006010 | 40006013 | | | CountTx1 | 4 | 40006014 | 40006017 | | Rx1 | AddrRx1 | 4 | 40006018 | 4000601B | | | CountRx1 | 4 | 4000601C | 4000601F | EP2 | Tx2 | AddrTx2 | 4 | 40006020 | 40006023 | | | CountTx2 | 4 | 40006024 | 40006027 | | Rx2 | AddrRx2 | 4 | 40006028 | 4000602B | | | CountRx2 | 4 | 4000602C | 4000602F | 但是实际运行Mass_Storage,数据读写又正常, 想不懂为何 #define ENDP0_RXADDR 设定为 (0x18) ??
Custom_HID范例 : usb_conf.h文件中定义
/* defines how many endpoints are used by the device */
#define EP_NUM (2)
/* buffer table base address */
#define BTABLE_ADDRESS (0x00)
/* EP0 */
/* rx/tx buffer base address */
#define ENDP0_RXADDR (0x18)
#define ENDP0_TXADDR (0x58)
/* EP1 */
/* tx buffer base address */
#define ENDP1_TXADDR (0x100)
#define ENDP1_RXADDR (0x104)
Mass_Storage范例 : usb_conf.h文件中定义
/* defines how many endpoints are used by the device */
#define EP_NUM (3)
/* buffer table base address */
#define BTABLE_ADDRESS (0x00)
/* EP0 */
/* rx/tx buffer base address */
#define ENDP0_RXADDR (0x18)
#define ENDP0_TXADDR (0x58)
/* EP1 */
/* tx buffer base address */
#define ENDP1_TXADDR (0x98)
/* EP2 */
/* Rx buffer base address */
#define ENDP2_RXADDR (0xD8)
|