About MCU XE167FM and refered to “User’s Manual XE167xM”:

We need to use the pin P2.9 as address line 22 for external flash memory, at the moment we’re using default setting for JTAG so we’ve this configuration:

Startup configuration (“User’s Manual capitolo 12.3.2):
Startup Mode - Internal Start From Flash
Debug Interface – from Flash
STSTAT.HWCFG Value – 0x07
P10[6:0] = X X X X 1 1 1

JTAG configuration:
P2.9 TCK
P5.4 TMS
P7.0 TDO
P5.2 TDI

We need to preserve every JTAG functionality (Programming, degub, … etc), so we want to swap the P2.9 (used as TCK) with the P8.5, and obtain:

JTAG configuration:
P8.5 TCK
P5.4 TMS
P7.0 TDO
P5.2 TDI

(User’s Manual CAP 12-3) We noticed that there’s a register called DBGPRR that define the JTAG pin configuration.
The questioni is: How we can change in a definitive way this register with the configuration that we need? We tried to find a way from memtool but nothing, same by setup it from firmware.
Thanks everyone.