I am using RA6M5 uC with 3 threads: one for app, another for CAN comunication and the last one like logger. This thread is configured to use TFAT library and USB to save data in pendrive every 5 seconds.
Starts ok, but after a while fails in ff_open function and analyzing it gives F_ERR_IOMAN_ACTIVE_HANDLES error.
This is what it is programmed:
It seems that F_ERR_IOMAN_ACTIVE_HANDLES means that The partition cannot be unmounted until all active file handles are closed.
I am not sure why would you be getting that when calling ff_fopen. If possible, can you give us the stack trace so that we can help with debugging?
I’m not sure what you want, do you want the stack analysis file? I attached that… Stack_trace.7z (67.8 KB)
If it isnt’t that what you want, can you say me how to get that information?
Sorry for the delay responding.
The error occurs when in ff_fopen function calls to FF_FinDir and the error that gives is FF_ERR_FILE_INVALID_PATH, no FF_ERR_IOMAN_ACTIVE_HANDLES that I said you, I didn’t realize that prvFFErrorToErrno function changes the value of error.
I attached stack trace when the error occurs stack_trace.7z (63.1 KB)
Please put breakpoints in these places and share call-stack when anyone of them is hit. I do not know how are you generating this “stack trace” but it does not seem to be what I am looking for. The “call-stack” shows the order in which functions are getting called when a breakpoint is hit. Your IDE should have a “call stack” window. If you are using GDB, you can use backtrace command to get the call-stack.
The stack trace shows that it failed to find directory /logger while trying to open /logger/206_001.txt. Did you create /logger directory by calling ff_mkdir?
I have tried it but the result is the same, it doesn’t work well with this pendrive. I will use another one, maybe there is something wrong with this one…
Hello,
I have tried with other pendrives and they work fine. I don’t know why with this one it doesn’t work properly, but maybe the pendrive has some defect.