anonymous wrote on Wednesday, July 13, 2011:
I have several tasks running, and two peripherals on a single SPI port. I am using a semaphore to protect access to the SPI port so that one task that is using it finished before another task needs it (regardless of which peripheral). I use xSemaphoreTake to “grab” the semaphore, and xSemaphoreGive to “release” it. This has been working fine for quite a while, but recently I added a new reference to one of the SPI peripherals and I’m getting an odd hang. It is hanging in the loop in vListInsert that has all the warnings about interrupt priorities on Cortex cores. But all of my interrupts are set to configLIBRARY_KERNEL_INTERRUPT_PRIORITY (15, lowest priority), and the hang doesn’t occur in an interrupt at all. What I see stepping through the debugger (IAR) is that one task grabs the SPI port, then a second task calls the xSemaphoreTake and blocks, as it should. But the first task then never gives up the semaphore, and as best I can tell no more task switches occur while the second task is blocked. I’m kind of at a loss on how to debug this. Anyone have any suggestions?