Problem with SerialUSB.write on the Due

Yes, I am replying to my own post. The problem seemed to lie in USBCore.cpp, routine USBD_Send. The data pointer in the loop at the bottom was not being updated. Here are the changes to USBD_Send (two lines) I made to take care of the issue:

// Blocking Send of data to an endpoint
uint32_t USBD_Send(uint32_t ep, const void* d, uint32_t len)
{
uint32_t n;
int r = len;
//const uint8_t* data = (const uint8_t*)d;
//THIS IS A CHANGE FROM CONST TO UPDATE THE POINTER - WRD
uint8_t* data = (uint8_t*)d;

if (!_usbConfiguration)
{
TRACE_CORE(printf("pb conf\n\r"):wink:
return -1;
}

while (len)
{
if(ep==0) n = EP0_SIZE;
else n = EPX_SIZE;
if (n > len)
n = len;
len -= n;

UDD_Send(ep & 0xF, data, n);
//THIS IS AN ADDITION: UPDATING THE POINTER - WRD
data += n;
}
//TXLED1; // light the TX LED
//TxLEDPulse = TX_RX_LED_PULSE_MS;
return r;
}

The Arduino Due line: SerialUSB.write(test_buf,16384); now appears to actually send all of the 16384 bytes.
And by the way, with 64 * 16K transfers, I am getting around 8Mb per second transfer rates.