cancel
Showing results for 
Search instead for 
Did you mean: 

Fail to write to SD

Schar.1
Associate

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

3 REPLIES 3
TDK
Guru

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

If you feel a post has answered your question, please click "Accept as Solution".

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

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..