cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55rgv6: I want to save ads1299 sampling data to SD card by FATFS(via spi).

Lep
Senior

I made an acquisition board with STM32WB55rgv6. I want to save ads1299 sampling data to SD card by FATFS(via spi). But my write speed is only 1KB. Here are the measures I have tried:

①Improve SPI clock

②Replace faster SD card

③Mybuffer is 51200B

Although every time I write in a single block instead of multiple blocks, and I only use SPI, not DMA. But the write speed is too low, only 1KB. I've browsed through many measures, but they still haven't saved me.

4 REPLIES 4

Single sector at the card level will have worst performance. Biggest grouping FATFS will combine is Cluster size. Writing should ideally be aligned to sector/cluster offsets​.

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

Thank you. Do you mean sd card sector and cluster? I set sd card sector and cluster are 512Bytes. And my databuffer is 40960Bytes. ADS1299's is 500SPS. But my recording interval is about 6ms, much more than 2ms. And SD card(speed class V30 and V10)have same effect.

If you just transact with sector (512 byte) transfers or below, it will be very slow with a very large command overhead, and the card with be churning on whatever it's internal block erase size is, perhaps of the order 128 KB.

40KB is more than enough, in fact writing 32 KB should also be fine, it would notionally be a transfer of 64 contiguous sectors in a continuous stream of data, from ONE IO command.

The buffer filling, and flushing to the card should be two independent tasks.

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

Thanks again. You mean that I just change from write single block to write multiblocks, the problem will be solved.