SD card writing in polling mode without DMA nor FreeRTOS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-17 2:19 AM
I am trying to write in the SD card in polling mode and it works successfully first two time and when i try to open the same file and write to it is fails and stuck at function " HAL_SD_ReadBlocks " at file stm32h7xx_hal_sd.c at the following condition:
if(((HAL_GetTick()-tickstart) >= Timeout) || (Timeout == 0U))
- Labels:
-
DMA
-
FreeRTOS
-
STM32H7 series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-05 4:52 AM
Hello @KhalieAli​ ,
Welcome to our ST Community :smiling_face_with_smiling_eyes:
In order to allow a better analysis of your problem, could you please share the project file to reproduce this issue, so that we can give you an answer.
Thanks in advance.
BeST Regards,
Walid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-05 11:43 PM
Hello @Walid ZRELLI​
using generated APIs at "sdmmc.h" and "fatfs.h" i call MX_SDMMC1_SD_Init(); MX_FATFS_Init(); in the initialization
- then at run time i made the following code in polling mode and i am not using DMA
if(f_mount(&FatFsSystem, (TCHAR const *)SYSTEM_PARTITION, 0) == FR_OK)
{
// Open file HelloWorld
if(f_open(&elffile, "LogFile.txt", (FA_CREATE_ALWAYS | FA_WRITE )) == FR_OK)
{
char myData[] = "Hello Bent, It is Workking now \nthanks, it is me khalid";
f_puts(myData,&elffile);
f_close(&elffile);
}
}
it success first time but when i call this code at the second time it stuck waiting time out which is very large number and when i decreased it the SD card read write operation never worked
thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-06 1:25 AM
Hello @KhalieAli​ ,
You can refer to the following example provided in the H7 firmware package:
- Projects\STM32H743I-EVAL\Applications\FatFs\FatFs_uSD_Standalone
This may help you.
BeST Regards,
Walid
