cancel
Showing results for 
Search instead for 
Did you mean: 

fsfat with freeRTOS

yang hong
Associate II

I am using NUCLEO-H743ZI2. I am using STM32CUBEIDE v1.7 with h7 v1.90 to config a application to work with MicroSD card (SDMMC1). After I use stm32cube to config FsFat sdmmc1 , mdma and freertos v1.2. However, the program doesn't work properly. at the end of data file, it always has many NUL, but my text doesn't include this NUL, also as long as file includes this many NUL, none of text can be written. I am thinking possible problem comes from mdma. Does anybody know how to set mdma. I set two channels, please check attached screen shot.

0693W00000DlRy9QAF.png

3 REPLIES 3

Hello @yang hong​ ,

Take a look at the following example provided under our H7 Firmware Package (Path : Projects\STM32H743I-EVAL\Applications\FatFs\FatFs_uSD_DMA_RTOS)

You may find this useful.

BeST Regards,

Walid

Hi @yang hong​,

In addition to what has been said, here is an Application note to get started with STM32H7 Series SDMMC host controller with much more details and explanations about SDMMC interaction with other internal peripherals. It presents typical examples that highlight the SDMMC host interface features that facilitate its configuration.

Hope this will help you.

Khouloud.

yang hong
Associate II

After I took more than one week effort on it, I finally found the issue comes

"#define ENABLE_SCRATCH_BUFFER",

In standalone project, program doesn't enable scratch buffer, and when I configure the program from stm32cubemax, it doesn't include this features in stm32cubemax, but when the whole thing is not working, I modify this configuration, then I start to struggle the issues.

I still have one confusion. how BSP_SD_ReadBlocks_DMA works with DMA because I can't find DMA configuration for sdmmc1. I only use DMDA to work on that which is configured by stm32cubemax.

Does anybody understand that?