Sysbios 6.37.00.20
BiosPSP 3.00.1.0
Just some background, I'm using Mcbsp with issue/reclaim GIO model to aquire a signal from an ADC. I have a heapBuf declared where I allocate a block, and pass the data to a DSP algorithm, which frees the memory after I've processed it.
I'm getting a "ti.sysbios.heaps.HeapBti.sysbios.knl.Semaphore: line 207: assertion failure: A_badContext: bad calling context. Must be called from a Task." error during runtime.
It seems the cause of this is usually due to having a Semaphore_pend in a SWI or a HWI. I've searched my project and all of my Semaphore_pend calls are located inside tasks. When the execution terminates, the ROV tells me that the thread type is Main.
I do see a pair of semaphores in the ROV that I didn't create, and they have no label. I know the GIO issue/reclaim uses semaphores, so I'm assuming that's what they are from.
This error occurred when I added some extra instructions to DSP algorithm. With some count variables thrown into the DSP algorithm, I see that it consistently runs 15 times before it errors out. First thought was that these extra instructions are causing the heap to fill up before I can process the data, but looking are the ROV, I have 2 allocated blocks out of 32 total... so probably not a heap full error.
However... I increase the heap to 48 blocks, and the algo runs 23 times before the error. A heap size of 64 will let the algo run 31 times before the error. In each case, the ROV says that only 2 blocks are allocated, but there seems to be a linear relationship between the number of blocks in the heap, and how many times the algo will run before the error is thrown.
