AnsweredAssumed Answered

Troubleshooting tasks silently failing.

Question asked by Sean MacKay on May 12, 2014
Latest reply on Nov 25, 2014 by Sean MacKay

Hello, I am using MQX 4.0.2, and CodeWarrior 10.5, and have been experiencing an unusual, and somewhat annoying problem while attempting to run or debug my code:


Tasks which install and use MFS sometimes inexplicably fail during runtime, or during debugging. They will even fail when stepping through code line by line, where once a write() call is reached the code is bumped to dispatch.S and that task no longer operates. There are no returns from the function, printf statements on the next line do not execute in debugging or normal operation, and no errors that I can see anywhere. I haven't yet checked kernal logs though.


What is weird about this is the code itself appears to work properly, but only fails if enough other things are happening:



First, it only happened when I was attempting to install MFS, write, and read a test file. If the disk was not formatted, It would format the drive then fail unexpectedly on the write call. But if I reset the device, and the drive was now properly formatted, then it would write and read properly.



The MFS device and formatting is now handled in a separate task, and a new task is created to do the actual file reading and writing. If I run a pared down test version, which runs only the filesystem task and the main task, it can write the file properly. But if I run the full system with other tasks (relating to telnet, serial data processing, etc). the file writing will silently fail.


I have looked at the memory pools during execution, and they don't appear to overfill before or after failure. Any idea where else I should look to track down the source of this?