I currently want to save the sensor data obtained by SPI communication to the microSDHC card by SPI communication.
Writing to the SDHC card is possible without problems, but writing takes time.
I want to acquire and write sensor values at a sampling frequency of 1000 Hz, but it takes about 18 ms to write.
What I tried to improve・ Use of DMA・ Change of priority・ Use multiple arraysAre there any other possible ways?
Append・I also use BLE communication and soft devices. I learned that the flash operation takes time when using a soft device.・And writing to SD card is 512 bytes each
・Use fatfs example
How much data are you writing in each write operation?
I assume you would get more efficient SD access if you buffer the ADC data in 512 byte chunks so you don't have to write to the card as often?
Thank you for your reply.I already have data stored in a 512-byte buffer before writing.
Thanks a lot for the additional information.
The write speed of flash cards vary a lot from model to model, so without a full specification of your card it is hard to say how much speed you can expect.
What type of microSD card are you using?
Have you tried to change the card for a different one to see if this could improve the communication speed?
Have you investigated if you could remove or compress some of the MPU data to reduce the amount of data that you need to store to the card?
I use SanDisk's 32GB SDHC card.Since there is no other SD card, I have not tried it.
All MPU data is necessary and cannot be reduced.
Do you have a specification for the flash chip used in the SanDisk card, so that you can verify the timing parameters?
Maybe solvedInterrupted except f_write!
Thank you for your cooperation
Ok, I will close the case then.
Good luck with your project