This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

FREE-RTOS Clock available is less than System Clock

Other Parts Discussed in Thread: HALCOGEN, TMS570LC4357

Hello,

I am having a Tms5704357 hdk and i am trying to run FREE RTOS on to it. After doing the setting in Halcogen the maximum clock that I am able to assign to the RTI used by the FREERTOS is 75mhz even  when my controller GCLK speed is 300. As controller is having a clock of 300 then why i am  not able to utilize most of the clock into the FREERTOS. I tried to change the pll settings and divider setting and somehow was able to get the value for FREERTOS to 300 but the program simply didnt work.

  • Hello Eeshan,

    there a multiple clock domains on the device. Some examples are GCLK is the CPU clock which has a max clock rate of 300MHz. HCLK is the system clock with a max of 150MHz, VCLK is the peripheral clock which has a max of 110MHz. Please check the datasheet SPNS195A table 4-2 for a complete list of clocks and their max ratings. In regard to RTI, it is derived from VCLK so dependent on your dividers and settings for HCLK which is the source of VCLK, it might be the value you mentioned.

    In regard to the multiple clock domains, each serves a specific purpose and drives specific parts of the device and may have limitations in relation to their sources and dividers. This information is readily available in the device documentation.
  • Thanks for the reply,
    I have gone through the clock sources and found that the max clock that the FreeRTOS can utilize is 110mhz, As my max clock is 300 is there any way where i can increase the FreeRTOS clock from 110 to 300 mhz.
    Or can you please explain any method where the remaining frequency apart of FreeRTOS(110) can be utilized.
    Regards
    Eeshan
  • Hello Eeshan,

    If I understand your question correctly, the 110MHz is the maximum system tick counter in FreeRTOS on TMS570LC4357. This is due to the fact that the maximum RTI clock is 110MHz. Keep in mind that the system tick counter equates to the loop time for the RTOS and in each loop you will need to execute your tasks. With a system tick of 110MHz, this gives you a time of approximately 9ns to execute or initiate tasks. If each instruction were to execute in 1 cycle, this would mean that you would have time for the CPU to execute approximately 3 instructions (Provided GCLK = 300MHz) before the next tick counter would fire. This doesn't seem to be sufficient to do anything of value in each tick and even kicking off a task would take longer than 1 system tick counter.

    Please keep in mind how the clock structure works in the device. GCLK is used to clock the R5F Core (CPU) for instruction execution, HCLK is used for memory accesses and to drive additional clocks such as the peripheral clocks (VCLKx). The device uses waitstates, pipelining and the cache to make sure the CPU is always fed a stream of instructions and data.

    In your original post, your mentioned that the RTI was operating at 75MHz. This is due to the fact that the maximum for HCLK is 150MHz which is where the VCLK domain is derived from. Since VCLK maximum is 110MHz, HCLK has to be divided down through the use of a prescalar so VCLK = HCLK/2 or 75MHz.

    Finally, you ask how to utilize the " remaining frequency apart of FreeRTOS(110) can be utilized." If, you were to theoretically be able to drive RTI at 110MHz, this is the system tick counter as mentioned above. The 300MHz maximum speed IS realized since it is the speed at which the CPU is executing instructions which is a separate thing than the RTI based tick counter. Also as mentioned above, the tick counter is used to initiate tasks within the OS. In summary RTI/Tick counter = Task execution rate = 110MHz max; GCLK/CPU speed = instruction execution speed = 300MHz.
  • Thanks Mr Chuck Davenport,
    Thank you for being so elaborate and precise. I have understood the concept.
    One more thing:
    If i keep the Rate of Task execution speed at 75mhz=RTIclock, am i assured that the instruction execution is being done using the maximum clock of 300mhz.
    Regards
    Eeshan bashir
  • Hello Eeshan,

    The default setup for the GCM (General Clock Module) in Halcogen sets up GCLK = PLL1 output = 300MHz. If you stick with the defaults, the CPU speed will be 300MHz which means that instruction processing will be at 300MHz.