Skip to main content
SSaid.11
Visitor II
September 8, 2022
Question

How to enable and disable the JTAG-DP pins temporarily by using code

I am New to the STM32H723Z controller. I want to enable and disable the JTAG-DP pins temporarily by using code. Any sample code or clue appreciated .

This topic has been closed for replies.

1 reply

ST Employee
September 12, 2022

Hello @SSaid.1​ 

You just have to reprogram the GPIO pins via GPIO_Init().

Or uses the LL as i do to restore the SWD functionality in case of Error :

#define GPIO_SW_PORT  GPIOA

#define GPIO_SWDIO_PIN LL_GPIO_PIN_13

#define GPIO_SWCLK_PIN LL_GPIO_PIN_14

 __HAL_RCC_GPIOA_CLK_ENABLE();

 LL_GPIO_SetPinPull(GPIO_SW_PORT, GPIO_SWCLK_PIN, LL_GPIO_PULL_DOWN);

 LL_GPIO_SetAFPin_0_7(GPIO_SW_PORT, GPIO_SWCLK_PIN, LL_GPIO_AF_0);

 LL_GPIO_SetPinMode(GPIO_SW_PORT, GPIO_SWCLK_PIN, LL_GPIO_MODE_ALTERNATE);

 LL_GPIO_SetPinPull(GPIO_SW_PORT, GPIO_SWDIO_PIN, LL_GPIO_PULL_UP);

 LL_GPIO_SetAFPin_0_7(GPIO_SW_PORT, GPIO_SWDIO_PIN, LL_GPIO_AF_0);

 LL_GPIO_SetPinMode(GPIO_SW_PORT, GPIO_SWDIO_PIN, LL_GPIO_MODE_ALTERNATE);

BR,

Bruno

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.