MPC5748G program crashes when mounting SD card in Multicore project.

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

MPC5748G program crashes when mounting SD card in Multicore project.

2,213 Views
MattJCole
Contributor V

I have a project that runs on the MPC5748G processor but only uses one of the three cores. I am trying to get it to run using all of the cores. The problem I have is that the code crashes when it tries to mount the SD card when running from the debugger and I think it crashes when trying to initialize the debug console when running from flash. Do you know what would cause the Z4_0 core to crash?

Z4_0

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

 

   // *isCfgLoaded = CFG_NOT_LOADED;

 

  /* Write your code here */

    CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);

    CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);

 

 

    /* Initialize pins */

    PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);

 

    // Initialize channel 0

    //PIT_DRV_InitChannel(INST_PIT1, &pit1_ChnConfig0);

 

    // Start channel 0 counting

    //PIT_DRV_StartChannel(INST_PIT1, pit1_ChnConfig0.hwChannel);

 

#if (SDK_DEBUGCONSOLE)

  /* Initialize debug console for output display on terminal */

  DbgConsole_Init(DEBUG_CONSOLE_SPEED, DEBUG_CONSOLE_DEVICE_TYPE_UART);

#endif /* (SDK_DEBUGCONSOLE) */

 

  // Initialize FATFS for uSDHC

  uSDHC_fatfs_initialize();

 

 

  // 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,

              MAINTASK_TASK_STACK_SIZE,

              NULL,

              MAINTASK_TASK_PRIORITY,

              NULL);

 

  xTaskCreate( vLEDTask, ( const char * const ) "LedTask", configMINIMAL_STACK_SIZE, (void*)0, mainLED_TASK_PRIORITY, NULL );

 

  // Start the scheduler.

  vTaskStartScheduler();

 

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

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

 

  /* Write your code here */

    CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);

     CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);

 

     /* Initialize pins */

     PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);

 

     xTaskCreate( vLEDTask, ( const char * const ) "LedTask", configMINIMAL_STACK_SIZE, (void*)1, mainLED_TASK_PRIORITY+1, NULL );

 

 

     // Start the scheduler.

     vTaskStartScheduler();

 

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

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

 

 

 

  /* Write your code here */

    CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);

    CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);

 

    /* Initialize pins */

    PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);

 

    xTaskCreate( vLEDTask, ( const char * const ) "LedTask", configMINIMAL_STACK_SIZE, (void*)2, mainLED_TASK_PRIORITY+2, NULL );

 

    // Start the scheduler.

    vTaskStartScheduler();

 

  /*** 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
Reply
6 Replies

2,118 Views
MattJCole
Contributor V

Have you found out why the code crashes when mounting the SD card?

0 Kudos
Reply

2,145 Views
MattJCole
Contributor V

I do not know what is causing the IVOR1 exception. what do I need to do with the MCSR, MCAR and MCSRR0 registers?  Will they tell me why the program is crashing?

0 Kudos
Reply

2,100 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Sure, you will find at least first indication to know what happened.

davidtosenovjan_0-1680161169437.png

 

0 Kudos
Reply

2,174 Views
MattJCole
Contributor V

I am not sure what you mean by “standalone without debugger”. I have run it without using the debugger by power cycling the board and the Z4_0 core crashes I just do not know where because I do not have the debugger connected. What I do to recreate the problem is first start running the debugger using the Launch group. I start the Z4_0 core first, next the Z4_1 core, and last the Z2_2 core. When I check on the status of the Z4_0 core it is in IVOR1_Exception_Handler. The cores Z4_1 core, and Z2_2 still run after the Z4_0 crashes.

0 Kudos
Reply

2,151 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

It is needed to investigate the reason of IVOR1 exception. Pay attention to MCSR, MCAR and MCSRR0 coire registers to investigate IVOR1 reason, address and address of instruction that caused the exception. 

0 Kudos
Reply

2,187 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Have you tried it standalone without debug? Could you describe "crash" of the core more in detail? Does it fail into exception?

0 Kudos
Reply