I have an eMMC connected to an STM32H7 via the SDMMC1 interface and am using the File System component provided by Keil.
The eMMC registers as M0:. In the debugger, the File System window shows everything looks good.
finit() and fmount() both return fsOK.
However, after these, when I use fopen("Test.txt", "w") the result is always NULL.
I do not have access to the source code and there are no events generated when this call fails.
How can I debug this?
I would do the same as in the debug target of our example projects:
The middleware manual shows you more details on how to do that. See: https://www.keil.com/pack/doc/mw/FileSystem/html/fs_create_app.html#fs_debugging
I already have tried using the debug events for the File System component (Variant: LFN Debug). All of the File System debug events enabled. As I mentioned earlier, fopen() does not generate any events when it fails (returns NULL).
Any other ideas?
TB#13 said:The eMMC registers as M0:. In the debugger, the File System window shows everything looks good.
When did you take this picture? It shows that the driver M0 as well as the drivers are not initialized.
When you used the Event Recorder, you should have seen the events and API calls of the previous finit() and fmount() calls as well as the fopen call in the Event Recorder window. Usually, you see error messages from the driver layers below.
Only some ideas:
- Did you format the drive?- Can you connect the eMMC module to PC to format and write a few files on it (some eMMCs are soldered, others are modules that can be removed)? If yes, can you read these files in your microcontroller application?- do you see some activity on the eMMC signals when you initialize, mount and write to the file system?
The picture should have been this one, it appears as if everything is configured correctly and the drive is formatted?
You'll notice in the event log that there are no events generated when fopen() fails.
The debug widow shows the file failed to open when I run:
Hans Schneebauer Do you have any further suggestions?
Try to increase mutex/event in rtx configuration file. I had the same problem.