2009-08-29 07:22 AM
Why my stm32 can not transfer data through usb ep1
2011-05-17 04:22 AM
if i set the ep1 to tx_valid in reset function in usb_prop.c,then it can tranfer,but if i set tx_valid in main,the ep1 always respond with NAK.
2011-05-17 04:22 AM
Hi cgha21,
This is because each time an USB reset is detected on the USB bus, a USB reset (RESET interrupt) event occurs and in USB peripheral : the communication is disabled in all endpoint registers (the USB peripheral will not respond to any packet). As a response to the USB reset event, the USB function must be enabled, having as USB address 0, implementing only the default control endpoint (endpoint address is 0 too). This is accomplished by setting the Enable Function (EF) bit of the USB_DADDR register and initializing the EP0R register and its related packet buffers accordingly. During USB enumeration process, the host assigns a unique address to this device, which must be written in the ADD[6:0] bits of the USB_DADDR register, and configures any other necessary endpoint. Cheers, STOne-32.