HCS12 Unable to Single Step through EEPROM write +

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

HCS12 Unable to Single Step through EEPROM write +

跳至解决方案
2,017 次查看
YeOldeBDM
Contributor III
Hi. I just inherited a project from an outside consultant and his notes give the following limitations-
-Cannot single step through routines which write to the onchip EEPROM
-Cannot break/resume with WDT enabled (most of the time).
-EEPROM does not retain contents between BDM debug loads (of course the entire memory is flashed from debug session to debug session)
 
 
I have verified the  limitations, and the consultant did spend some time trying to resolve them last year with freescale tech support. Now the project is alive again.
 
 
I am using Codewarrior 3.1 for HCS12. We are using an external oscillator, so there are no PLL issues.
 
Does anyone have any pointers to documentation on these limitations? I googled but did not find anything. I just want to know if these are known issues or if there are any work-arounds.
 
I read somewhere on this board that Codewarrior 4.5 may allow the EEPROM to be preserved between ICD debug sessions, but at this point I don't have time to upgrade
Thanks!
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
649 次查看
Lundin
Senior Contributor IV
-Cannot single step through routines which write to the onchip EEPROM

That's right. The manual, chapter "4.1.4 Illegal EEPROM Operations":

"The part enters STOP mode and a program or erase command is in progress. The command is aborted and any pending command is killed."



-Cannot break/resume with WDT enabled (most of the time).

Of course not. Don't debug with the wdog enabled and you'll be fine.




-EEPROM does not retain contents between BDM debug loads (of course the entire memory is flashed from debug session to debug session)

That one is trickier. You can do it in Codewarrior if you use the old "cmd"-files. In preload.cmd, write:

reset
FLASH
FLASH SELECT
FLASH UNPROTECT
FLASH ERASE 1-8
FLASH ARM


1-8 is the page numbers, for an HCS12 with 8 pages of flash (128k). If you just write FLASH ERASE without any numbers it will erase the whole memory, including the EEPROM which is page 0 if I remember correctly. By adding 1-8 it will only erase the flash.
That's the only way I know of. You might have to set the debugger to "load code + symbols" instead of "load code to nvm" for it to work, since the latter is the new feature introduced in CW3.0 and not compatible with cmd-files. Or so did Metrowerks tell me back then.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
649 次查看
YeOldeBDM
Contributor III
Thanks for the info!
0 项奖励
回复
650 次查看
Lundin
Senior Contributor IV
-Cannot single step through routines which write to the onchip EEPROM

That's right. The manual, chapter "4.1.4 Illegal EEPROM Operations":

"The part enters STOP mode and a program or erase command is in progress. The command is aborted and any pending command is killed."



-Cannot break/resume with WDT enabled (most of the time).

Of course not. Don't debug with the wdog enabled and you'll be fine.




-EEPROM does not retain contents between BDM debug loads (of course the entire memory is flashed from debug session to debug session)

That one is trickier. You can do it in Codewarrior if you use the old "cmd"-files. In preload.cmd, write:

reset
FLASH
FLASH SELECT
FLASH UNPROTECT
FLASH ERASE 1-8
FLASH ARM


1-8 is the page numbers, for an HCS12 with 8 pages of flash (128k). If you just write FLASH ERASE without any numbers it will erase the whole memory, including the EEPROM which is page 0 if I remember correctly. By adding 1-8 it will only erase the flash.
That's the only way I know of. You might have to set the debugger to "load code + symbols" instead of "load code to nvm" for it to work, since the latter is the new feature introduced in CW3.0 and not compatible with cmd-files. Or so did Metrowerks tell me back then.
0 项奖励
回复