This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DMA mode operation in usb MSC

Im trying to implement sd card reader on lpc1768. I completed that with the slave mode operation.Now i m stucked with DMA mode.After i entered into write command i didnt receive interrupt.There are two interrupts in dma mode EOT,NDD. Those should always come in the loop right??? after receiveing first NDD interrupt i will receive EOT.This will be in continues format.But i m not receiving them like dis.Sometimes i receive two EOT the sequence follows.This same thing happened with NDD as well.When i entered into write_10 SCSI command i should receive inetrrupt but i m not receiving that.I m bit confused in dma mode. I m using NXPUSBLIB 0.98b for thje reference.
void Endpoint_Streaming(uint8_t corenum, uint8_t *buffer, uint16_t packetsize, uint16_t totalpackets, uint16_t dummypackets)
{ uint8_t PhyEP = endpointhandle(corenum)[endpointselected[corenum]]; uint16_t i; dummypackets = dummypackets; if (PhyEP & 1) { for (i = 0; i < totalpackets; i++) { while (!Endpoint_IsReadWriteAllowed(corenum)) ; Endpoint_Write_Stream_LE(corenum, (void *) (buffer + i * packetsize), packetsize, NULL); Endpoint_ClearIN(corenum); } } else { for (i = 0; i < totalpackets; i++) { DcdDataTransfer(PhyEP, usb_data_buffer_OUT[corenum], packetsize); Endpoint_ClearOUT(corenum); while (!Endpoint_IsReadWriteAllowed(corenum)) ; Endpoint_Read_Stream_LE(corenum, (void *) (buffer + i * packetsize), packetsize, NULL); } }
} In above function why do we have to again DcdDataTransfer(PhyEP, usb_data_buffer_OUT[corenum], packetsize); in the Write_10 command?