Hi Alejandra,
I am seeing the CRC limitation that you are referring to. I think our two issues we have are related to this problem.
As I view the logs and breakpoints, I am seeing that the saved CRC offset on the client is 3456, while the CRC offset sent by the host is 3400 when a CRC error occurs. (one example)
So this is telling me that the host is calculating the CRC for every 8 bytes received, while the client is calculating the CRC after every 64 bytes. This also shows that the host is requesting an offset that is before the last save point.
If this is correct, it means that the current implementation is easily prone to complete failures if given the following likely scenario:
1) The client starts a burst to send 300kB of data
2) The client reads 64 bytes of data from flash (assume negligible delay)
3) The client bursts 64 bytes of data to the host
4) The client updates its own CRC for the 64 bytes
5) The client repeats steps 2 to 4 for the first 3392 bytes
6) The client reads the next 64 bytes of data from flash
7) The client bursts the 64 bytes of data to the host
8) The client updates its own CRC for the 64 bytes, ending with a 3456 CRC offset
9) The host only successfully receives 8 out 64 bytes of data and causes a EVENT_TRANSFER_TX_FAILED to appear on the client
10) The host attempts to resume by sending a download request with CRC offset, 3400
11) The client attempts to resume, but its CRC is 3456 and greater than the client's 3400, thus causing an error
Does this confirm everything you were mentioning? If so, would this be how we could fix the problem?
- If the host's CRC offset is less than the client's CRC offset, assume the host is correct and set the client's CRC offset to 3400 and continue by using the host's CRC seed?
Thanks for all the support,
Harvey