Mantis Bug Tracker

View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000151FirmwareSerial Commspublic2011-06-15 16:582011-10-11 19:19
ReporterFred 
Assigned ToFred 
PrioritynormalSeverityminorReproducibilityN/A
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target Version0.3.0Fixed in Version 
Summary0000151: Replace checksum with 16 bit CRC
DescriptionInvestigate this and if not too expensive, do it, possibly on a branch to allow tools to continue to function with the old setup while transitioning. Do right after some release such that there is maximum time for tools to stabilise before next release. Complete 0000152 first.
TagsNo tags attached.
FirmwareVersion
Issue TypeImprovement
Risk of Breakagehigh
Attached Filestxt file icon crc_v3.txt [^] (89,127 bytes) 2011-10-11 13:29 [Show Content]

- Relationships
parent of 0000152closedFred Move checksum stuff out of ISR for both tx and rx. 

-  Notes
User avatar (0000373)
Fred (administrator)
2011-10-11 13:47
edited on: 2011-10-11 13:49

Two very useful links:

http://www.ece.cmu.edu/~koopman/roses/dsn04/koopman04_crc_poly_embedded.pdf [^]
http://www.repairfaq.org/filipg/LINK/F_crc_v3.html [^]
http://www.ross.net/crc/crcpaper.html [^] original source of repairfaq page

Listing of 5 different CRC 16 sums:

http://en.wikipedia.org/wiki/Cyclic_redundancy_check [^]

This will make the firmware VERY resistant to bad data:

current 8 bit: 100 - (100 / 256) = 99.609375%
future 16 bit: 100 - (100 / 65536) = 99.9984741%

An example of wrong parity setting:

http://pastebin.com/Kp5u9a0W [^]

We saw the failure rate above in action at 0.465707028% errors making it through undetected. Given that 0.390625% is ideal/average, then we shouldn't be surprised by the above.

Note, these would all have been detected by the firmware if sent to the firmware, but the robustness of the external applications is at minimum as good as the checksum.

Because CRC can be computed with a lookup table, the only penalties are flash space (no shortage) and transmission speed (already fast enough by a good margin), and as such this is a good idea.



Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker