STM32- RTOS -Task Notify From ISR


This Content is from Stack Overflow. Question asked by Sina_Torkzadeh

I want to notify my task to run from an ISR. I red the RTOS docs but I could not do it. I would really appreciate if you tell me what I am supposed to do and give an example if it is possible. I used cmsis-V2.
Inside the ISR which I am sure the ISR works correctly I wrote:

if (htim == &htim16)
      BaseType_t xHigherPriorityTaskWoken;
      xHigherPriorityTaskWoken = pdFALSE;
      vTaskNotifyGiveFromISR(ADXL_HandlerHandle , &xHigherPriorityTaskWoken);
      portYIELD_FROM_ISR( xHigherPriorityTaskWoken );

and inside the thask, inside the for loop the first lines are:

ulNotifiedValue = ulTaskNotifyTake( pdFALSE, portMAX_DELAY);
      if( ulNotifiedValue > 0 ){
//my codes ....

before for loop I defined:

uint32_t ulNotifiedValue;

but the task is not executed. even once.
I use Nucleo H755ZIQ.

Thanks in advance.


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?