How to run code on multiple cores?

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

How to run code on multiple cores?

690 Views
stevenstarnes
Contributor III

Hello I am trying to figure out how to run specific sections of code on different cores. I have created a barebones project for the B4860 to get used to the CodeWarrior IDE. I selected my startup core to be Core 0 and when I run the code the printf() statement shows that is the correct core. Now I would like to run the same printf statement on a different core because I will need to do this with more complicated code later but the idea is the same. I know for Linux/Windows you can set affinity but since this is "barebones" I am not sure what I need to do? Do I need to create a process on a separate core in assembly? Any help is appreciated.

0 Kudos
1 Reply

530 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello stevenstarnes,

Please follow new project wizards in CodeWarrior IDE to create a SMP bareboard project.

Please refer to the function "initSmp" in the file smp_target.c in Sources folder of the CodeWarrior project, please define your specific code for each core according to the core ID got by the function getCoreId.

Please select multiple cores from Run->Debug Configurations-><project>_RAM_<processor>_Download, please specify CodeWarrior initialization file for each core from Run->Debug Configurations-><project>_RAM_<processor>_Download->Edit->Edit->Initialization->Initialize target script.


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos