AnsweredAssumed Answered

FatFS SPI and 8Gb SD card ?

Question asked by H.Rick on Jan 24, 2016
Latest reply on Jan 25, 2016 by H.Rick
Guys,

Can I use 8Gb SDcard with FATFs? it's formatted FAT32

Here's the debug message from UART....it seemed that it's initialized properly but can not read the file system...

. à. f_mount ff.c find_volume!
....-é÷Oõ}F.ÐOôzzOð.   TFSF#"v¡}HÆø.’get_LDNUMBER Line2136
.ø . -éøO L!MOôzx®òžgà!(Fü÷€ù.(ùÐ"1F(Fü÷~ù."1F(Fü÷yùCF "!FHý÷¨ù 4¼BæÙ."F_OPEN BEGIN Line2447
....ø . FA_FA_CREATE NEW Line2450
...CREATE get_LDNUMBER Line2136
.ø . -éøO L!MOôzx®òžgà!(Fü÷€ù.(ùÐ"1F(Fü÷~ù."1F(Fü÷yùCF "!FHý÷¨ù 4¼BæÙ."Find_volume Line2195
 
.ø . FR_INVALID_DRIVE Line 2196
FR_INVALID_DRIVE Line 2196
 
....à. FR_NOT_ENABLED LineFR_NOT_ENABLED Line 2200
 
..find_volume ff.c disk_initiDISK INITIALIZE SUCCEDED!
....ø . DISK INITIALIZE FINISHED!
  
...0´FIë€.F@hi F0¼G..P. pµFDISK INITIALIZE FINISHED!
  
...0´FIë€.F@hi F0¼G..P. pµF
F ¹±èÐ p½ p½HÀx..ÔROô.v,Ffind_volume ff.c disk_initialize LINE 2218!
..FR_OK Line 2210

Test function :
void test_write()
{
      UINT bw,size;
    FRESULT fr;    /* FatFs return code */
    char line[82],size_char; /* Line buffer */
    unsigned char result;
    f_mount(&FatFs, "0", 0);
    if (f_open(&Fil, "newfile.txt", FA_WRITE |  FA_CREATE_ALWAYS) == FR_OK)
        {
            HAL_UART_Transmit(&huart1, "FOPEN \n\r", 15, 1000); // As a pointer, with a length
             
 
            f_write(&Fil, "Test write line1 !\r\n", 17, &bw);   /* Write data to the file */
            f_write(&Fil, "Next line test\r\n", 16, &bw);   /* Write data to the file */
 
             
            HAL_UART_Transmit(&huart1, "FWRITE \n\r", 15, 1000); // As a pointer, with a length
             HAL_GPIO_WritePin(GPIOE, GPIO_PIN_6 , 0 );
            HAL_Delay(5000);
            HAL_GPIO_WritePin(GPIOE, GPIO_PIN_6 , 1 );
             
            f_close(&Fil);                              /* Close the file */
             
            HAL_UART_Transmit(&huart1, "FCLOSE \n\r", 15, 1000); // As a pointer, with a length
       }
}  

Any clues ?

thanks

Outcomes