We have a system running on a Tiva evaluation board, reading data from the SPI bus, using callbacks. On startup, the system calls Spi_transfer from a task, but thereafter the flow is as follows:
// The HWI ISR
MySPICallback ()
{
StampTheBuffer()
Swi_post (MySPISwi);
}
MySPISwi ()
{
ProcessTheData();
SPI_Transfer (); // Callback mode, so mutual recursion of a sort with the HWI.
}
In RTOS 2.12.1.33 this works beautifully, basically as written above, without any explicit management of interrupts - disabling or restoring of interrupts.
But in 2.16.0.8 the call to SPI_transfer in the SWI gets lost in the HWI and SWI dispatching code, and never returns.
I know that I recently read a post about very nearly this situation (it may not have been the SPI bus but about one of the other callback drivers) explaining that this sort of recursion didn't work in most versions, then was allowed to work in some version or another, then was broken, then was allowed to happen again, as long as one took some precautions or followed some particular practices.
I've decided that that post has all the answers, so I've spent an hour or so looking for it but am now starting to wonder whether it was a late-night hallucination.
There's not much going on on this system - 1 interrupt per millisecond.
Did some behavior relating to nested interrupts change between 2.12 and 2.16?
I'd be grateful if anyone remembers that post or has any particular insight into this problem.
- Bob