hi,
i am using FRDMK64 and kds3.0 and KSDK1.3.0. i tried USB device mass storage SD example. its working fine.
in this project only i want to implement FATFs file system. i want to read some file from SD card and i want to transfer that data through UART. if USB not connected at that time i want to access SD card. so that time i want to read/write some data from SD card. is possible..? for that what i have to do..?
give some suggestion or some example code.
regards,
sudhakar p
Hi Sudhakar,
maybe this one is helpful for you: Tutorial: Data Logger with the FRDM-K64F Board | MCU on Eclipse
Erich
hi,
i added fat_fs library and i tried to initialize "sdcard_disk_initialize(SD)". but i am getting failed error.
give some idea..? why i cant able to initialize?
i am doing following way:
void APP_init(void)
{
while (!sdhc_detect())
{ ;
} /* SD Card inserted */
if(!SD_Init()) return; /* Initialize SD_CARD and SPI Interface */
ds = disk_initialize(SD);
//here i added my code***********************************************************************/
if(ds)
{
printf("\nFailed to initialize SD disk\r\n"); //here i am getting initialization failed why?
for(;;){}
}
fr = f_chdrive(SD);
printf("\nMounting file system to SD Card volume...\r\n");
fr = f_mount(SD, &FatFs);
if(fr)
{
printf("\nError mounting file system\r\n");
for(;;){}
}
/***********************************************************************/
}
regards,
sudhakar p
Hi, Sudhakar,
What is the error message? when did you confront error, in compiling stage or in running stage?
BR
Xiangjun Rong
hi,
finally i achieved. i can able to read/write data on SD card. i forget to enable
#define CD_USING_POLL_DAT3 | 1 |
thats y i got error while initialization (run state)[disk_initialize(SD);]
regards,
sudhakar p
hi,
please guide me how to initialize and use f_open, f_write for sd-card read/write. i struggling more.i have to solve this problem.
if any example available?
regards,
sudhakar p
hi,
i added SD card fatfs library into work space and then i tried following method but i got error.what i am doing is correct..?is anyway to work like that..? i want to create one file then i want to write some data.
FIL* fp;
if (f_open(&fp,"log.txt", FA_OPEN_ALWAYS|FA_WRITE)!=FR_OK)
{
USB_PRINTF("\nSD card open error!\n");
}
hi erich,
i saw that tutorial. i am not experienced with processor expert. i am thinking it will create more problem to me and also i need SD-card USB mass storage also.so i am plan to use MSD example so in this project can you give idea how to implement SD-card read/write API.
thanks and regards,
sudhakar p