This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C129XKCZAD: USBHCDPipeWrite() sends empty frame when used with DMA

Part Number: TM4C129XKCZAD

I'm still mushing along trying to get my USB Host application up and going.    I'm trying to transfer a large amount of data to my full-speed device.  

I'm setting up a pipe and writing to it in 512-byte work units.

		// Output Pipe for sending data.
		Info.ui32BulkOutPipe = USBHCDPipeAlloc(0,
			    USBHCD_PIPE_BULK_OUT_DMA,psDevice,PipeCallback); 

		// Configure the pipe for use with endpoint 4.
		if ( Info.ui32BulkOutPipe != 0 ) {
			int ret = USBHCDPipeConfig(Info.ui32BulkOutPipe,
			64, //  uint32_t ui32MaxPayload - Observed in descriptors.
			0,   // uint32_t ui32Interval
			4    //  uint32_t ui32TargetEndpoint
            );
            // Make sure it worked...
		if ( ret != 0 ) {
			USBHCDPipeFree(Info.ui32BulkOutPipe);
			Info.ui32BulkOutPipe = -1;
			}
		}

What I'm seeing is that after a random number of transfers, the controller sends an empty frame.   This looks like an end of transmission to my device, which then resets the link.

I do know that the controller is dropping a single frame onto the floor, because I'm using a sample data file that includes the data packet numbers:

Those first 6 bytes are the frame number (in ascii).   The last successful transmission is frame 000165.    Frame 000166 isn't sent.  The next frame to go out is 000167.

Here's what I've been able to tease out so far:

  • This failure doesn't happen without DMA.   If I configure the pipe without it, I can do a big transfer without error.
  • I can do lots of 64k transfers without error.
  • The failure doesn't align with the overall logical transfer (512 bytes).
  • USBSpeedGet() returns USB_UNDEF_SPEED

  • There is USB errata on the A0 version of my part.  I'm running on an A2.

Here's a register dump of the USB controller after the failure.  

It looks like the endpoint 1 configuration is correct - full speed, bulk mode (registers 0x110-0x11F)

4005:0000 00 60 00 00 00 00 FF 00 FE 00 00 FF E1 01 00 00 .`......~...a...
4005:0010 00 00 00 00 00 00 00 00 00 00 80 00 00 00 00 06 ................
4005:0020 01 00 00 00 D1 00 00 00 2C 00 00 00 2C 00 00 00 ........i...i...
4005:0030 2C 00 00 00 2C 00 00 00 2C 00 00 00 2C 00 00 00 i...i...i...i...
4005:0040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
...
4005:0060 19 00 00 00 00 00 00 00 00 00 00 00 05 0C 00 00 ................
4005:0070 00 00 00 00 00 00 00 00 77 8A 5C 3C 80 77 72 00 ........w.\<.wr.
4005:0080 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
...

4005:0100 00 00 00 00 00 00 00 00 00 00 80 00 00 00 00 06 ................
4005:0110 40 00 03 80 40 00 00 E8 E0 1F A4 00 A1 00 00 77 @...@..h`.$.!..w
4005:0120 00 00 00 00 00 00 00 00 E0 1F 00 00 00 00 00 77 ........`......w
4005:0130 00 00 00 00 00 00 00 00 E0 1F 00 00 00 00 00 77 ........`......w
4005:0140 00 00 00 00 00 00 00 00 E0 1F 00 00 00 00 00 77 ........`......w
4005:0150 00 00 00 00 00 00 00 00 E0 1F 00 00 00 00 00 77 ........`......w
4005:0160 00 00 00 00 00 00 00 00 E0 1F 00 00 00 00 00 77 ........`......w
4005:0170 00 00 00 00 00 00 00 00 E0 1F 00 00 00 00 00 AA ........`......*
4005:0180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
...

4005:0330 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4005:0340 00 00 00 00 74 40 E6 05 00 00 00 00 00 00 00 00 ....t@f.........
4005:0350 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
...

4005:0410 01 00 00 00 00 00 00 00 00 00 00 00 12 00 00 00 ................
4005:0420 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4005:0430 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................