IMXRT1170-EVK CM4 / CM7 dual core FreeRTOS question

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMXRT1170-EVK CM4 / CM7 dual core FreeRTOS question

Jump to solution
957 Views
henrynguyen
Contributor IV

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.

henrynguyen_0-1673314655957.png

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:

henrynguyen_1-1673314727571.png

CM7 portion of FreeRTOS config:

henrynguyen_2-1673314763655.png

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.

henrynguyen_3-1673314825852.png

CM7 print message and toggling:

henrynguyen_4-1673314910291.png

CM4 print message and toggling:

henrynguyen_5-1673314951260.png

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.

henrynguyen_6-1673315209745.png

henrynguyen_7-1673315249390.png

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

 

0 Kudos
Reply
1 Solution
953 Views
henrynguyen
Contributor IV

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

View solution in original post

0 Kudos
Reply
1 Reply
954 Views
henrynguyen
Contributor IV

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

0 Kudos
Reply