Changing configCPU_CLOCK_HZ changes delay lengths
I am working with the EFM32 GG starter kit. I’m testing the blink LED demo that comes with Simplicity Studio. In FreeRTOSConfig.h there is this line:
~~~
Changing configCPU_CLOCK_HZ changes delay lengths
Is this using Systick to generate the tick interrupt? Or is it using a
low power clock along with some low power modes?
Changing configCPU_CLOCK_HZ changes delay lengths
This is the function that sets up the tick interrupt.
~~~
attribute(( weak )) void vPortSetupTimerInterrupt( void )
{
/* Calculate the constants required to configure the tick interrupt. /
#if configUSE_TICKLESS_IDLE == 1
{
ulTimerCountsForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ );
xMaximumPossibleSuppressedTicks = portMAX_24_BIT_NUMBER / ulTimerCountsForOneTick;
ulStoppedTimerCompensation = portMISSED_COUNTS_FACTOR / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ );
}
#endif / configUSETICKLESSIDLE */
/* Configure SysTick to interrupt at the requested rate. */
portNVIC_SYSTICK_LOAD_REG = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;
portNVIC_SYSTICK_CTRL_REG = ( portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT );
}
~~~
configSYSTICKCLOCKHZ = 14000000, configTICKRATEHZ = 1000
ulTimerCountsForOneTick = 14000
Changing configCPU_CLOCK_HZ changes delay lengths
As you say:
ulTimerCountsForOneTick = 14000is it right that configUSETICKLESSIDLE is set to 1? If so, could you try setting it to 0 and see if you observe the same behaviour, or if that fixes the issue. That will narrow down where we need to look.
Changing configCPU_CLOCK_HZ changes delay lengths
The debugger runs into that code, so configUSETICKLESSIDLE is sure set to 1. I already tried setting it to 0, but I did it again just now to double check. The behavior is the same.
Changing configCPU_CLOCK_HZ changes delay lengths
Someone pointed out that changing this value does not actually change my clock. Sorry for the misunderstanding. Thread closed.