cancel
Showing results for 
Search instead for 
Did you mean: 

Why my stm32 can not transfer data through usb ep1

cgha21
Associate II
Posted on August 29, 2009 at 16:22

Why my stm32 can not transfer data through usb ep1

2 REPLIES 2
cgha21
Associate II
Posted on May 17, 2011 at 13:22

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.

16-32micros
Associate III
Posted on May 17, 2011 at 13:22

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.