Hello,
I'm using the MSP432P401R and the SDK to do some SD card work, and I've been using the example FAT32 SD card example on the resource explorer for reference. I've gotten to the point where I can read files from the card, but it's inconsistent with files I want to read. I can read .txt files just fine, however it can't seem to read .wav files even though they're present on the card. I'll be using .wav files in my application so I would like to get those to work, but a general method for any files would be appreciated too!
Here's my code so far:
WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD; // stop watchdog timer
SDFatFS_Handle sdfatfsHandle;
FILE *src;
Board_init();
GPIO_init();
SDFatFS_init();
add_device(fatfsPrefix, _MSA, ffcio_open, ffcio_close, ffcio_read,
ffcio_write, ffcio_lseek, ffcio_unlink, ffcio_rename);
sdfatfsHandle = SDFatFS_open(CONFIG_SDFatFS_0, DRIVE_NUM);
if (sdfatfsHandle == NULL) {
//Display_printf(display, 0, 0, "Error starting the SD card\n");
while (1);
}
src = fopen("fat:0:Test.wav", "rb");
if (!src) {
while (1);
}
else {
while(1);
}
I'm wondering if it's the way I'm initializing my SD card. Thank you for your help!
Best,
Colin