FreeRTOS scheduler not triggers the task on time

cancel
Showing results for 
Search instead for 
Did you mean: 

FreeRTOS scheduler not triggers the task on time

188 Views
samcs
Contributor II

Ported old project on For Arm 2.0  platform to S32DS 3.4 Platform, but found the scheduler not triggers the task on time.


xTaskCreate( InitJobTask, "IK", 512 , NULL, mainQUEUE_SEND_TASK_PRIORITY + 8, &Rt_InitTaskxHandle); // Init Task
xTaskCreate( DrvTask, "TH", 512 , NULL, mainQUEUE_SEND_TASK_PRIORITY + 11, &Rt_DrvTaskxHandle );

vTaskStartScheduler();

 

static void InitJobTask( void *pvParameters )
{

     for( ;; )
    {
        SystemInit();
      vTaskSuspend(Rt_InitTaskxHandle);
    }
}

 

uint32_t drvt1 = 0;
uint32_t drvt2 = 0;
uint32_t drvDelt[32] = {0};
static void DrvTask( void *pvParameters )
{
    static TickType_t xLastWakeTimeMs;
    int i = 0;

    xLastWakeTimeMs = xTaskGetTickCount();

    for( ;; )
    {
         drvt2 = GetTimeStampTimeMs(); 

         DrvTask();

         drvDelt[i] = drvt2 - drvt1; 
         drvt1 = drvt2;

        i += 1;
       if (i >= 32 )
      {
          i = 0;
       }

      vTaskDelayUntil( &xLastWakeTimeMs, 5);

   }

}

Debug result:

samcs_0-1653182491720.png

but the old project on For Arm 2.0, works well.

Did anyone meet similar issue before?  i don't know how to fix it now.

 

 

 

 

0 Kudos
5 Replies

110 Views
samcs
Contributor II

Found the issue

0 Kudos

163 Views
samcs
Contributor II

I found in task.c , NXP SDK, /SDK/rtos/FreeRTOS/Source/tasks.c,
the macro defined in FreeRTOSConfig.h , seems not working,
for example,

samcs_0-1653251278155.png


While in FreeRTOSConfig.h:

samcs_1-1653251312980.png

Even i added the macro definition  in task.c:

samcs_2-1653251361022.png

still the macro not works, why macro be defined, but it not works?

0 Kudos

149 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

I'm not sure if I get the point - you like to disable the RUN_TIME_STATS? Or you like to enable it? If you like to enable it - you need to set configGENERATE_RUN_TIME_STATS to 1 - like this: 

 

#define configGENERATE_RUN_TIME_STATS   1

 

Jiri

0 Kudos

145 Views
samcs
Contributor II

it should be disabled, in fact, in task.c, all macros not working,need to check makefile, i think,

it's weird, even i define a new Macro in the file, 

#define Configure_AAAAAA   0

#if (Configure_AAAAAA != 0)

still, it not works

0 Kudos

133 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

just for clarification (i'm little bit lost) - what behavior are you expecting from your code snippet

 

#define Configure_AAAAAA   0

#if (Configure_AAAAAA != 0)

        do_something();

#endif

 

?

0 Kudos