Ya probe lo que mecionas, no funciono, encontre esto pero no se donde esta.
I solved my problem comment this line code in samd21_device.c:
uint8_t UDD_Recv_data(uint32_t ep, uint32_t len)
{
TRACE_DEVICE(printf("=> UDD_Recvdata : ep=%d\r\n", (char)ep)![]()
-> //if (len>64) len=64;
usb_endpoint_table[ep].DeviceDescBank[0].ADDR.reg = (uint32_t)&udd_ep_out_cache_buffer[ep];
-> //usb_endpoint_table[ep].DeviceDescBank[0].PCKSIZE.bit.MULTI_PACKET_SIZE = len;
usb_endpoint_table[ep].DeviceDescBank[0].PCKSIZE.bit.BYTE_COUNT = 0;
udd_OUT_transfer_allowed(ep);
TRACE_DEVICE(printf("=> UDD_Recv_data : data=%lu\r\n", (unsigned long)data)![]()
/* Wait for transfer to complete /
while (!udd_is_OUT_transf_cplt(ep));
/ Clear Transfer complete 0 flag */
udd_clear_OUT_transf_cplt(ep);
return udd_ep_out_cache_buffer[ep][0];
}
I discovered that when sending a string with a size x, the next string of the same size was read correctly. But if the next string had different size was not read correctly. So I commented the line where it was setted the size of the string to be read, getting this with a constant size. Now I have a 64 bytes size string that I can read without problems.