Saturday, May 12, 2012

What's up with the SD card libraries these days?

Spent a couple of hours decoding, recoding, errorchecking and retracing my steps on the bitpacking routine. It looked like a 4bit instead of 3bit compression worked, but then the animations started crashing...

So I spent a little more time, and surprise surprise - the SD card library still has flaws.
The last byte of every block was conveniently skipped for reasons unknown to mankind and two (?!) extra bytes has been added to be read when trying to read the end of a block...

I removed the extra two bytes and took the liberty to allow the SD card to read the last byte as well (I'm THAT bad!), and presto - the SD card library started to behave like it should.
Rather annoying that the customer have to troubleshoot the libraries that the company who sold the product relies on...

I just have to ask - how the heck did they come up with the brilliant idea to load 514 bytes from the last 512-byte sector and 511 out of 512 from the rest....

2 comments:

  1. did you report it on chipkit.org forums?

    ReplyDelete
  2. Yepp, I did.
    I'm a frequent poster in that forum regarding the SD library...

    It seems pretty solid after my fixes thou!

    ReplyDelete