title: STM32- RTOS -Task Notify From ISR
body: <p>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:</p>
  <pre><code>  void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
  {
    /* USER CODE BEGIN Callback 0 */
  
    /* USER CODE END Callback 0 */
    if (htim-&gt;Instance == TIM15) {
      HAL_IncTick();
    }
    /* USER CODE BEGIN Callback 1 */
    if (htim == &amp;htim16)
      {
          BaseType_t xHigherPriorityTaskWoken;
          xHigherPriorityTaskWoken = pdFALSE;
          vTaskNotifyGiveFromISR(ADXL_HandlerHandle , &amp;xHigherPriorityTaskWoken);
          portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
        }
  
    /* USER CODE END Callback 1 */
  }
  </code></pre>
  <p>I also used systick timer for FREE RTOS and timer 15 as the system timer . is it possible that the problem is related to this part ? I dout because task_notify_give function only add up and is not a blocking mechanism like semaphore.</p>
  <p>and inside the thask, inside the for loop the first lines are:</p>
  <pre><code>ulNotifiedValue = ulTaskNotifyTake( pdFALSE, portMAX_DELAY);
        if( ulNotifiedValue &gt; 0 ){
  //my codes ....
  }
  </code></pre>
  <p>before for loop I defined:</p>
  <pre><code>uint32_t ulNotifiedValue;
  </code></pre>
  <p>but the task is not executed. even once.
  I use Nucleo H755ZIQ.</p>
  <p>before the definition of global variable, tasks are defined like this:</p>
  <pre><code>/* Definitions for ADXL_Handler */
  osThreadId_t ADXL_HandlerHandle;
  const osThreadAttr_t ADXL_Handler_attributes = {
    .name = &quot;ADXL_Handler&quot;,
    .priority = (osPriority_t) osPriorityNormal,
    .stack_size = 1024 * 4
  };
  </code></pre>
  <p>then inside the main function initializing the schduler is as follows :</p>
  <pre><code> osKernelInitialize();
   ADXL_HandlerHandle = osThreadNew(ADXL_Handler_TaskFun, NULL, &amp;ADXL_Handler_attributes);
  osKernelStart();
  </code></pre>
  <p>Then the timers will be started:</p>
  <pre><code> HAL_TIM_Base_Start_IT(&amp;htim16);
   
  </code></pre>
  <p>In CMSIS there is no such a thing like task notification, I took a short look. The functions I used inside the ISR routine are from FreeRTOS. will not there a contradiction? should I use only Free RTOS task create function instead of CMSIS functions?</p>
  <p>Thanks in advance.</p>