hello,
i am using IMXRT1170-EVK eval kit and able to get the CM7 (primary) and CM4 (secondary) simple application to work on FreeRTOS.
on my simple test applications, each CM7 or CM4 has independent task running to toggle the GPIO with 1000 ms delay and output the message to the separate UART.
CM7 outputs message by UART1 and CM4 outputs the message to UART12.
snap shot below shows my clock configuration for CM7 and CM4.
my freeRTOS configuration is the same on CM7 and CM4 which set the corresponding system tick to 5 ms period.
CM4 portion of freeRTOS config:
CM7 portion of FreeRTOS config:
here is the scope output of GPIO toggling in CM7 task and CM4 task.
you can see that the CM7 had 1 second toggling which is right, while the CM4 toggling rate is about 2.6 times slower for 1 sec toggling.
CM7 print message and toggling:
CM4 print message and toggling:
I checked and seems like the corresponding CM7 and CM4 get the SystemCoreClock properly.
can someone please help me understand why the toggling rate of Cm4 is about 2.6 times slower than CM7 for the same vTaskDelay?
there seems to be something wrong in the configuration.
my understanding is that each CPU core (M7 or M4) has its own sys clock tick.
so my setting should produce the right result unless the SystemCoreClock is wrong.
at this point, I am running out of idea. can you please help?
please let me know and i can zip CM7 and CM4 projects and post it here if needed.
Thanks,
Henry
Solved! Go to Solution.
hello,
I had a thought after posting the message. i think I need to call BOARD_InitBootClocks(); again in CM4 main (void) otherwise, the SystemCoreClock is not derived correctly. The default CM4 main does not call this.
anyway, i called that function, and now, the GPIO toggling rate is correct now.
i post the answer here just in case someone runs into the same problem as i did.
Best Regards,
Henry
hello,
I had a thought after posting the message. i think I need to call BOARD_InitBootClocks(); again in CM4 main (void) otherwise, the SystemCoreClock is not derived correctly. The default CM4 main does not call this.
anyway, i called that function, and now, the GPIO toggling rate is correct now.
i post the answer here just in case someone runs into the same problem as i did.
Best Regards,
Henry