cancel
Showing results for 
Search instead for 
Did you mean: 

FATFS + RTOS + touchgfx

EthanMankins
Senior

I have a working project that simply writes to a a file on an SD card (Using STM32H7B3I-DK, Not Using RTOS).

When I add it to a touchgfx project, f_mount() and f_open() return NO_FILE_SYSTEM. This happens even after f_mkfs() returns FR_OK. I have the following parameters:

  • Freertos - task : stack 512 (words)  Priority : osPriorityRealtime
  • Project manage - linker settings Minimum Heap Size : 0x1000
  • Project manage - linker settings Maximum Heap Size  : 0x1000
  • FATFS - SDMMC instance : SDMMC1 Use DMA template - Enabled
  • SDMMC1 - Use clock divide factor : 2

There is no DMA Settings tab in SDMMC1, is this an issue?

EDIT: I have tried it with just RTOS and FATFS and It works... The issue occurs when touchgfx is in the project

2 REPLIES 2

Don't forget to mark the solution on your previous thread:

https://community.st.com/t5/stm32-mcus-embedded-software/fatfs-failure-with-freertos/td-p/750161

 


@EthanMankins wrote:

f_mount() and f_open() return NO_FILE_SYSTEM. 


So step into those functions and see why they do that.

Compare & contrast with your working version ...

@Andrew Neil , sorry forgot to mark prev thread...

The code I put in regard SD card is the same, the only difference is the new one has RTOS.

I have found  a very weird behavior. If I place a breakpoint on the following line in find_volume() and then click resume once it hits it, f_mount() works fine:

(line 3060) fmt = bsect ? check_fs(fs, bsect) : 3;	/* Check the partition */

This makes me think there's some sort of timing issue... not sure how to fix it though since I have already given this task Realtime priority