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);
}