Go Down

Topic: MKRZERO fails to receive 64 byte packet on USB COM port (Read 672 times) previous topic - next topic


I have noticed that whenever I try to send exactly 64 bytes of data from PC to MKRZERO the MKRZERO never sees it. Serial.avaialbe() returns 0 forever. This also happens if it is a residual 64 bytes off of a
multiple of 256. For example if I send 320 bytes I get the initial 256 but the final 64 bytes is never received.

I saw a thread that seemed to imply there is a known issue with SAMD21-based boards sending a 64
byte packet. Is this a similar issue? Can anybody point me to a solution?


Do you happen to have a link to the thread you found? It might be helpful. I remembered seeing a bug report of something like this. I think I found the one I was thinking of, but it was being reported for the AVR-based Arduino Micro, rather than a SAMD21 board:


Here is the post. Looking at the post it is for Leonardo. So maybe it isn't the same thing:


Okay, I've ran several tests and found the following pattern:

size    result
64      fails
128    fails
192    fails
256    succeeds
384    fails
448    fails
512    succeeds
576    fails

The failure case is:

if ((size%256)%64 == 0) then fails.


Here is an update to the table. I forgot 320 bytes and I have additional information as to what actual gets
delivered to the MKRZERO sketch

size   results
64     fails
128   fails
192   fails
256   success
320   fails  (first 256 bytes delivered)
384   fails  (first 256 bytes delivered)
448   fails  (first 256 bytes delivered)
512   success
576   fails (first 512 bytes delivered)

As you can see the failure occurs if size%64==0 and size%256!=0
Also all size - size%256 bytes are delivered. its just the residual size%256 bytes that are not.


Note. This issue was recently opened on github by a co-worker that is tracking essentially the same issue:


Go Up