[C674X_0] ti.sysbios.gates.GateMutex: line 97: assertion failure: A_badContext: bad calling context. See GateMutex API doc for details.xdc.runtime.Error.raise: terminating execution
I am not using the DSP/BIOS 6 GateMutex. I have attached my CFG.
How do I find out where this error is coming from?
Kurt,
I expect you are calling System_printf from a non-Task thread and using SysStd or calling Memory_alloc (on a HeapMem instance) from a non-Task thread. If so, search the forums for "assertion failure gatemutex" and you will find several related posts with solutions.
Todd
I also have this error using printf in a task context (not HWI, nor SWI). The cause of the error, found through trial and error of moving the array out of the function, is that I've got a static array allocation on the stack in the task. The task stack size was too small.
I couldn't see a stack corruption in the ROV either on the task that crashed. Also, I didn't find this on the Wiki page. Can someone add that?
BIOS fills the stacks with a known value and we check these stacks using ROV and during context switch to make sure that the top elements of the stack are not corrupted. As you know, it is possible for local variables to be allocated on the stack but not actually written to. In this case, the stack can overflow it's bounds but those top elements will not be trashed. Unfortunately, there is no easy way to detect this without h/w stack bounds checking which is not available on many parts. We do the best we can to measure and catch stack overflow, but the case of the big unused local array or structure is something we cannot catch.