Is there a chance for vTaskDelay(1) to return immediately?

Hi,
I see a strange behaviour about vTaskDelay(1).
I have something like this in a loop that waits for a resource to get free (I2C not busy to be precise):
if (resource_is_busy)
{
counter++;
if (counter > 5) { error_management (); }
else { vTaskDelay (1); }
}
Most of the times this works fine, 5 tries is more than enough to catch a free bus, normally 1 try is sufficient.
Now sometimes it happens that all 5 tries run out and some UART output I inserted after counter++ all show up on the terminal program with exactly the same timestamp. Also osciloscope shows only a delay of 1.9 msec (configTICK_RATE_HZ = 500, so 1 tick = 2 msec).
I work on STM32G07 = Cortex M0+ with FreeRTOS 10.4.
Any ideas? Can vTaskDelay go for the same tick several times?

Thanks for any help
Martin

If you call vTaskDelay(1) at the very end of the tick period, it can return almost immediately, as that means at the next tick.

This won’t happen on consecutive calls though.

IF you really need >= 1 tick, you need to call with a parameter of two, at least for the first time through the loop (but your sort of case doesn’t actually need that adjustment).