How to tell Code Warrior debugger NOT to erase EEPROM

Started by apedroso11 May 17, 2006
Hi all,

I want the CodeWarrior debugger to NOT erase the EEPROM everytime I
download user code to my DP256 or everytime I want to use the BDM.

I have tried to comment this debugger commands:

//mass erase eeprom
//wb 0x110 CLKDIV // set ECLKDV clock divider
//wb 0x114 0xFF // EPROT all protection disabled
//wb 0x115 0x30 // clear PVIOL and ACCERR in ESTAT register
//ww 0x118 0x0400 // write to EADDR eeprom address register
//ww 0x11A 0x0000 // write to EDATA eeprom data register
//wb 0x116 0x41 // write MASS ERASE command in ECMD register
//wb 0x115 0x80 // clear CBEIF in ESTAT register to execute the
command
//wait 20 // wait for command to complete

but it still erase the EEPROM when I download and debug my code.

I think it is using another script I can't see

any ideas???

Thanks in advance

--- In 6..., "apedroso11" wrote:
>
> Hi all,
>
> I want the CodeWarrior debugger to NOT erase the EEPROM everytime I
> download user code to my DP256 or everytime I want to use the BDM.
>
> I have tried to comment this debugger commands:
>
> //mass erase eeprom
> //wb 0x110 CLKDIV // set ECLKDV clock divider
> //wb 0x114 0xFF // EPROT all protection disabled
> //wb 0x115 0x30 // clear PVIOL and ACCERR in ESTAT register
> //ww 0x118 0x0400 // write to EADDR eeprom address register
> //ww 0x11A 0x0000 // write to EDATA eeprom data register
> //wb 0x116 0x41 // write MASS ERASE command in ECMD register
> //wb 0x115 0x80 // clear CBEIF in ESTAT register to execute the
> command
> //wait 20 // wait for command to complete
>
> but it still erase the EEPROM when I download and debug my code.
>
> I think it is using another script I can't see
>
> any ideas???
>
> Thanks in advance
>
The only way I know of is to modify preload.cmd:

reset
FLASH
FLASH SELECT
FLASH UNPROTECT
FLASH ERASE 1-16
FLASH ARM
If you just write FLASH ERASE, it will erase the whole flash + the
eeprom. The trick is "1-16", those are the flash pages. The EEPROM is
0 and will be kept.

The problem is that if you are using .cmd files you can't use the
option "load code to onchip NVM (mass erase and flash)" in the
Codewarrior debugger. Select "load code + symbols" instead and it
should work.

to NOT erase the EEPROM add to Startup.cmd

FLASH AEFSKIPERASING 0

Regards

Johann

----- Original Message -----
From: apedroso11
To: 6...
Sent: Wednesday, May 17, 2006 12:25 PM
Subject: [68HC12] How to tell Code Warrior debugger NOT to erase EEPROM
Hi all,

I want the CodeWarrior debugger to NOT erase the EEPROM everytime I
download user code to my DP256 or everytime I want to use the BDM.

I have tried to comment this debugger commands:

//mass erase eeprom
//wb 0x110 CLKDIV // set ECLKDV clock divider
//wb 0x114 0xFF // EPROT all protection disabled
//wb 0x115 0x30 // clear PVIOL and ACCERR in ESTAT register
//ww 0x118 0x0400 // write to EADDR eeprom address register
//ww 0x11A 0x0000 // write to EDATA eeprom data register
//wb 0x116 0x41 // write MASS ERASE command in ECMD register
//wb 0x115 0x80 // clear CBEIF in ESTAT register to execute the
command
//wait 20 // wait for command to complete

but it still erase the EEPROM when I download and debug my code.

I think it is using another script I can't see

any ideas???

Thanks in advance

------