TMS320F2800157: FreeRtos task suspend and vTaskDelay

Part Number: TMS320F2800157
Other Parts Discussed in Thread: SYSCONFIG,

I am using TMS320F2800157 with FreeRTOS. USe the sysconfig tool to configure the project and I created two task to blink two LEDs in control card. I though it is easy to use FreeRtos just like other micro controllers here. But here I see different or missing something.  I created two task to toggle each LED with diffrent delay... But both execute same time , one by one with lowest delay. Is there any document to read before I use freertos with this part number ?  below is the that two task to toggle thoes LED and I my observation is both LED toggle with 1sec interval.

void myBlink1Task(void * pvParameters)
{
GPIO_togglePin(LED2);
vTaskDelay(1000);

void myBlink2Task(void * pvParameters)
{
GPIO_togglePin(LED1);
vTaskDelay(5000);
}

  • Hi Maheswaran,

    FreeRTOS tasks need to execute in a loop, otherwise each task function will return after executing once and go into an unpredictable state. If this is the desired behavior, then you need to appropriately delete the task. 

    Regarding the delay time, the argument passed in vTaskDelay is the number of tick periods to delay. The value in seconds will depend on the tick rate set in FreeRTOSConfig.h

    Thanks,

    Arnav

  • Thanks Amav Menon,

    I agree your point... may be I can correct my code like below...

    void myBlink1Task(void * pvParameters)
    {

    while(1)

    {

          GPIO_togglePin(LED2);
           vTaskDelay(1000);

    }

    }

    void myBlink2Task(void * pvParameters)
    {

    while(1)

     {

        GPIO_togglePin(LED1);
         vTaskDelay(5000);

      }
    }

    But still some parameter setting in freeRTOS not running as expected. And my tick time is 1 msec ( 1000Hz). So my expectation of 1000 ms is correct,

    One update is, I recreate the project using "Universal2000" example project and added freertos and it is working as expected. 

    So some of my setting to free rtos or project setting have issue.