Issue with read and write SD Card through SPI /(freertos+fatfs)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-03-14 2:50 PM
I'm facing an issue with reading and writing data on an SD card using SPI and FATFS on an STM32F767ZIT6 microcontroller. When I don't enable FreeRTOS, the SD card operations work fine. However, when I enable FreeRTOS, the SD card operations fail. During code generation, I receive a suggestion
I've referred to the following guide for implementing SD card read and write: https://www.micropeta.com/video29
Can anyone provide guidance on resolving this issue?
- Labels:
-
SPI
-
STM32F7 Series
-
SysTick
-
TIM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-18 9:06 AM
Hello @Dushyantsingh
You can refer to the examples provided in STM32Cube firmware H7 located at the following path: Projects\STM32F769I_EVAL\Applications\FatFs\FatFs_uSD_RTOS
.
Also, it is recommended to use DMA process when using FreeRTOS with SD card.
Saket_Om
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-18 9:18 AM
I'd opt for a different socket, WaveShare has several suitable for 3V STM32 operation, and has pull-ups on the correct pins. And supportive of SDIO/SDMMC peripheral usage.
SD Cards have zero tolerance for you wandering off-task mid way through data interactions.
Best to use DMA. For F7 use DTCM RAM for DMA buffering with SDMMC, avoids a lot of coherency issues.
Multiple threads can't use SDIO/SDMMC/SPI and FATFS concurrently. It's a resource that must be serialized / mutex'd
Up vote any posts that you find helpful, it shows what's working..
