nRF9160 with Zephyr - SD card & fatfs errors

Hi,

I'm working on a project using Zephyr and ncs 1.7.1. One of its functions is to stream WAV files from a SD card. It only ever reads data.

The issue I'm having is every so often of playing a sound file on loop (after about 5 mins) Zephyr reports an error: <err> fs: file read error (-5). The errors happen randomly - it does not seem to be an issue with any particular point in the play/loop process. The SD card becomes totally unreadable and any further reads also fail.

I've tried all of the normal approaches - retrying reads, closing and re-opening the file, unmount and remount the drive, recalling the SD card init functions (via disk_access_init()), etc. No approach seems to work (there will either be a hard error or the recovery simply doesnt work) and resetting the entire system is the only reliable recovery.

Is there a method to successfully reinitialize the SD card and fatfs without resetting the whole system? I feel like the drivers and Zephyr should be able to accommodate this functionality.

The SD card is running at 8MHz (the maximum allowed frequency on the 9160)

Related