I want to detect via software if an on-chip debugger is connected. i use JTAG iC3000 with the board MPC5643L.
Is there a way to do that ?
If not, is there some other way to write an instruction/code that halts if a debugger is connected and ignored otherwise ?
I dd that on an MPC860 chip. Some of the Debugger module registers become read-only on that chip when the debugger is attached, so I had my code perform a read/write/read test on some unimportant bits in one of the registers.
Good luck trying to understand anything in the Nexus chapter!
Another possibility (assuming you want your code to know if you've come out of reset stand-alone or have started under the control of the debugger) is to have the debugger initialisation script write a non-default value to a device register in the CPU. If your startup code finds a non-default value in this register it knows the debugger wrote it that way.