I'm looking for an explanation for why I see the GateMutex_A_badContext error and info on ways to get rid of it. I'm using both cores of an F28M35H52C1 Concerto part, BIOS version 6.34.04.22, and CCS version 5.3.0.00090. The M3 core has 12 HWIs and the C28 core has 13 HWIs. I get the error when I add a task to the M3 that uses MessageQ to repeatedly send a message to the C28. In the C28, code execution never gets past MessageQ_get() and eventually it hits the abort() function and prints the following error to the console:
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
From looking at the API documentation for GateMutex, I found that using SysMin instead of SysStd and setting BIOS.rtsGateType to BIOS.GateHwi eliminates the error. This worked for my project and allows my code to run fine. However, in this project real-time response to interrupts is important, which makes me concerned about using BIOS.GateHwi since the BIOS API documentation states:
GateHwi — Interrupts are disabled and restored to maintain re-entrancy. This is a very efficient lock but will also result in unbounded interrupt latency times. If real-time response to interrupts is important, you should not use this gate to lock the RTS library.
I stumbled upon other workarounds for this error that I can't explain:
1. Getting rid of any one of the Hwi.creates in the C28's .cfg. It doesn't matter which one.
2. Adding another task to the C28's .cfg. It can be a task w/ no code in it.
Both of these get rid of the GateMutex error and allow the program to run fine, but I would like to know why. Why do I see the error in the first place and why do these workarounds get rid of it?
Thanks,
Nick