AnsweredAssumed Answered

STM not work in multi-core application

Question asked by Gong jun on Apr 24, 2019
Latest reply on May 7, 2019 by Gong jun

STM1 work in coreZ40,STM2 work in coreZ41. in multi-core debug, only Z40work,STM1 works well,but when coreZ41 work,STM2 works well,but stm1 stop.

void Timer1_init(void)
{
STM_DRV_Deinit(INST_STM1);
STM_DRV_Init(INST_STM1, &stm1_InitConfig0);
/* Compute the number of ticks from microseconds */
STM_DRV_ComputeTicksByUs(INST_STM1,10000U, &ticks1);//10ms
STM_DRV_InitChannel(INST_STM1, &stm1_ChnConfig0);
/* Enable Interrupt for STM0 channel 0 */
stm1_ChnConfig0.compareValue = ticks1;
INT_SYS_EnableIRQ(STM1_Ch0_IRQn);
/* Start running the common timer counter */
STM_DRV_StartTimer(INST_STM1);
}

 

void Timer2_init(void)
{
//INT_SYS_DisableIRQGlobal();
//INT_SYS_DisableIRQ_MC_All(STM2_Ch0_IRQn);
STM_DRV_Deinit(INST_STM2);
STM_DRV_Init(INST_STM2, &stm2_InitConfig0);
/* Compute the number of ticks from microseconds */
STM_DRV_ComputeTicksByUs(INST_STM2,10000U, &ticks1);//10ms
STM_DRV_InitChannel(INST_STM2, &stm2_ChnConfig0);
// /* Enable Interrupt for STM0 channel 0 */
stm2_ChnConfig0.compareValue = ticks1;
// //INT_SYS_EnableIRQGlobal();
INT_SYS_EnableIRQ(STM2_Ch0_IRQn);
// /* Start running the common timer counter */
STM_DRV_StartTimer(INST_STM2);
}

void STM1_Ch0_IRQHandler(void)
{
// STM_DRV_StopTimer(0);
/* Clear channel interrupt flag */
STM_DRV_ClearStatusFlags(INST_STM1, stm1_ChnConfig0.channel);
STM_DRV_IncrementTicks(INST_STM1, stm1_ChnConfig0.channel, ticks1);

...............

Attachments

Outcomes