Skip to main content
Visitor II
May 7, 2020
Question

Fail to write to SD

  • May 7, 2020
  • 1 reply
  • 863 views

Hi,

I'm using STM32L451RCT with SDMMC and FATFS.

I'm Generating the code from CUBE.

Reading files (f_read) from SD is working but I'm failed to write to file (f_write)

Does anyone know how can I solve the problem

    This topic has been closed for replies.

    1 reply

    Super User
    May 7, 2020

    Look at the return value. Figure out which line is failing, go from there.

    Schar.1Author
    Visitor II
    May 7, 2020

    Hi,

    The return value from f_write is: FR_DISK_ERR

    In SD_write function it get out with timeout after BSP_SD_WriteBlocks_DMA call

    Graduate II
    May 7, 2020

    Have to debug the DISKIO layer

    Would look at the IRQ Handler, and make sure the one you need is not WEAK.

    Check the .MAP and .LST files, check what code got built /bound