AnsweredAssumed Answered

I am using MFR4310 recently,when i set POCR.POCCMD to 0x0100,PSR0.PROTSTATE is always 0x001(poc.config),but it should be 0x011(poc.ready).

Question asked by 一超 吴 on Apr 18, 2018

 I am using MFR4310 recently,when i set POCR.POCCMD to 0x0100,PSR0.PROTSTATE is always 0x001(poc.config),but it should be 0x011(poc.ready). 

The code is copyed  from <<FlexRay Unified Driver MFR4310>>,as following:

Fr_return_type Fr_leave_configuration_mode(void)
{
uint8 i; // Temporary counter

/* Force the FlexRay CC into FR_POCSTATE_READY */
i = 0; // Clear temporary counter
while((i < FR_MAX_WAIT_CYCLES) && (Fr_CC_reg_ptr[FrPOCR] & FrPOCR_BSY)) // Wait till Protocol Command Write is not busy
{
i++; // Increment temporary counter
}
if(i == FR_MAX_WAIT_CYCLES) return FR_NOT_SUCCESS; // Return FR_NOT_SUCCESS in case any error

Fr_CC_reg_ptr[FrPOCR] = (FrPOCR_POCCMD_CONFIG_COMPLETE | FrPOCR_WME); // Transition to FR_POCSTATE_READY

i = 0; // Clear temporary counter
while((i < FR_MAX_WAIT_CYCLES) && (Fr_CC_reg_ptr[FrPOCR] & FrPOCR_BSY)) // Wait till Protocol Command Write is not busy
{
i++; // Increment temporary counter
}
if(i == FR_MAX_WAIT_CYCLES) return FR_NOT_SUCCESS; // Return FR_NOT_SUCCESS in case any error

// Wait till FlexRay CC is not in FR_POCSTATE_READY
i = 0; // Clear temporary counter
while((i < FR_MAX_WAIT_CYCLES) && ( (Fr_CC_reg_ptr[FrPSR0] & 0x0700) != FrPSR0_PROTSTATE_READY))
{
i++; // Increment temporary counter               
}
if(i == FR_MAX_WAIT_CYCLES) return FR_NOT_SUCCESS; // Return FR_NOT_SUCCESS in case any error

(Error appears here,Fr_CC_reg_ptr[FrPSR0]  is always 0x0100,and Fr_CC_reg_ptr[FrPOCR] is 0x0004.I checked

the user manual ,when POCR.POCCMD is set to 0X0100, PSR0.PROTSTATE should be 0x011 immediately.)

 

 

return FR_SUCCESS; // API call has been successful
}

Is there anyone meets the same question like me?

Outcomes