rtel wrote on Tuesday, May 22, 2012:
As you elude to in your email, only interrupts at or below configMAX_SYSCALL_INTERRUPT_PRIORITY can call interrupt safe FreeRTOS functions (those that end in FromISR). The port never completely disables interrupts, and interrupts above configMAX_SYSCALL_INTERRUPT_PRIORITY are never disabled.
Interrupts at or below configMAX_SYSCALL_INTERRUPT_PRIORITY get masked in critical sections using a bit mask in basepri. To allow interrupts of priority 0 to call interrupt safe FreeRTOS functions it would be required to have a bit mask that masks off interrupts at priority 0, and you cannot have a 0 bitmask on a Cortex-M core because the core itself (i.e. there is nothing the software can do about it) treats 0 as a special case that means all interrupts are enabled. This is a quirk of the backwards interrupt priorities on Cortex-M cores (where low values mean high priority), because there has to be a mask which means enable everything, and that mask cannot be 0xff because 0xff means mask all but the very lowest priority.
I would personally be very interested in any alternative you had for this, because I don’t think there is one other than globally disabling interrupts (not desirable), but if you come up with something I’m afraid it is unlikely to make it into the main line code because it would probably result in more lines of code for a result with less functionality.