Closed Bambofy closed 3 years ago
Hi @Bambofy
your issue is not properly filled (boards, core version, library exact error,....).
Debugging user program is not an library issue. You can use the forum to eventually have some help.
Writing 30k in a SD and being interrupt several times per ms seems really not a good idea...
I guess FatFs or SDMMC have some timeouts and you probably reach them... as you said changing the write solves your issue.
The program must write to the SD card 30000 bytes at a time, while the hardware timer collects samples at 16,000Hz. The problem is that the SD card write function returns an error when writing.
Here's is the code:
Notes: I have found that changing the SD write size to 512 bytes resolves the error. And also if i remove the hardware timer then the error is resolved and the write() can write more than 512 bytes. Perhaps the interrupt is breaking the SD card if it is raised while a write is being performed?