crc check in a sector of usb pendrive
I am trying to ch开发者_运维问答eck for the data integrity in fat32 filesystem.Currently I have implemented fat on lpc2478. For the checking of data integrity, I come to know that each sector of a disk has checksum or CRC.But I wanted to find the location of the CRC in the sector.Can you please advice me on how to find the location of the CRC in a sector of usb pendrive? and will this CRC change with manufacturer of the pendrive.?
While each flash sector on an USB stick usually has a checksum, you can not access it over USB. Error checking is handled by the controller on the Sitck itself. It also does some other nice things like wear leveling.
If there is a CRC error then the USB stick will signal a "read failure" error. See the docs about USB Mass Storage on usb.org.
To add to Turbo's answer.
There is no check-sum for a sector of data (usually 512 bytes), visible to the File system. Having said this, you can verify the integrity not by checking the check-sum for yourself but by issuing SCSI_VERIFY command that will verify the sector for any defects and report error.
FYI, Windows Format command issues SCSI_VERIFY to check data integrity before writing the Boot sector.
精彩评论