Hi All,
I have just started working on interfacing SD card with nrf52 using SDK 12.0. I have to write to SD card at a rate of 84 packets per second and each packet consists of 20 bytes. I am taking fatfs example in sdk 12.0 as reference.
I am sampling the SAADC at 1 ksps and storing these samples in SD card.Here I amwriting to SD card based on GPIO interrupt For each write operation I am using following steps: 1)open directory 2)open file 3)write bytes to file 4)close the file.
While writing continuously I am facing following issues :
-
Code gets restarted automatically after writing some kb's into SD card.
-
I am wring only in one file. Still additional files are generated in SD card.
-
while writing to file somewhere in the middle I am getting massage as
Unable to open or create file: ank.TXT.
I am using 8 GB SD card for this operation. IAR version 7.4 and SDK 12.0. Does any one has any idea why I am getting these issues?
I am attaching my code and some images for the reference. modified1.c
image1: when issue no. 3 occurred image2: when code gets restarted image3: when multiple files gets created in SD card
I have to write to SD card whole data at longer duration without restarting the code.