Skip to main content
Visitor II
August 4, 2022
Solved

But it is normal to write single blocks continuously (cmd24), but the speed is a little slow. I use FatFs to write multiple blocks (cmd25) to SD card. I can only create a new TXT file, but there is no data in it.

  • August 4, 2022
  • 1 reply
  • 970 views

But it is normal to write single blocks continuously (cmd24), but the speed is a little slow. I use FatFs to write multiple blocks (cmd25) to SD card. I can only create a new TXT file, but there is no data in it. And when writing multiple blocks, the SD card always returns BSP_ SD_ Other_ Error, this bothered me for a long time.The procedure is as follows:

0693W00000QMzyPQAT.png0693W00000QMzsrQAD.png

    This topic has been closed for replies.
    Best answer by Tesla DeLorean

    My preference is to use parts with an SDIO or SDMMC peripheral that clocks rapidly and manages the protocol level stuff more cleanly/directly.

    ST has posted some SPI based examples within the Cube packages, generally in the form which supports an Adafruit shield. I have commented on occasion that there are some bugs in the multi-sector implementation, but I haven't followed up on that in recent years as my interest level with SPI connectivity is pretty low, and I'd need to be paid to wade into that with my time. Anyway the forum posts probably still exist, and you might have luck with the search function on the forum, or more broadly with Google.

    STM32Cube_FW_F7_V1.16.0\Drivers\BSP\Adafruit_Shield\stm32_adafruit_sd.c

    1 reply

    Graduate II
    August 4, 2022

    My preference is to use parts with an SDIO or SDMMC peripheral that clocks rapidly and manages the protocol level stuff more cleanly/directly.

    ST has posted some SPI based examples within the Cube packages, generally in the form which supports an Adafruit shield. I have commented on occasion that there are some bugs in the multi-sector implementation, but I haven't followed up on that in recent years as my interest level with SPI connectivity is pretty low, and I'd need to be paid to wade into that with my time. Anyway the forum posts probably still exist, and you might have luck with the search function on the forum, or more broadly with Google.

    STM32Cube_FW_F7_V1.16.0\Drivers\BSP\Adafruit_Shield\stm32_adafruit_sd.c

    LepAuthor
    Visitor II
    August 5, 2022

    Thank you so much for your multi-testing help. Because my MCU is STM32WB55RGV6, there is no SDIO, only SPI.

    The spi driver file I use is also the same, but it still writes a single block (cmd24) multiple times instead of writing multiple blocks continuously (cmd25).