Unable to perform JTAG programming and debugging in CubeIDE and STLink V2
Hi all,
I'm using STLink V2 (Not STLink V2 ISOL) to program and debug a STM32F103C8 microcontroller(Development board is a low cost STM32 bluepill). Programming and debugging via SWD works like a charm, without any issue. But I was never able to get the JTAG working. I made all the pin connections according to page 12 of UM1075. The way I tried is given below.
- Connected all the relevant JTAG pins according to UM1075 documentation.
- Reserved all JTAG pins from CubeMX in Cube IDE
- Inside "stm32f1xx_hal_msp.c" file, it was checked and verified if "__HAL_AFIO_REMAP_SWJ_ENABLE()" line is there in HAL_MspInit() function.
- From Project > Debug configurations,
- Debug Probe - ST-LINK(ST-LINK GDB Server)
- Interface - JTAG
- Reset Behavior - Connect Under reset
And that's all.
When I try to debug I get the message "Failed to Start GDB server" along with
"Error in initializing ST-LINK device." and "Reason: No device found on target." messages on console. But when I select SWD as debug interface, it works fine.
Any thoughts about this? What am I missing?
