2024-12-04 10:32 AM - edited 2024-12-04 05:00 PM
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:
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
Solved! Go to Solution.
2024-12-05 09:14 AM
I discovered that the issue was occurred only when touchGFX was part of the project. I found another post and copied in their solution and It works:
MPU_InitStruct.Number = MPU_REGION_NUMBER3;
MPU_InitStruct.BaseAddress = 0x24000000;
MPU_InitStruct.Size = MPU_REGION_SIZE_512KB;
MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;
MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;
MPU_InitStruct.IsBufferable = MPU_ACCESS_BUFFERABLE;
Why this is the issue? I don't know.
Could you explain how this was causing a NO_FILE_SYSTEM error in FATFS?
2024-12-04 10:40 AM - edited 2024-12-04 10:43 AM
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 ...
2024-12-04 12:02 PM
@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
2024-12-05 12:47 AM
@EthanMankins wrote:This makes me think there's some sort of timing issue...
Indeed.
@EthanMankins wrote:not sure how to fix it though since I have already given this task Realtime priority
But the fact that a breakpoint "fixes" it suggests that the problem is with going too fast - not too slow.
Instrument the code so that you what's happening - in both cases.
Do you have a logic analyser to see what's actually happening on the wires?
2024-12-05 02:47 AM
Hello @EthanMankins ,
If you have a delay issue, you could try to fix it by introduce a small delay before calling the file system initialization functions to allow sufficient time for the system to stabilize.
Regards,
2024-12-05 09:14 AM
I discovered that the issue was occurred only when touchGFX was part of the project. I found another post and copied in their solution and It works:
MPU_InitStruct.Number = MPU_REGION_NUMBER3;
MPU_InitStruct.BaseAddress = 0x24000000;
MPU_InitStruct.Size = MPU_REGION_SIZE_512KB;
MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;
MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;
MPU_InitStruct.IsBufferable = MPU_ACCESS_BUFFERABLE;
Why this is the issue? I don't know.
Could you explain how this was causing a NO_FILE_SYSTEM error in FATFS?
2024-12-09 08:46 AM
Hello @EthanMankins ,
I am glad you found a solution!
I am not an expert at FATFS but I assume that TouchGFX changes the MPU settings and that FATFS require specific MPU settings that got changed by the TouchGFX TBS setup.
Regards,