# configTICK\_RATE\_HZ scales application speed?

**URL:** <https://forums.freertos.org/t/configtick-rate-hz-scales-application-speed/7382>\
**Category:** Kernel\
**Created:** [August 20, 2018, 8:03am UTC](https://forums.freertos.org/t/configtick-rate-hz-scales-application-speed/7382 "2018-08-20T08:03:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 20, 2018, 8:03am UTC](https://forums.freertos.org/t/configtick-rate-hz-scales-application-speed/7382/1 "2018-08-20T08:03:47Z")

</div>

**[danielgraham2](https://sourceforge.net/u/danielgraham2/)** wrote on [Monday, August 20, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/16cd278a/#f332):

I have following (strange?) behaviour:  
when I change the configTICK\_RATE\_HZ value, my application speed scales with the factor i changed the value with.

Example: I have a webserver that can up/download a file.  
My configTICK\_RATE\_HZ is 250 Hz. Here the upload takes 1 Minute.  
When I change the configTICK\_RATE\_HZ to 1000 the upload only takes 25 seconds…

When I understood the configTICK\_RATE\_HZ value properly, this should not be. The value should only control the granularity of the time I can measure with freeRTOS and the frequency the tasks are evaluated for selection, but should not have any impact to the speed the application runs with.

I checked the obvious error: vTaskDelay(Until) is only used with pdMS\_TO\_TICKS macro.

I am using FreeRTOS 9 with the Microchip Harmony Framework on a PIC32MZ2048EFM144.

Can someone confirm that this behaviour is not right?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 20, 2018, 11:51am UTC](https://forums.freertos.org/t/configtick-rate-hz-scales-application-speed/7382/2 "2018-08-20T11:51:27Z")

</div>

**[richarddamon](https://sourceforge.net/u/richarddamon/)** wrote on [Monday, August 20, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/16cd278a/#d3c4):

A couple errors can cause this sort of issue. One is that if the port doesn’t actually change the tick rate when you change the define, then timeouts will be incorrect. One quick test is to implement the tick-hook and have it toggle a bit and see that the tick rate is right and changes.

A second type of error that can do this is if some ISR that you depend on doesn’t test the wasWoken flag and force a reschedule, in which case the task that should have been activated by the ISR waits till the next tick interrupt.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [August 20, 2018, 2:59pm UTC](https://forums.freertos.org/t/configtick-rate-hz-scales-application-speed/7382/3 "2018-08-20T14:59:32Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Monday, August 20, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/16cd278a/#d3c4/5302):

In addition to Richard D’s answer:

1. _ALL_ block times should use the pdMS\_TO\_TICKS() macro to ensure  
block times scale automatically to the correct value whenever. You only  
mention vTaskDelay(), but block times are used in a lot more places than  
that.

2. Ideally your entire application should be event driven - that is -  
never have an arbitrary delay when waiting for an external event  
[ideally] and instead have the event unblock a task.

Given the two above, changing configTICK\_RATE\_HZ should only change the  
granularity and accuracy of block times, and not change the execution  
speed of the application. Conclusion is, there is something in your  
code, or the harmony code, that is doing something contrary to the above.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 21, 2018, 7:22am UTC](https://forums.freertos.org/t/configtick-rate-hz-scales-application-speed/7382/4 "2018-08-21T07:22:14Z")

</div>

**[danielgraham2](https://sourceforge.net/u/danielgraham2/)** wrote on [Tuesday, August 21, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/16cd278a/#a8ec):

OK, thank you both for the clarification and the hints.  
I will investigate - something is not right.
