2013-11-08 08:12 AM
Hello everyone,
I have a product based on an STM32 and a SPI flash NOR memory. I store some data inside the flash NOR, then I read them back through USB. Sometimes (very rare, but happens ..), I get a few corrupted bytes when I read them through USB. The question is : Is it possible that the data can be altered during USB transfer ? I don't include a CRC or chekcsum within the data of my HID reports, should I ? Or does the USB stack over my hid reports includes a CRC and an automatic ''retry'' if the checksum fails, meaning that the Windows function that reads the USB report is sure to get non-altered data ? If USB HID reports are ''error-free'', I guess I should secure my write and read operations on the NOR memory. Thanks for your help. Best regards, Vincent.2013-11-08 10:06 AM
I'd CRC the data read from the SPI Flash, and then send it over the USB, hopefully this would prove the error is not in the USB-to-PC transfer.
I'd also do repetitive read and CRC of blocks within the SPI Flash, do random block reads and confirm you always get the same CRC, and do a burn in test of that. Then do the same test reading random block via USB, on the same memory, and test the system end-to-end. This way should be able to confine the problem.2013-11-12 12:52 AM
Thank you clive1 for your answer.
Indeed, there are several ways to find who generates the error, but since it appears on only a few bytes over hundred megabytes or so, if ever someone knows wether USB to PC transfer is error-safe or not, it would prevent me from wasting time about testing it. It's not about laziness, but even reading the USB spec would take less time than running a test ... so maybe a USB ''guru'' here ? :)