I have been trying to get a multi core project working for the MPC5748G. I was able to get it to run. Then I added the FreeRTOS to the Z4_0 core. That is when my trouble began. When using the debugger I am able to start Z4_0 and the Z2 core fine with no issue. When I start running the Z4_1 core it kills the Z4_0 core. Do you know what would cause this? I attached my project because I do not know what needs to be changed to prevent this from happening.
Z4_0 code
void OPT_Main(void *pvParameters)
{
for(;;)
{
//vTaskDelay(100);
delay(1800000);
PINS_DRV_TogglePins(PTJ, (1 << 4));
}
}
/*!
\brief The main function for the project.
\details The startup initialization sequence is the following:
* - startup asm routine
* - main()
*/
int main(void)
{
/* Write your local variable definition here */
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
#ifdef PEX_RTOS_INIT
PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of Processor Expert internal initialization. ***/
status_t ret = STATUS_ERROR;
// Initialize and configure clocks
ret = CLOCK_SYS_Init(g_clockManConfigsArr, (uint8_t)CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, (uint8_t)CLOCK_MANAGER_CALLBACK_CNT);
DEV_ASSERT(STATUS_SUCCESS == ret);
ret = CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);
DEV_ASSERT(STATUS_SUCCESS == ret);
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);
(void)ret;
// Starts main task. This task is responsible for starting the core Buoy tasks and other tasks based on the type of
// buoy the unit is set to.
xTaskCreate(OPT_Main,
(const char *const)MAINTASK_TASK_NAME,
configMINIMAL_STACK_SIZE,
NULL,
MAINTASK_TASK_PRIORITY,
NULL);
// Start the scheduler.
vTaskStartScheduler();
/* Write your code here */
/* For example: for(;;) { } */
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
#ifdef PEX_RTOS_START
PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of RTOS startup code. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;) {
if(exit_code != 0) {
break;
}
}
return exit_code;
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
Z4_1 code
int main(void)
{
/* Write your local variable definition here */
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
#ifdef PEX_RTOS_INIT
PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of Processor Expert internal initialization. ***/
AXBS_0->PORT[3].CRS = AXBS_CRS_ARB(1) | AXBS_0->PORT[3].CRS;
//.B.ARB = 1;
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);
/* Write your code here */
/* For example: for(;;) { } */
for(;;)
{
delay(1800000);
PINS_DRV_TogglePins(PTA, (1 << 0));
}
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
#ifdef PEX_RTOS_START
PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of RTOS startup code. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;) {
if(exit_code != 0) {
break;
}
}
return exit_code;
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
Z2_2 code
int main(void)
{
/* Write your local variable definition here */
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
#ifdef PEX_RTOS_INIT
PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of Processor Expert internal initialization. ***/
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);
/* Write your code here */
/* For example: for(;;) { } */
for(;;)
{
delay(1800000);
PINS_DRV_TogglePins(PTA, (1 << 4));
}
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
#ifdef PEX_RTOS_START
PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of RTOS startup code. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;) {
if(exit_code != 0) {
break;
}
}
return exit_code;
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
Solved! Go to Solution.
Latest version of S32DS for Power architecture is 2.1:
Direct link for download is:
https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=S32DS-PA
Latest update is Update 14:
Regards,
Lukas
I found out what is going on. Somehow my IDE got messed you. I found a computer that has S32DS IDE installed and created a multicore project with the FreeRTOS on each core and it worked. Since I need to reinstall the IDE which version of S32 Design Studio for Power Architecture should I install for the MPC5748G_176 and where do I need to go to find it.
Latest version of S32DS for Power architecture is 2.1:
Direct link for download is:
https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=S32DS-PA
Latest update is Update 14:
Regards,
Lukas
When I run the code, it crashes.
I tried to make a new multicore project and it doesn't work. All i did to cause it to break is add the FreeRTOS to each core. I re-generate processor expert code for each core so you should not have to do that. If you are able to get it running, can you upload the project so i can try it on my system?
Ok, now I built the projects only and it works. I can reach vTaskDelay on all cores periodically. I didn't do anything else.
Did you do anything when you re-generate processor expert code because mine know crashes when i have z2_2 code run.
Well, what I can see on my side: as a first step, I imported the project, I built it without modification and loaded to MCU. The result - core Z4_0 ended up in default ISR handler.
In second step, I tried to re-generate processor expert code. In this case, everything seems to be working and all the cores toggle GPIO in endless loop.
So, from my point of view, files generated by PE just were not up to date.
Regards,
Lukas
Hi @MattJCole
before I saw your code, I immediately remembered this similar problem:
But after checking your code, I can see that FreeRTOS is not running on other cores. What about the delay function? How does it look like?
Is it possible to share whole project, so I can do quick debugging on my side?
Regards,
Lukas