EEPROM is erased while reprogramming.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

EEPROM is erased while reprogramming.

6,561 次查看
benstickrod
Contributor I
Is there anyway to preserve EEPROM while reprograming with the BDM?  I have tried commenting out the mass erase EEPROM commands in the CMD file, but EEPROM still seems to get erased.  Any ideas?
 
Thanks,
Ben
标签 (1)
0 项奖励
回复
5 回复数

786 次查看
CrasyCat
Specialist III

Hello

I assume you are using a Multilink or Cyclone Pro cable for debugging.
If you are using CodeWarrior for HC12 V4.5

Am I right?

If this is the case you can use the command AEFSKIPERASING to prevent EEPROM to be erased when you download your application to FLASH.

Extract from Notes_debugger_icd12.txt:
"The new command AEFSKIPERASING has been created to specify non volatile memory blocks to protect from mass erasing at application loading.
 The command should be placed in a "Startup" command file.
 The command syntax is:
 FLASH AEFSKIPERASING <blockNo>
 with blockNo = {number["-"number][","]}
 
 For example, "FLASH AEFSKIPERASING 0,2-4" avoids erasing flash blocks 0,2,3,4.
 
 Reminder: Flash (and non volatile memory) modules and numbers can be displayed when typing the FLASH command in the Command window. Also the Flash/Non Volatile Memory dialog list displays all modules starting from block number 0."

If you are using an earlier version of the tools, check the release notes for ICD12 to make sure the command is supported there.

The release notes can be found in {Install}\Release_Notes\HC12\CW_Tools\HC12\Notes_debugger_icd12.txt.

I hope this helps.

CrasyCat

0 项奖励
回复

786 次查看
falken
Contributor I
Hi, did anyone get this to work?

I know I don't.

After setting "FLASH AEFSKIPERASING 3,5" I get :

FP: The ERASE command is not performed for the EEPROM_C00 flash module (AEFSKIPERASING) => Skipped.
FP: The ERASE command is not performed for the EEPROM_800 flash module (AEFSKIPERASING) => Skipped.

Look OK, But the blocks are erased anyway.

Data written stays for a reset but not a reload.

Any ideas?



My Command line output: ( Using EEPROM_800 )




!// Before programming the flash, the commands written below will be executed
!flash

MCU clock speed: 1994000 Hz
Block Module Name Address Range Status
0 FLASH_4000 4000 - 7FFF Blank - Selected
1 FLASH_C000 C000 - FFFF Programmed - Selected
2 ALL_PPAGES E08000 -FFBFFF Programmed - Selected
3 EEPROM_C00 C00 - FFF Blank - Selected
4 ALL_EPAGES FC0800 -FF0BFF Programmed - Selected
5 EEPROM_800 800 - BFF Programmed - Selected
6 FLASH_8000 8000 - BFFF Programmed - Selected
done .\cmd\P&E_Multilink_CyclonePro_vppon.cmd

Vppon command file correctly executed.

FP: The ERASE command is not performed for the EEPROM_C00 flash module (AEFSKIPERASING) => Skipped.

FP: The ERASE command is not performed for the EEPROM_800 flash module (AEFSKIPERASING) => Skipped.
executing .\cmd\P&E_Multilink_CyclonePro_vppoff.cmd

!// After programming the flash, the commands written below will be executed
!flash

MCU clock speed: 1994000 Hz
Block Module Name Address Range Status
0 FLASH_4000 4000 - 7FFF Blank - Selected
1 FLASH_C000 C000 - FFFF Blank - Selected
2 ALL_PPAGES E08000 -FFBFFF Blank - Selected
3 EEPROM_C00 C00 - FFF Blank - Selected
4 ALL_EPAGES FC0800 -FF0BFF Blank - Selected
5 EEPROM_800 800 - BFF Blank - Selected
6 FLASH_8000 8000 - BFFF Blank - Selected
done .\cmd\P&E_Multilink_CyclonePro_vppoff.cmd
0 项奖励
回复

786 次查看
falken
Contributor I
My fault! Forgot to skip erasing module "4 ALL_EPAGES FC0800 -FF0BFF"

Setting "FLASH AEFSKIPERASING 3,4,5" makes life a bit easier.
0 项奖励
回复

786 次查看
benstickrod
Contributor I
My FPP file says that EEPROM is mapped to 2000 - 2FFF, In code, the EEPROM is mapped to 800 - FFF.  Could this be the problem?  I am using a MC9S12DG128B.  Is there a way to change the FPP file?
 
Thanks,
Ben
0 项奖励
回复

786 次查看
rhinoceroshead
Contributor I
What happens if you comment out the EEPROM segment in the .prm file?  Since you can use that file to force code segments into specific memory locations, it seems reasonable that if a segment is defined there but not used, the loader should assume that you want it to be blank.
0 项奖励
回复