hello dear all, I have a problem in create a text file in SD card. here is my code. it doesn't create text file. i work on LPC1768. would you tell me what is the problem with my code?
FATFS fs; /* Work area (file system object) for logical drive */ FIL fsrc; /* file objects */ FRESULT res; UINT br; int SD_TotalSize(void); char path[512]="0:"; uint8_t textFileBuffer[] = "Thank \r\n"; FRESULT scan_files (char* path); f_mount(0,&fs); res = f_open( &fsrc , "0:/Demo.TXT" , FA_CREATE_NEW | FA_WRITE); if ( res == FR_OK ) { /* Write buffer to file */ res = f_write(&fsrc, textFileBuffer, sizeof(textFileBuffer), &br); printf("Demo.TXT successfully created"); /*close file */ f_close(&fsrc); } else if ( res == FR_EXIST ) { printf("Demo.TXT created in the disk"); } scan_files(path); SD_TotalSize(); /* Infinite loop */ while (1) {} }
i don't write "I can not show all the code. Someone will steel it." !!!!! is it possible someone steal my name?!! it's so strange!