Dear group,
I am trying to use the internal EEPROM of a S12XDP512 chip and my driver is working perfectly in BDM mode. However, as soon as I restart the board in normal mode, the EEPROM write is not performed any more. I have check PVIOL and ACCERR flags, they are not set.
I have a 16 Mhz oscillator and the PLL is configured at 40 Mhz. My setup code is as follows:
#define EEP_PRDCLK (0x01u)
#define EEP_ECLKDIV (0x0Au)
vtEepromReg.ECLKDIV = (EEP_PRDCLK<<6u) + EEP_ECLKDIV;
/* Pas de protection */
vtEepromReg.EPROT=0xFF;
/* attend que l'e2prom soit prete */
while(TEST_BIT(vtEepromReg.ESTAT, ESTAT_CCIF)==0) {
;
}
EEP_DEVPT_ERROR_CHECK(TEST_BIT(vtEepromReg.ECLKDIV, ECLKDIV_EDIVLD)!=0, EEP_E_HW_UNINIT, tRet)
Did you already encounter a similar situation? Thank you in advance for your replies.
Best regards,
Puce_log