Dear NXP supportors:
I've encounterred an issue troubled me for a long time:
Development enviroment of the project is:S32DS_Power_v2017.R1, PE multilink universal
As mentioned in the datasheet below, i would like to modify "eMIOS CNT register" in freeze mode and have written a routine to realize that. It can modify the register with debugger successfully , but fail to modify the register when i removed debugger and restart board.
The related code and project are attatched below.
Could you give me some hints for the issue? Thank you in advance~
void EMIOS_ResetUCCnt(void)
{
eMIOS_MCR_SET_FRZ(INST_EMIOS0_MC,1);
REG_WRITE32(&eMIOS[0]->UC[PWM1_eMIOS_CHN].CNT,150);
REG_WRITE32(&eMIOS[0]->UC[PWM2_eMIOS_CHN].CNT,period_value/2+150);
eMIOS_MCR_SET_FRZ(INST_EMIOS0_MC,0);
}
I've made some further tests, found that the root cause was focused on the following 2 instructions. It appears that this 2 instructions are not excuted successfully without debugger.
REG_WRITE32(&eMIOS[0]->UC[PWM1_eMIOS_CHN].CNT,0);
REG_WRITE32(&eMIOS[0]->UC[PWM2_eMIOS_CHN].CNT,500);
As discussed in this thread: