RTD: SW32K3_RTD_R21-11_3.0.0_P07_D2306
MCU: #S32K396
Question:TimeStamp of CAN didn't change when use STM0 as external timer.
when I use default config, Timer register of CAN will increase, and timestamp of mailbox would change after Can transmition.
when I enable global time in CAN config, use STM0 for external timer reference, Timer register of CAN is always 0, timestamp of mailbox is always 0. HR_TIME_STAMP did not change. Can_43_FLEXCAN_TimestampTimerOverflowCallback can be called, Can_Ipw_u32CurrentCompareVal can change. Count of STM0 can change.
What's wrong, why timerstamp didn't change? Count of STM0 can change, Can transimition is OK(CanIf_TxConfirmation can be called).
code in main function:
Gpt_Init(NULL_PTR);
Gpt_StartTimer(GptConf_GptChannelConfiguration_GptChannelConfiguration_0, 400000U); // PIT
Gpt_StartTimer(GptConf_GptChannelConfiguration_GptChannelConfiguration_1, 4000000U); // STM
Gpt_StartTimer(GptConf_GptChannelConfiguration_GptChannelConfiguration_0, 400000U); // PIT
Gpt_EnableNotification(GptConf_GptChannelConfiguration_GptChannelConfiguration_1); // STM
Can_43_FLEXCAN_Init(&Can_43_FLEXCAN_Config);
Can_43_FLEXCAN_SetControllerMode(CanController_Veh, CAN_CS_STARTED);
Platform_SetIrq(FlexCAN3_0_IRQn, TRUE);
Platform_SetIrq(FlexCAN3_1_IRQn, TRUE);
Platform_SetIrq(STM0_IRQn, TRUE);
for(;;)
{
if(IP_PIT_0->TIMER[0].TFLG == 1)
{
IP_PIT_0->TIMER[0].TFLG = 1;
CanTx_10ms();
}
}