Hi All,
I already posted one message in Automotive forum but I did not found how to transfer it from there... I guess this would be better to handle it from here.
I am using the Companion Chip TPS65381 with a RM46L852 device.
RM46 flash memory contains two software: a boot program launched when the MCU starts-up and an applicative.
The boot program performs some initialization for both the MCU and the Companion Chip, then performs some applicative consistency checks and finally configure the TPS to leave diagnostic state (by setting to 1 DIAG_EXIT bit and to 0 DIAG_EXIT_MASK of CHECK_CTRL TPS register).
My issue comes when I try to leave the DIAGNOSTIC mode. First I set to 1 DIAG_EXIT_MASK bit in safety control register and then I reset to 0 the value of DIAG_EXIT bit of same register.
I used the function called ConfigureSafetyCheckControl from the SAFE TI library; my code is as follow
blRetVal = TPS_ConfigureSafetyCheckControl(DIAG_EXIT_MASK, FALSE);
blRetVal = ((TPS_ConfigureSafetyCheckControl(DIAG_EXIT, TRUE) && blRetVal);
I compared this code with the one provided in SAFE TI library about exiting the diagnotic mode; SAFE TI library is as follow:
blRetVal = TPS_ConfigureSafetyCheckControl(DIAG_EXIT_MASK, FALSE);
blRetVal = ((TpsIf_SetRegisterBitField(TPS_SAFETY_CHECK_CTRL, BF_DIAG_EXIT_START, BF_DIAG_EXIT_LENGTH, (uint8)1U)) && blRetVal);
I ported the SAFE TI code into my software and this works as it should.
But what is the difference? Why does the SAFE TI lib not use two times the ConfigureSafetyCheckControl function?
Hope you can help.
Thanks by advance !!
PS: I paid attention to set to true DIAG_EXIT_MASK less than 600ms after the power up to ensure that the TPS is in DIAGNOSTIC mode.
I also paid attention to clear error counters and flags prior to try reaching the ACTIVE mode.