Hi
Some more details, just checked.
Both Connect (Reset) button in connection manager and Reset Target (Ctrl+R) button do reset target to special single chip mode. This is bad to debug with all normal mode protections engaged.
1) Prerequisites. CW 5.1. USB-M-12 rev B. Should work for other Multilink or Cyclone revisions, but I'm trying with USB-ML-12 rev B.
2) In Hiwave go to HC12MultilinkCyclonePro -> Connect or Communication menu. Connect or Communication depends on BDM connection state, connected or not.
3) Check the most bottom checkbox Show this dialog before attempting to connect... This is not necessary.
You did it already.
4) On first time connect, in checkbox from above is checked, hit Connect (Reset) button, and observe flash code programming messages. Otherwise (Show... checkbox is not checked) debugger won't show connection manager and skip to flash code programming.
4) After code flashing is done, go to HC12MultilinkCyclonePro->Communication... . This will show connection manager dialog.
5) Hit Hotsync button.
5) Power cycle target or pull and release /RESET pin low.
6) Hit Halt (F6) button to stop target. Then debug as usual. To debug from start you need to use some (un)conditional loop to stop target after power on or reset.
There's another way, but it must depend on CW and Multilink versions. Perhaps target model matters also.
1) S12C64. Code is flashed to target, debugger is closed. Target is power cycled (normal mode).
2) Hit debug from CW
3) Debugger starts and "Loading a new application will stop the execution of the current one" dialog box pops up.
4) Hit Cancel
5) "Do you want to load application symbolic information?" click Yes
6) Halt (F6) target. Target executes in normal single chip mode.
Code to demonstrate the difference between normal vs special operating modes is below. Should compile for S12A/B/C/D. In normal mode it hangs in the first while() loop, in special mode in for(;;) loop.
#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
void main(void) {
/* put your own code here */
EnableInterrupts;
FCLKDIV |= 1;
FCLKDIV &= 0;
while(FCLKDIV & 1) {
asm("NOP");
}
for(;;) {
_FEED_COP(); /* feeds the dog */
} /* loop forever */
/* please make sure that you never leave main */
}
Regards
Edward