Skip to main content
dkumar
Associate II
February 20, 2018
Question

STM32f407vgt6 discovery SDIO FatFs:SDCard FR_DISK_ERR Error

  • February 20, 2018
  • 4 replies
  • 1958 views
Posted on February 20, 2018 at 12:47

The original post was too long to process during our migration. Please click on the attachment to read the original post.
    This topic has been closed for replies.

    4 replies

    Tesla DeLorean
    Guru
    February 20, 2018
    Posted on February 20, 2018 at 15:28

    You're probably trashing the memory in the system because your BSP_SD_ReadBlocks() is trying to read into a 32-bit word. If you want to read/write 10 512-byte blocks you're going to need to use a 5KB block of RAM to achieve that.

    Also writing to arbitrary blocks runs the risk of trashing the file system on the card.

    Perhaps skip the block test, and see if FatFs functions better without them.

    There seems to be an odd mix of references to SDIO and SPI to access the card

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    dkumar
    dkumarAuthor
    Associate II
    February 20, 2018
    Posted on February 20, 2018 at 17:55

    i am trying all thing to access SD Card using SDIO FATFS,

    also as you suggested.

    but not any change in result.

    FR_DISK_ERR((
    Tesla DeLorean
    Guru
    February 20, 2018
    Posted on February 20, 2018 at 22:05

    There have been several thread on these types of issues, you'd want to instrument BSP_SD_ReadBlocks() to understand the interactions there, and perhaps reflect those in your initial read test.

    You could see if less aggressive clocking works.

    Not familiar with the socket/wiring in use here. I generally recommend using sockets with pull-ups there rather than on the STM32 side.

    Here we use the STM32F407G-DISCO we use the STM32F4DIS-BB breakout board with microSD socket.

    Look also at using the HAL examples rather than the CubeMX generated stuff, I'm not wading into debugging exercise with Cube.

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