This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM48L940: vTaskDelay() tick period on RM48

Part Number: RM48L940

I have an issue where vTaskDelay() doesn't seem to behave as expected.

When I call vTaskDelay(1) to blink an LED, it blinks at a period of about 200ms (est. by watching blink rate). When I use vTaskDelay(2) or anything other than 1, the LED stays on forever (I can tell the code is still executing). For instance:

vTaskDelay(2)  ----> Period seems forever after watching for many minutes

vTaskDelay(10000/portTICK_PERIOD_MS) ------> Period about 8s

vTaskDelay(1000/portTICK_PERIOD_MS) ------> Period seems forever after watching for several minutes

In FreeRtosConfig.h I have:

#define configCPU_CLOCK_HZ     ( ( unsigned portLONG ) 100000000 ) /* Timer clock. */

Is there any configuration that I'm missing to set the proper tick rate?

PS: I posted this question a couple of days ago but I can't find my post and didn't get confirmation or response so I'm re-posting.

  • Hello,

    Sorry for late replay. I am in business travel and have limited access to internet.

    What is portTICK_PERIOD_MS defined in your project? Normally in freeRTOS, vTaskDelay(1) is to delay by 1ms.
    If portTICK_PERIOD_MS is defined as 1, vTaskDelay(10000/portTICK_PERIOD_MS) will delay by 10s, and vTaskDelay(1000/portTICK_PERIOD_MS) will delay by 1s only.
  • Thanks for the reply.

    portTICK_PERIOD_MS was defined as below:

    #define portTICK_PERIOD_MS    ((TickType_t) 1000 / configTICK_RATE_HZ)

    I changed it to 1 like below

    #define portTICK_PERIOD_MS    (TickType_t) 1

    and there is no difference in behavior.

    vTaskDelay(1) --> delays by about 250 ms judging by blink rate

    vTaskDelay(2) --> delays by about 35 seconds

  • My issue is resolved now. The debug probe was interfering with execution time and hence the erratic delays