Hello,
I could use some help getting an SD card up and running on TWR-K60F120M. I've been having a difficult time locating resources on the proper way to initialize this "module". I have enabled a memory card via the "Run-Time Environment" feature in Keil. The issue I'm now having is that finit("M0:") hangs but fmount("M0:") does not. Could someone please let me know the appropriate way of initializing the file system?
Below is an empty project I'm using to test with:
#include <stdio.h>
#include "rl_fs.h"
#include "cmsis_os2.h"
#include "system_MK60F12.h"
volatile int test = 0;
int main (void) {
SystemInit();
//osKernelInitialize ();
volatile fsStatus test2 = finit ("M0:");
//volatile fsStatus test3 = fmount ("M0:");
//volatile fsStatus test2 = finit ("");
while(1)
{
if(test++ > 500)
{
test = 0;
}
}
return 0;
}
void Driver_SPI0(void)
{
}
Hi
I don't have any experience with the Keil SD card interface but if you license it from them you could ask them directly.
Otherwise there is professionally supported, off-the-shelf solution that also works with Keil at https://www.utasker.com/kinetis/TWR-K60F120M.html which allows you to immediately use the SD card by the application, including for USB-MSD or FTP/Web server usage.
It is also available in open source form if no support is required at https://github.com/uTasker/uTasker-Kinetis (also with Keil project) and allows you to simulate the TWR board, the K60F and SD card in Visual Studio.
Regards
Mark
[uTasker project developer for Kinetis and i.MX RT]
Contact me by personal message or on the uTasker web site to discuss professional training, solutions to problems or product development requirements