Watchdogs and debugging are always a problem.
Some CPUs allow debugging with a watchdog by having the watchdog stop when the debugger stops the CPU.
Other ones, like the MCF5329 which I'm familiar with have a "HALTED" configuration bit, which as well as having the watchdog stop when the debugger halts the CPU, disables the "write once" operation of the debugger control registers, so the debugger can turn the watchdog on and off as required.
The MCF51JM doesn't seem to have any of those capabilities.
So it looks like you can't (or can't easily) debug code with the watchdog.
To fix this you normally have to write your startup code to find out somehow if you're running under the debugger or not, and to disable the watchdog when you are. Otherwise, the "debugger startup script" should disable the watchdog.
> How can i soft reset MCF51JM
Back to your original question. The MCF5329 has a "Soft Reset" bit in a register. The MCF51JM doesn't. So you have to use the Watchdog to cause a soft reset, unless you've disabled it or it is disabled under the debugger.
You really don't want thave the CPU reset itself out from under the debugger or you'll probably lose control of it. "Debugging resets" is as problematic as "debugging the watchdog". You can reset the CPU from the debugger, so that what you should do.
You should probably write your code to try and reset using the watchdog, and then sit in a loop waiting for the reset. When you're debugging it, when it is stuck in a loop that means you have to manually reset it from the debugger.
If you want to be able to reset it without using the debugger, connect a GPIO pin back to the Reset pin and drive that.
You may want to be able to debug resets, watchdogs and all that, but you may be using a chip that simply doesn't support that, and requires you to make compromises. Maybe the chip and the debugger can conspire to do this well enough, but you can't find any documentation telling you how to do this. Check your debugger/development documentation. Maybe someone else here who has used this chip knows if this can be done.
Tom