Hello,
i have tried to hook up a SD card to the launchpad, SD FAT demo works flawlessly. However, i would like to swap the cards while the program is running. I have not found any solution nor any hint in the specifications so far.
Fistly, i have tried to unmount an sd card before it is removed:
f_mount(0,NULL);
Then, i tried to perform the initialization that is done when program starts:
MAP_PRCMPeripheralClkEnable(PRCM_SDHOST,PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralReset(PRCM_SDHOST);
MAP_SDHostInit(SDHOST_BASE);
MAP_SDHostSetExpClk(SDHOST_BASE, MAP_PRCMPeripheralClockGet(PRCM_SDHOST),15000000);
But, when i try to mount the new card after it is replaced, the f_opendir call returns FR_NO_FILESYSTEM error. I tried to debug the issue, and it seems that only zero values are read from the card after media change, thus the lib thinks there is no filesystem. When i reset the board and keep the new card in the sd slot, everything works.
Is there any documentation/example on this procedure (media change)?
Thank you