On what part? On the F1 for instance you have to move the JTAG/SWD function off the pins. This is a very old thread, with a lot of content lost across several forum crashes so don't expect any of the original posters to respond. This thread deals with the JTAG remapping/disabling