User Activity

Hi i have a problem. When i use a sensor with freertos and i put in the same task the function to read the value from the sensor and the osdelay() my task do one misuration and after do nothing. I print the value with the HAL_UART_Transmit.
If i use 2 task, and in first task put the VL53L0X_PROXIMITY_GetDistance() with osDelay, second task never start. I tried to replace osDelay() with other function for context switch but i have same problem.