cancel
Showing results for 
Search instead for 
Did you mean: 

osSignalSet+FreeRTOS Problem

km naxin
Associate II

void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)

{

 /* USER CODE BEGIN Callback 0 */

  if (htim->Instance == TIM1) {

  osSignalSet(defaultTaskHandle, 0x0001);

 }

 /* USER CODE END Callback 0 */

 if (htim->Instance == TIM4) {

  HAL_IncTick();

 }

 /* USER CODE BEGIN Callback 1 */

void StartDefaultTask(void const * argument)

{

 /* USER CODE BEGIN StartDefaultTask */

 /* Infinite loop */

 for(;;)

 {

osSignalWait(0x0001, osWaitForever);

  HAL_GPIO_TogglePin(GPIOA, USERLED2_Pin);

 }

 /* USER CODE END StartDefaultTask */

}

I tracked the code and found that entering the HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) function could not send a notification signal, I don't know why. If you switch to the GPIO interrupt callback function, it works fine.

 /* USER CODE END Callback 1 */

}

1 REPLY 1
Piranha
Chief II

Check the defaultTaskHandle handle value in non-working case with debugger and/or some test code.