This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SD Card Optimizations, Increase efficiency alternatives ?

Hi All, 

I have been using the fatfs examples to write data to a SD-CARD Using SPI, Up until now I have been able to use effectively, as per the documentation I Understand it uses SPIM easy DMA, and it is fully asynchronous. I am currently writing around 200 bytes with a frequency of 100 Hz. 

However, when I try to write to the Sd card at higher frequencies say 200 or 300 Hz,the data starts to get corrupted. 

Data gets corrupted as well when the advertisement packets are sent, any work around this  ? 

From the example given in the SDK, are there any additional features or methodologies to achieve high speed writes safely ?    

 1. What I have tried so far: 

    1.1 Set different priority levels for this peripheral. 

    1.2 Increased the Speed of the SPI Bus to the max 8 Mhz. 

    1.3 Implement reasonable large buffers to avoid loosing data packets. 

Are these SD CARD operations really asynchronous  according to This it is except for uninitialization, But I see at least the initialization takes around 15 ms  ? 

is it possible to use PPI or some other mechanism to improve the efficiency of this peripheral ? 

Thanks for your time, 

Cheers  

  •  1. What I have tried so far: 

        1.1 Set different priority levels for this peripheral. 

        1.2 Increased the Speed of the SPI Bus to the max 8 Mhz. 

        1.3 Implement reasonable large buffers to avoid loosing data packets. 

     These are just shots in the dark, fixes for an unknown issue, you need both digital and analog scopes of your I/O lines to see the real issue and potential fixes. 

Related