This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[C674X_0] ti.sysbios.gates.GateMutex: line 97: assertion failure: A_badContext: bad calling context.

Other Parts Discussed in Thread: SYSBIOS

All of a sudden we get this error from our program.  We are not using GateMutex. The last SYS/BIOS item added was an SWI (that is currently not being called).

Here is the entire eror message

"[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"

  • Kurt,

    GateMutex is used internally by SYS/BIOS, for example for HeapMem_alloc() and HeapMem_free().  This error indicates a function using the mutex is being called from a Swi or Hwi context.

    Can you set a breakpoint on "xdc_runtime_Error_raiseX__F", and when you hit that look at the call stack to find out what function is being called and asserting?  I'm not sure if the symbol name will match exactly for your target, but if that symbol is not found, you can look in the .map file for "xdc_runtime_Error_raise"  

    You can also look at ROV at that point to see thread states and see if any errors are detected by ROV...

    Scott

  • lacking any other tools, I stepped through our code until I found the offending line.  and yes, we are calling malloc in an HWI.

    silly me, I should have known that. the message was obvious...