HCS12 Unable to Single Step through EEPROM write +

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HCS12 Unable to Single Step through EEPROM write +

Jump to solution
1,835 Views
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!
Labels (1)
Tags (1)
0 Kudos
1 Solution
467 Views
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.

View solution in original post

0 Kudos
2 Replies
467 Views
YeOldeBDM
Contributor III
Thanks for the info!
0 Kudos
468 Views
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 Kudos