AnsweredAssumed Answered

SD Card with Kinetis K70 Hi-Speed USB Device I/O Errors

Question asked by video_man on May 17, 2013
Latest reply on Jun 12, 2013 by video_man

I've set up a Kinetis K70 as a Hi-Speed USB MSC device to read/write an SD Card from a PC. I'm using the Tower K70 board with a TWR-SER2 board for the Hi-speed USB interface.


I'm having a problem with I/O errors while copying files from the SD Card to a PC/Mac, which I suspect is related to using the SDHC/eSDHC drivers in MQX, rather than the USB drivers, because the I/O errors are semi-repeatable in the same places during the transfer of particular files, as I will describe in more detail below. I've been unable to find a problem in my code, and now I'm wondering if anyone else has had this problem, or if my problem could be related to any of the 10 SDHC related issues listed in the Kinetis 4N30D Mask Set Errata (Feb 2013)? I'm hoping someone with knowledge of the SDHC/eSDHC drivers might know if they are dependent on any of those issues.


Long description of the I/O error symptoms:


I can format the SD Card "drive" and read/write files using a PC or Mac USB connection, but I get an I/O error (reported by the PC or Mac) when copying particular files from the SD Card to the PC/Mac, which terminates a file transfer. I never get an error when writing files from the PC/Mac to the SD Card, only when transferring (reading) files from the SD Card to the PC/Mac. I can format the SD Card from a PC or Mac with FAT-32, or with the Mac HFS file system, and still have the same problem. So it isn't specific to the file system.


Although I can sometimes copy (read from the SD Card) 200-300 MB of files to the PC or Mac without an error after powering up the K70/SD Card, I eventually get an I/O error (which terminates a copy transfer) on particular files. Once I get an I/O error on a particular file, I get the same error, in the same place during each subsequent attempt to transfer that file. I also get the same error, in the same place, when trying to transfer copies of that same file (which I had previously written on the SD Card). So the I/O error appears to be related to the content/structure of the files, and not the particular location of the files on the SD Card. Even after getting an error transferring a particular file, I can transfer some other files (even much larger files) without errors.


The problem does not appear related to how files are written to the SD Card by the K70 SDHC/eSDHC drivers, since I can ALSO write files on the SD Card with it plugged directly into a Mac or a separate USB SD Card Reader/Writer, and then have the same reading problem when the SD Card is back in the K70 USB device.


I'd appreciate any information, thoughts, or ideas on how to troubleshoot the problem. This is critical to using the K70/MQX for my project. Thanks.