AnsweredAssumed Answered

How to use the USB ISO IN Endpoint

Question asked by loginov.ivan on Jun 21, 2012
Latest reply on Jun 22, 2012 by Chinzei.Tsuneo
Hello.
I have a probem with the ISO IN Endpoint. Double buffering is not working.
The STM32F103RD is sending right data only from one buffer. Data from another buffer is wrong.
My code:
  /* Initialize Endpoint 1 */
  SetEPType(ENDP1, EP_ISOCHRONOUS);
  SetEPDblBuffAddr(ENDP1, ENDP1_BUF0Addr, ENDP1_BUF1Addr);
  ClearDTOG_RX(ENDP1);
  ClearDTOG_TX(ENDP1);
  ToggleDTOG_RX(ENDP1);
  SetEPTxStatus(ENDP1, EP_TX_NAK);
  SetEPRxStatus(ENDP1, EP_RX_DIS);

void SOF_Callback(void)
{
  if(bDeviceState == CONFIGURED)
  {
  
  if (GetENDPOINT(ENDP1) & EP_DTOG_RX)
  {
    /*write to ENDP1_BUF0Addr buffer*/
     UserToPMABufferCopy(USB_Buf, ENDP1_BUF0Addr, USB_Idx);
     SetEPDblBuf0Count(ENDP1,EP_DBUF_IN ,USB_Idx);
  }
  else
  {
    /*write to ENDP1_BUF1Addr buffer*/
       UserToPMABufferCopy(USB_Buf, ENDP1_BUF1Addr, USB_Idx);
     SetEPDblBuf1Count(ENDP1,EP_DBUF_IN ,USB_Idx);
  }
  SetEPTxValid(ENDP1); 
  }
}
Is anyone know what is a problem?

Outcomes