Alex,
More findings to the "strange" behavior:
1)
When emulator is in control via JTAG, P0.1 and P0.2 show the same pulses when processor runs (identical digital information), both pins show THE SAME signal (as shown on pictures above), just pull up is different.
So, they could not be TDI, TDO.
2)
It seems that during debug session the GPIO functionality is enabled (if use as JTAG it should be disabled, of cause) and actual signal on the pin is a SUM of port line state and "fake JTAG" signal.
When emulator stops processor, these pins can be set to 0 or to 1 by firmware of by emulator.
3)
When emulator is disconnected (or debugging session has been terminated), the firmware cannot set them anymore.
It looks like they become inputs.
The explicit attempt in firmware to set them as outputs before writing to P0.1,0.2:
GP0DAT = 0x05000000; //does not set them as outputs if processor was in debug mode and now running normally.
Hardware reset restores their functionality as GPIO.
4)
But, the "fake JTAG" signals are rather weak: 10 K resistor to ground reduces their amplitude to about 0.4V if port pin is set to "0". Without 10K resistors to ground, and if port line is set to "1", the "fake JTAG" pulses are above 2.8V.
I strongly believe that behavior is a hardware bug in silicone.