This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SDcard Read/Write missing/wrong data

Hi there,

I am using an own PCB with Luminary lm3s8962 (based on the evaluation board) with LabVIEW for ARM and KEIL uVision V3.85

In the past I've been developing code to, Log some data to/Read logfiles from, a microSD card without problems.

The data that is being logged is become a little bit more and at this moment I get corrupted data on/from the microSD card. I am using SanDisk 2 GB microSD's.

problem one: When I write enough data for a longer time I see that sometimes the data is wrong. I tested this behavior and I can reproduce it. The data size is OK but where I expect data like:
112;112;112;112;112;112 I see:
112;112;11;111;1112;112

sometimes the SDcard copies old or wrong data to that position that is wrong.

I've made a change which decrease the buffer per write. Now I don't see this problem anymore.
Is this an known issue?

problem two: When I read files from the microSD card on my embedded ARM and read the data via USB, I get wrong data (the first bytes are looking like a directory table of FAT)
I didn't made any change to the USB Read protocol and I wipe the microSD before every test.

When I read the microSD card in Windows, there are no problems.
Is there someone that is also getting strange behavior like this?

Parents
  • So I've made an workaround for my write problems (write with smaller blocks of data, doesn't matter if I do 5 times a write operation in the same amount of time)

    I still have the read problems on the SanDisk cards.
    I've made a dd image of it, and all the data stands correctly on the microSD card.
    There are no errors when I read the cards in windows.
    But, if I read the files on my embedded application, I get wrong data.
    It looks like the ARM sometimes get the wrong sector number to read, (the faults are in block of 512 bytes, the sector size on the microSD)
    But why only on the SanDisk cards and not on the other unbranded card.

    Nobody having these errors?

Reply
  • So I've made an workaround for my write problems (write with smaller blocks of data, doesn't matter if I do 5 times a write operation in the same amount of time)

    I still have the read problems on the SanDisk cards.
    I've made a dd image of it, and all the data stands correctly on the microSD card.
    There are no errors when I read the cards in windows.
    But, if I read the files on my embedded application, I get wrong data.
    It looks like the ARM sometimes get the wrong sector number to read, (the faults are in block of 512 bytes, the sector size on the microSD)
    But why only on the SanDisk cards and not on the other unbranded card.

    Nobody having these errors?

Children