Skip to main content
Visitor II
February 20, 2020
Question

STM32L462 FATFS FR_DISK_ERR on f_write

  • February 20, 2020
  • 1 reply
  • 756 views

Using custom board with l462re, sdcard connected directly to mcu without external pullups.

SDMMC clockdiv set to 10, SDMMC freq set to 48MHz.

When ever I'm trying to use f_write or f_mkfs they return FR_DISK_ERR.

Sometimes sdcard is corrupts(file is created but files size is 4gb).

Tried 5-6 sdcards from 1gb to 32gb.

Same code but on f767 is working fine.

    This topic has been closed for replies.

    1 reply

    Graduate II
    February 20, 2020

    To understand why the top-level code fails you'll need to look at the DISKIO layer, and validate that.

    I wouldn't use f_mkfs() until you have the read/write sector(s) stuff working flawlessly.

    Do you have a UART you can output debug/telemetry data on? Which UART/pins ?

    SYakoAuthor
    Visitor II
    February 20, 2020

    I can use stlink for debug(breakpoints)