FreeRtos - configTICK_RATE_HZ

Working libraries, libraries being ported and related hardware
Post Reply
User avatar
Pito
Posts: 2003
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

FreeRtos - configTICK_RATE_HZ

Post by Pito » Sat Aug 06, 2016 5:22 pm

Hi, it is my understanding the FR delays are in Ticks.
When I change the configTICK_RATE_HZ to 100 or 10000 (default is 1000) I do not see any change in the periods I set as an absolute value in portTickType Ticks.
What could be the issue then? Is the FreeRtos Tick hardwired to the 32duino core tick?
Here is the 1sec Blinking LED demo to try out:

Code: Select all

// BLINKING LED
// Maple Mini
#include 
#define BOARD_LED_PIN PB1
 // Perform an LED blink every 1000msecs
 static void vLEDFlashTask( void * pvParameters ) 
 { 
 portTickType xLastWakeTime; 
 const portTickType xPeriod = 1000; // =1second with 1ms Tick (configTICK_RATE_HZ = 1000)
     // Initialise the xLastWakeTime variable with the current time. 
     xLastWakeTime = xTaskGetTickCount(); 
     for( ;; ) //
     { 
         // Wait for the next blink cycle. 
         vTaskDelayUntil( &xLastWakeTime, xPeriod );
         // Perform the LED blink 
         digitalWrite(BOARD_LED_PIN, HIGH);
         vTaskDelay(50); // 50msec blink
         digitalWrite(BOARD_LED_PIN, LOW); 
     } 
 }
void setup() {
  Serial1.begin(115200);
  delay (1000);
  Serial1.println (F("Blinking..."));
  delay (1000);
  // initialize the digital pin as an output:
  pinMode(BOARD_LED_PIN, OUTPUT);
  xTaskCreate(vLEDFlashTask,
              "Task1",
              configMINIMAL_STACK_SIZE,
              NULL,
              tskIDLE_PRIORITY + 3,
              NULL);
  vTaskStartScheduler();  
   Serial.println(F("Insufficient heap space?"));
   while(1);
}
void loop() {
  // Do not write any code here, it would not execute.
}
Pukao Hats Cleaning Services Ltd.

Manolo88
Posts: 7
Joined: Tue Nov 01, 2016 7:51 am

Re: FreeRtos - configTICK_RATE_HZ

Post by Manolo88 » Wed Sep 12, 2018 8:48 am

I have the same problem.

Some idea??
thanks

edogaldo
Posts: 432
Joined: Fri Jun 03, 2016 8:19 am

Re: FreeRtos - configTICK_RATE_HZ

Post by edogaldo » Wed Sep 12, 2018 9:13 am

Maybe I'm missing the point but aren't delays expressed in ms?
If yes, they should be independent on the tick rate..

Ok, sorry, the delay is expressed in num of ticks..

Post Reply