I am using the latest version of the STM32 USB library on the STM3240G eval board. I have modified the MSC example with my own configuration. This one is coming from a library we bought and works on a STM32F105. 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.
I have inserted a table inside the ReadPacket routine (see below) and I can observe that the complete enumeration got into the fifo. 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, interrupts are enabled but not called (except SOF). 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,
uint32_t count32b = (len + 3) / 4;
__IO uint32_t *fifo = pdev->regs.DFIFO;
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;
return ((void *)dest);