From 26b10f3e5df85c8907a17c2751c4bbdb1ab3ccca Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 13 Apr 2021 18:42:14 +0200 Subject: [PATCH] rfdsatt: Disalbe JTAG AF on some GPIO lines overlapping LE --- projects/rfdsatt/rfdsatt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/projects/rfdsatt/rfdsatt.c b/projects/rfdsatt/rfdsatt.c index 39c4a24..2689fae 100644 --- a/projects/rfdsatt/rfdsatt.c +++ b/projects/rfdsatt/rfdsatt.c @@ -143,7 +143,11 @@ static void usart_setup(void) static void gpio_setup(void) { #ifdef STM32F1 - /* Set GPIO15 (in GPIO port B) to 'output push-pull'. */ + /* disable JTAG, keep SWJ-DP (we use some related GPIOs) */ + rcc_periph_clock_enable(RCC_AFIO); + gpio_primary_remap(AFIO_MAPR_SWJ_CFG_JTAG_OFF_SW_ON, 0); + + /* Set GPIO15 (in GPIO port B) to 'output push-pull' for the LED. */ gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO15); #else