Skip to main content
Ehsan Habib
Associate II
June 19, 2018
Solved

Cannot Blink JTDI pin

  • June 19, 2018
  • 1 reply
  • 1169 views
Posted on June 19, 2018 at 12:26

I am using STM32F103RCT6 to blink a LED which is connected to PA15 - JTDI in PU.

My GPIO Configuration is like this

GPIOA->CRH |= GPIO_CRH_MODE15; //Output mode, max speed 50 MHz. GPIOA->CRH &= ~GPIO_CRH_CNF15; //General purpose output push-pull\

And I am trying to Blink Like this

#define LED_HIGH() (GPIOA->BSRR |= GPIO_BSRR_BR15) //LED High #define LED_LOW() (GPIOA->BSRR |= GPIO_BSRR_BS15) //LED LOW

In datasheet it says

0690X0000060L9IQAU.png

To free the Pin for GPIO we need to configure SWJ_CFG[2:0] either with 010 or So for that i am configuring

AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_1; //((uint32_t)0x02000000) as 010

Datasheet also says we need to do something with ODR/IDR registers but i am not getting correcty how to configure PA15 (or any JTAG pins) as GPIO.

The SWJ_CFG in AFIO_MAPR is given as

0690X0000060LKTQA2.png

Any suggestion will be helpful.

Thank You in advance

#blink #stm32 #jtag
This topic has been closed for replies.
Best answer by Tesla DeLorean
Posted on June 19, 2018 at 13:05

make sure the AFIO clock is enabled, and then mask on the bits you need, perhaps not assuming the OR is sufficient. 

1 reply

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
June 19, 2018
Posted on June 19, 2018 at 13:05

make sure the AFIO clock is enabled, and then mask on the bits you need, perhaps not assuming the OR is sufficient. 

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Ehsan Habib
Associate II
June 19, 2018
Posted on June 19, 2018 at 13:33

Yes, AFIO Clock was not enabled.