Hello Experts,
I try to disable eeprom erase during downloading, so i configure in CW debugger window(File->Configuration->Load->click 'Advanced'->select 'EEPROM'). But the result is eeprom stil will be erased to 0 or 0xFF after downloading before the program is RUN.
ECU:PC9S12G128MLL
IDE: CW_HC12_v5.1_EVAL(download from freescale web)
Debugger firmware:P&E USB Multilink
prm setting:
SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */
/* Register space */
/* IO_SEG = PAGED 0x0000 TO 0x03FF; intentionally not defined */
/* RAM */
RAM = READ_WRITE 0x2000 TO 0x3FFF;
/* D-Flash */
DFLASH = READ_ONLY 0x000400 TO 0x0013FF;
·········
PLACEMENT /* here all predefined and user segments are placed into the SEGMENTS defined above. */
·········
EEPROM_DATA INTO DFLASH;
END
Can you give the suggestion about this issue? Thanks
In the file tree window of Code Warrior, you should have a group called "Debugger Command Files"
In there will be a "xxx_Startup.cmd" file, where "xxx" is probably the name of the programmer that you use. E.g. on my projects it is called "P&E_Multilink_CyclonePro_Startup.cmd"
Insert the following lines in the file:
Hope that helps
Kef and Stephon,
Thanks for your help.
I modified eeprom section to NO_INIT in prm file and eeprom will not be erased. The solution is OK.
But i try the the second solution and it seems not work.I add 'FLASH AEFSKIPERASING 0' in P&E_Multilink_USB_Startup.cmd or P&E_Multilink_USB_Preload.cmd. EEPROM is still be erased.
Below is command window content. Is anything wrong? Thanks very much.
Loading Target ...
IO registers loaded for MC9S12G128 from D:\Program Files\Freescale\CWS12v5.1\prog\REG\MCU01C2.REG
USB HCS08/HCS12 MULTILINK detected - Flash Version 5.83
executing .\cmd\P&E_Multilink_USB_startup.cmd
!// At startup the commands written below will be executed
Target Ready
done .\cmd\P&E_Multilink_USB_startup.cmd
Startup command file correctly executed.
executing P&E_Multilink_USB.hwc
done P&E_Multilink_USB.hwc
executing .\cmd\P&E_Multilink_USB_preload.cmd
!// Before load the commands written below will be executed
!FLASH AEFSKIPERASING 0
done .\cmd\P&E_Multilink_USB_preload.cmd
Preload command file correctly executed.
FP: FLASH parameters loaded for MC9S12G128_V0_5(NVMIF2 rev 3,3,3,3) from D:\Program Files\Freescale\CWS12v5.1\prog\FPP\mcu01C2.fpp
USB HCS08/HCS12 MULTILINK detected - Flash Version 5.83
executing .\cmd\P&E_Multilink_USB_reset.cmd
!// After reset the commands written below will be executed
done .\cmd\P&E_Multilink_USB_reset.cmd
Reset command file correctly executed.
MCU clock speed: 5707000 Hz
Block Module Name Address Range Status
0 EEPROM 400 - 13FF Programmed - Unselected
1 PFLASH 1400 - 1FFF Blank - Unselected
2 PFLASH 88000 - FBFFF Programmed - Unselected
3 PFLASH 4000 - FFFF Programmed - Unselected
FP: The UNPROTECT command is not available for the EEPROM flash module => Skipped.
FP: The UNPROTECT command is not available for the PFLASH flash module => Skipped.
FP: The UNPROTECT command is not available for the PFLASH flash module => Skipped.
FP: The UNPROTECT command is not available for the PFLASH flash module => Skipped.
executing .\cmd\P&E_Multilink_USB_vppon.cmd
!// Before programming the flash, the commands written below will be executed
done .\cmd\P&E_Multilink_USB_vppon.cmd
Vppon command file correctly executed.
FP: The ERASE command is not performed for the EEPROM flash module (AEFSKIPERASING) => Skipped.
executing .\cmd\P&E_Multilink_USB_vppoff.cmd
!// After programming the flash, the commands written below will be executed
done .\cmd\P&E_Multilink_USB_vppoff.cmd
Vppoff command file correctly executed.
FP: Arm FLASH for loading.
executing .\cmd\P&E_Multilink_USB_vppon.cmd
!// Before programming the flash, the commands written below will be executed
done .\cmd\P&E_Multilink_USB_vppon.cmd
Vppon command file correctly executed.
executing .\cmd\P&E_Multilink_USB_vppoff.cmd
!// After programming the flash, the commands written below will be executed
done .\cmd\P&E_Multilink_USB_vppoff.cmd
Vppoff command file correctly executed.
FP: FLASH disarmed.
USB HCS08/HCS12 MULTILINK detected - Flash Version 5.83
executing .\cmd\P&E_Multilink_USB_reset.cmd
!// After reset the commands written below will be executed
done .\cmd\P&E_Multilink_USB_reset.cmd
Reset command file correctly executed.
executing E:\project\LowCostSJB\backup\bin\LowCostSJB.xpr
RESET
done E:\project\LowCostSJB\backup\bin\LowCostSJB.xpr
executing .\cmd\P&E_Multilink_USB_postload.cmd
!// After load the commands written below will be executed
done .\cmd\P&E_Multilink_USB_postload.cmd
Postload command file correctly executed.
in>
Grace,
I see you added AEFSKIPERASING to preload cmd file. Try moving it to startup cmd file. If this won't work, then maybe it is not working on S12G. I used it only on S12D and it worked.
All zeros you get because DFLASH in PRM is READ_ONLY. All variables in READ_ONLY segments are initialized. Use NO_INIT instead of READ_ONLY.
To make EEPROM not erased, search forums for AEFSKIPERASING. This command in debugger ini file can be used to not erase some eeprom and flash blocks.