Username:     
Password:     
             

Forum

# 1   2013-06-04 11:26:26 STM32F4xx USB enumeration ok but EP2 not working

Dreeke
New member
Registered: 2011-03-02
Posts: 3

STM32F4xx USB enumeration ok but EP2 not working

Hello,

I am using the latest version of the STM32 USB library on the STM324xG eval board. I have modified the MSC example with my own configuration. This one is coming from a library we bought and works. Enumeration is exactly the same as with our preveous products so no problem here. But when I start our application on the pc which sends data to EP2 out the ST responds with a NAK instead on ACK (seen with USB analyzer). No interrupt is called and I can't find where I go wrong.

The code of my application is exactly the same as the MSC example, exept that I use EP2 out instead of EP1 out.

Can anybody give me a hint?

Offline

 

# 2   2013-06-04 16:31:28 STM32F4xx USB enumeration ok but EP2 not working

Dreeke
New member
Registered: 2011-03-02
Posts: 3

Re: STM32F4xx USB enumeration ok but EP2 not working

Ok, I am a bit further with my quest. I have inserted a table inside the ReadPacket routine (see below) and I can observe that the complete enumeration got into the buffer. Everything but the OUT package which is send by my pc application (3 bytes: 0x89, 0x13, 0x00) to endpoint 2 which is answered with a NAK. It looks like the USB core refuses this package, because the SOF's come through. I have investigated on register level that every bit is set on the right place. I just can't find out WHY this package is NAK-ed.

If anyone can give me a hint or even a "stupid" remark.... Thanks!

void *USB_OTG_ReadPacket(USB_OTG_CORE_HANDLE *pdev,
                         uint8_t *dest,
                         uint16_t len)
{
  uint32_t i=0;
  uint32_t count32b = (len + 3) / 4;
 
  __IO uint32_t *fifo = pdev->regs.DFIFO[0];
 
  for ( i = 0; i < count32b; i++, dest += 4 )
  {
    *(__packed uint32_t *)dest = USB_OTG_READ_REG32(fifo);
/***********/
if((myflag == 1) && (myindex_w != 2048));
{
    myfifo_dwa[myindex_w] = *(__packed uint32_t *)dest;
    myindex_w++;
}
/***********/
  }
  return ((void *)dest);
}

Offline

 

Board footer