rtel wrote on Thursday, December 03, 2015:
That function is doing very little that could make the system crash. Possibilities are:
- the error actually occurred before this function started to execute, for example, maybe the mutex object has been corrupted by something.
- The CPU privilege state has somehow changed, denying access to the registers being access by that macro (extremely unlikely, unheard of).
- The return address in the bx lr function has been corrupted.
The CPU won’t just crash and freeze, so you need to see what happens when it crashes. Most likely the processor will go into a fault handler, in which case you have the opportunity of debugging how it got there.
Do you have configASSERT() defined, and are you using a recent version of FreeRTOS so configASSERT() will help trap a wider range of configuration errors?
Have you set the priority of all the interrupts that are being used? You must not leave any at their default if they use FreeRTOS function.