EmbeddedRelated.com
Forums

how to avoid erasing eeprom with Codewarrior 3

Started by ra October 14, 2003
Hello

Has anyone figured out how to avoid having Codewarrior 3 erase the eeprom every time one flashes the code with the ICD-12 target module?

With version 2, one could achieve this by editing "P&E_ICD_erase_unsecure_hcs12.cmd", but with version 3 there is a new mechanism controlled by fpp files which dont seem to be documented anywhere ...

Many thanks!
Robert



In the preload.cmd file, you can stop the EEPROM erase by changing the FLASH
ERASE command. If you give a parameter to the command, it controls what
gets erased. No parameter erases everything, evidently. Here is a snippet
from my preload.cmd file, explaining to me what I did. You can tell what
memory the ERASE parameters map to by using the debugger "component | open |
command" sequence to get a command prompt, which allows you to type the
command "flash", which returns the block mapping, as shown in my snippet
below. Apparently, the parameter tells which block to erase, and the 0
parameter for my CPU (912B32) means to erase the flash but leaves the EEPROM
alone.

Bob Harris originally posted this technique on this list (thanks, Bob). He
learned it from Metrowerks support Europe.
NOTE. I am using CW 1.2. No telling if it still works in 3.0.

Good luck,
Bob White from my preload.cmd file:

// // erase the flash modules
// FLASH ERASE // I commented out this stock line
FLASH ERASE 0 // and now use parameter to control erase // in debugger: component | open | command gives "in>" prompt below
// then I typed "flash" and got info below

// in>flash

// MCU clock speed: 3994000 Hz
// Block Module Name Address Range Status
// 0 FLASH_B32 8000 - FFFF Enabled/Programmed/Protected -
unselected
// 1 EEPROM D00 - FFF Enabled/Blank/Protected -
Unselected ----- Original Message -----
From: "ra" <>
To: <>
Sent: Tuesday, October 14, 2003 7:11 PM
Subject: [68HC12] how to avoid erasing eeprom with Codewarrior 3 Hello

Has anyone figured out how to avoid having Codewarrior 3 erase the eeprom
every time one flashes the code with the ICD-12 target module?

With version 2, one could achieve this by editing
"P&E_ICD_erase_unsecure_hcs12.cmd", but with version 3 there is a new
mechanism controlled by fpp files which dont seem to be documented anywhere
...

Many thanks!
Robert

--------------------
">http://docs.yahoo.com/info/terms/



Hi Robert.

release note extract:

" The ICD12 Target Interface provides now a direct application loading and
flashing feature within the application Load menu. It is no more required
to play flash handling commands from preload and postload command files:
The "Load Code to onchip Non Volatile Memory" option plays in background
required flash commands. When this option is selected, it is possible to
choose an "All Bytes" verification option which will compare (after
programming) the original code with the device programmed code (read back).
Note that this option performs a device "mass erase". For partial code
loading, eeprom data loading, the Flash/NVMC dialog and regular flash
commands are still 100% available to specify special/selective Non Volatile
Memory operations to perform. "
As wrote Bob White, you can still use classic flash commands.
You can still disable the "Load Code to onchip Non Volatile Memory" option
and use previous commands and commands files. More hints:

- There is a manual called "Manual_Flash_Programming.pdf" which should be
installed in "CodeWarrior Manuals" folder (when installing with a
CodeWarrior CD-ROM). Inside this manual is described FPP files format and
structure (flash programming drivers). It won't be a secret if I inform you
that you can backup the fpp file matching your derivative and edit this
text file to remove the EEPROM section (the eeprom is then unknown from the
debugger). Attention: the first "MODULE" listed in the file must always
have a section "INFO 6". If you remove the first module, the next one might
have a "INFO 0" section, change it to "INFO 6". This is required for bus
speed sensing (details in the manual). Also note that modifying fpp files
is without guaranty at all, i.e. at your own risk. Regards,
Gilles At 04:11 AM 10/15/2003, you wrote:
>Hello
>
>Has anyone figured out how to avoid having Codewarrior 3 erase the eeprom
>every time one flashes the code with the ICD-12 target module?
>
>With version 2, one could achieve this by editing
>"P&E_ICD_erase_unsecure_hcs12.cmd", but with version 3 there is a new
>mechanism controlled by fpp files which dont seem to be documented
>anywhere ...
>
>Many thanks!
>Robert >
>
>-------------------- >
>">http://docs.yahoo.com/info/terms/