cancel
Showing results for 
Search instead for 
Did you mean: 

Hello Everyone, I need to write sd card approximately 300 bytes per millisecond and in parallel get these data from another devise via spi, are there some suggestions how to do?

HHako.1
Associate III

Hello Everyone, I need to write sd card approximately, 300 bytes per millisecond and in parallel get these data from another devise via spi, are there some suggestions how to do?

I have tried to use SDMMC1 + Freertos, but I cant communicate with sd card when RTOS enabled. Thanks.

3 REPLIES 3

300 bytes is not a good fit with file systems. Small unaligned writes are a performance nightmare.

The SDIO/SDMMC has hard dead-lines on the transfers. DMA should be workable. Watch for cache coherency. On F7 use DTCM RAM.

Suggest you use a large buffer you flush periodically in you main() loop as it fills have as some multiple of sector or cluster size, perhaps 32KB to reach about optimal performance.

Collect data and fill buffers in IRQ Handlers / Callbacks.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
HHako.1
Associate III

It must be low power, so I have selected STML452. Sure I will collect data and send near to 32 kb as you mentioned. The problem is I cant use SDMMC without cpu blocking and it isn't working with freertos. I am writing a working program with SDMMC and communicating with SD from main (outside of wile) perfectly. When I just turning on Freertos it blocks this communication. I would like to communicate with sd from one task and get data from another. So if SDMMC + Freertos not working are there another combination to solve this problem? Thanks

HHako.1
Associate III

Solved ! One solution is: REENTRANT in RTOS must be enabled and FS_REENTRANT in Fatfs must be deceabled.