Core Z4_0 stops running when I start Z4_1

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

Core Z4_0 stops running when I start Z4_1

Jump to solution
1,102 Views
MattJCole
Contributor V

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!!! ***/

 

0 Kudos
1 Solution
9 Replies
990 Views
MattJCole
Contributor V

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.

0 Kudos
1,002 Views
MattJCole
Contributor V

When I run the code, it crashes.

 

MattJCole_0-1678799560283.png

 

0 Kudos
1,029 Views
MattJCole
Contributor V

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?

0 Kudos
1,011 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Ok, now I built the projects only and it works. I can reach vTaskDelay on all cores periodically. I didn't do anything else.

lukaszadrapa_0-1678778065247.png

 

lukaszadrapa_1-1678778071940.png

 

lukaszadrapa_2-1678778077631.png

 

 

 

0 Kudos
1,034 Views
MattJCole
Contributor V

Did you do anything when you re-generate processor expert code because mine know crashes when i have z2_2 code run.

0 Kudos
1,050 Views
MattJCole
Contributor V

I thought I put the project. I just noticed the project was not added.

0 Kudos
1,039 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

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

0 Kudos
1,058 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @MattJCole 

before I saw your code, I immediately remembered this similar problem:

https://community.nxp.com/t5/MPC5xxx/MPC5748G-dual-core-projects-only-work-when-using-the-first-and/...

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

0 Kudos