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