-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uSD logging causes assert in tasks.c #593
Comments
Yes, I think I had the flow deck attached because I was testing at home. |
We been trying to investigate this further. It is indeed that it is caused due to a spimutex being opened by one task and closed by another. The usddeck driver has a lot of closing and openings of the spibus mutex so it might go wrong somewhere there although it is difficult to pinpoint where it goes wrong since the fatfs_sd driver is a bit all over the place. The sendcommand is where it goes wrong (the second deselect), and probably it deselects the flowdeck's mutex while it shouldn't while it is actually expecting it's own still operating (it is also opened it the same function...) The weird thing is though, is that FreeRtos should not even switch tasks during that time but for some reason it does. |
Further investigation shows indeed that Fatfs is giving the spimutex twice and after the flow deck has taken it. The fatfs_sd integration probably needs to be rewritten. Not designed for sharing a bus... This issue happens now because at some point I added a systemWaitStart to start the usdlog (to fix another issue) and this is causing the flow and usdlog to run at the same time which causes this conflict. I did a quick fix to prevent the spimutex to be given twice but it does not solve the whole problem of course, then we are back to issue #270. |
Even if both share the SPI bus, shouldn't the uSD deck still work at low logging frequencies? In #270 it seems like logging completely stops, which is likely a SW bug? |
I am using the latest master branch with a simple
config.txt
such as:The CF reboots with
SYS: Assert failed at .//vendor/FreeRTOS/tasks.c:4049
when logging is started (settingusd/logging
parameter to 1). Here is an example stacktrace with gdb:I am not sure which mutex is triggering the condition. My suspicion is that the spiMutex is somehow taken in a different task and attempted to be released in another task. Note that this was not an issue in older firmware versions with the same usd_deck.c code. Thus, this must be caused by some other recent changes (e.g., FreeRTOS?).
The text was updated successfully, but these errors were encountered: