I am using a 9s12dg128 controller and P&E ICD. The EEPROM erase and write routines work fine as long as the BDM is connected and debugger is running, but fails to do so otherwise.
I use a 16Mz oscillator. I have also tried initializing EEPROM related registers the way codewarriror erase command does. There are no protection or access errors. EEPROM is readable. Disabled COP. Disabled PLL. Tried different values of ECLKDIV within range. But nothing seems to work.I was not able to gather anything specific to this problem from the datasheets or errata either.
Any help would be appreciated.
Thanks in advance.