CMSIS v2 timer blocked

Freertos CMSIS v2 (STM32 Cube IDE)timer problem

When I use an infinite loop in any task, the timer is blocked (the Callback function is not called). Other tasks run normally.

Test program:
DefaultTask: toggle LED1
Task01: blinking LED2
Task02: blinking LED3
CallbackTimer01: blinking LED timer
when used in DefaultTask:

while(!HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_13));

LED1 toggle on signal from input
LED2 is blinking
LED3 is blinking
The LED timer does not blink

//toggle LED1
void DefaultTask(void *argument)
{
  for(;;)
  {
	  while(!HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_13));//{osDelay(1);}
	  HAL_GPIO_TogglePin(GPIOC,GPIO_PIN_15);
  };

}

//blnking LED2
void Task01(void *argument)
{
  int timer;
  for(;;)
  {
    osDelay(1);
    if(++timer>200){timer=0;HAL_GPIO_TogglePin(GPIOB,GPIO_PIN_14);}
  }
}

//blinking LED3
void Task02(void *argument)
{
  int timer;
  for(;;)
  {
    osDelay(1);
    if(++timer>200){timer=0;HAL_GPIO_TogglePin(GPIOB,GPIO_PIN_13);}
  }
}


//blinking LED timer
int timer;
void CallbackTimer01(void *argument)
{
	if(++timer>50){timer=0;HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_0);}
}

When I put in the infinite loop osDelay(1);

while(!HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_13)){osDelay(1);}

LED timer flashes - Timer calls the callback function.

Is this normal behavior?

If you have a task that doesn’t block, then all tasks of a lower priority will never run. If you haven’t enabled Time Slicing and Preemption, then that includes same priority tasks.

So, don’t do that. Tasks need to block with the appropriate FreeRTOS Call (like a delay or wait on a semaphore/queue) to wait for the time to do their next action, not just a “spin-wait” loop polling on something to see when it is time to act.

I understand now - thanks for the reply