No, I can't post the project here. It is the same project I have been asking you about by email.
I have noticed that the IN packets sometimes contain data from the preceding OUT packet, after the first 32 bytes, which must be because the data is still in the USBFS component's common area:
For IN transfers the DMA tries to fill the common area as much as possible to provide the USB block with data to send. The DMA also pre-loads 32 bytes into the endpoint buffer before allowing the host to start reading it. This action adds time for the DMA to write next chunks of the data while the host reads the pre-loaded data. In case the DMA fails to load data in time (before the host reads it), the old data which resides in the common area will be sent on the bus.
That explains why the first 32 bytes of the IN packet are being updated, but the remaining bytes are copied from the previous OUT packet:
So there is a problem with the DMA failing to load data from inRam to the USB component in time for the host to read it. Do you know any reason why that might happen?