MPU wrappers are incomplete?

nagisa wrote on Tuesday, October 23, 2018:

Hello,

We are using an MPU port for our FreeRTOS. Most of the stuff seems to be working just fine and MPU is operating, however, when changing some existing functionality that uses task notifications from xTaskNotifyGive, ulTaskNotifyTake and their FromISR counterparts to xTaskNotify (with eSetBits flag) and friends, I found out that calling xTaskNotifyFromISR would not raise the privilege properly, which would lead to the system crashing because of a MemManage fault.

Partaking in mpu_wrappers.h and similar headers seems to indicate that only a few select functions are wrapped for the MPU operation. For example it can be seen that only 3 FromISR functions are wrapped at all!

Is there anything special we need to do to ensure correct operation of FromISR functions? Or is it just simply a case of MPU wrapping being incomplete?

rtel wrote on Tuesday, October 23, 2018:

ISRs should be running with full privileges, hence it should not be
necessary to raise the privilege for ‘from isr’ functions. Are you
calling xTaskNotifyFromISR() from an interrupt or from a task?

nagisa wrote on Wednesday, October 24, 2018:

ISRs should be running with full privileges, hence it should not be necessary to raise the privilege for ‘from isr’ functions.

A-ha! Interesting. Any reason why the 3 FromISR functions which do have wrappers are wrapped?

Are you calling xTaskNotifyFromISR() from an interrupt or from a task?

I’m fairly confident I was calling xTaskNotifyFromISR from an interrupt context. However, I cannot deny that I always assumed FromISR functions are strictly more general and can be used from the task context as well. Unsurprisingly, I was wrong.


All that being said, I have forgotten the steps I took to originally encounter the issue and am unable to reproduce it again. Furthermore, I ended up reverting to xTaskNotifyGive/Take, so whatever issue this was, it is now of little relevance.

Thanks for the help!
S.