Hi ZHOUXIANG, sorry for this inconvenience of code generation. You pointed out a bug into the "pwmc_sixstep.c" file regarding this Timer number management. The functions should be the following:
Into the MCSDK 6.3.2
/**
* @brief It updates the stored duty cycle variable.
* @PAram pHandle Pointer on the target component instance.
* @PAram new duty cycle value.
* @retval none
*/
__weak void PWMC_SetPhaseVoltage( PWMC_Handle_t * pHandle, uint16_t DutyCycle )
{
pHandle->CntPh = DutyCycle;
LL_TIM_WriteReg(pHandle->pParams_str->TIMx, CCR1, (uint32_t) DutyCycle);
LL_TIM_WriteReg(pHandle->pParams_str->TIMx, CCR2, (uint32_t) DutyCycle);
LL_TIM_WriteReg(pHandle->pParams_str->TIMx, CCR3, (uint32_t) DutyCycle);
}
/**
* @brief This function disable the update of the demagnetization counter in the update event
* @PAram pHandle: handler of the current instance of the PWM component
* @retval none
*/
__weak void PWMC_DisableHighFreqTask( PWMC_Handle_t * pHandle )
{
LL_TIM_DisableIT_UPDATE(pHandle->pParams_str->TIMx);
}
into MCSDK 6.4.0:
/**
* @brief It updates the stored duty cycle variable.
* @PAram pHandle Pointer on the target component instance.
* @PAram new duty cycle value.
* @retval none
*/
__weak void PWMC_SetPhaseVoltage(PWMC_Handle_t *pHandle, uint16_t DutyCycle)
{
#ifdef NULL_PTR_CHECK_PWM_SIXSTEP
if (MC_NULL == pHandle)
{
/* Nothing to do. */
}
else
{
#endif
pHandle->CntPh = DutyCycle;
LL_TIM_WriteReg(pHandle->pParams_str->TIMx, CCR1, (uint32_t)DutyCycle);
LL_TIM_WriteReg(pHandle->pParams_str->TIMx, CCR2, (uint32_t)DutyCycle);
LL_TIM_WriteReg(pHandle->pParams_str->TIMx, CCR3, (uint32_t)DutyCycle);
#ifdef NULL_PTR_CHECK_PWM_SIXSTEP
}
#endif
}
Best Regards.
Fabrice