cancel
Showing results for 
Search instead for 
Did you mean: 

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

SSaid.11
Associate

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 .

1 REPLY 1
Bruno_ST
ST Employee

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.