cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Lep
Senior

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

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

View solution in original post

2 REPLIES 2

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

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

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).