cancel
Showing results for 
Search instead for 
Did you mean: 

FATFS SDIO Stability issue

Jutt
Associate II

Packages Details

STM32F446RE Nucleo

CubeMX 5.6.0

STM32CubeF4 Firmware Package V1.25.0 / 12-February-2020

if i write every 30ms 512 Bytes. After some time SD card takes more time then normal please check image.GPIO Pin Set before writing and Reset after writing.

0693W000000UTDOQA4.png

Before the while loop just mount the card and open the file.

uint8_t wtext[512] = {0};
memset(wtext, 1, 512); 
while (1)
  {
     if ((HAL_GetTick() - Last_Time) >= 30){
      Last_Time = HAL_GetTick();
      HAL_GPIO_WritePin(GPIOC,GPIO_PIN_3,GPIO_PIN_SET);
      res = f_write(&MyFile, wtext, 512, (void *)&byteswritten); 
      if((byteswritten == 0) || (res != FR_OK))
          {
            Error_Handler();
          }
     HAL_GPIO_WritePin(GPIOC,GPIO_PIN_3,GPIO_PIN_RESET);
    /* USER CODE END WHILE */
}
}

may be you will think about saving the file. now i am just test the SD card behaviour. you will see instability with 10 mint. file size arround 165KB after 10 mint with 512 bytes reference.

i test it without DMA and with DMA but same result.

CPU core clock is 72MHz, DMA clock is 48 MHz.

SDIO clock factor divider is 6. rest is defualt settings.

i have 4 different cards(32GB)so on each card have same result. on some card instability comes within 2 mint and on some card it come after 10 mint.

0 REPLIES 0