Skip to main content
cgha21
Associate III
August 29, 2009
Question

Why my stm32 can not transfer data through usb ep1

  • August 29, 2009
  • 2 replies
  • 685 views
Posted on August 29, 2009 at 16:22

Why my stm32 can not transfer data through usb ep1

    This topic has been closed for replies.

    2 replies

    cgha21
    cgha21Author
    Associate III
    May 17, 2011
    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
    May 17, 2011
    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.