2014-10-25 01:32 PM
Hi,
I tried and failed, now I'm asking here If someone please could provide. I use STM32F030.
I want to use SWD pins (SWDIO and SWCLK) as I/O pins. But SWDIO always logic 1, SWCLK 0.My code: RCC->AHB1ENR |= 0x00000001; //A port clock enable GPIOA->PUPDR = 0; //A port No pull up, no pull down GPIOA->MODER |= 0x04000000; //A13 output GPIOA->ODR |= 0x00002000; //A13 logic 1 GPIOA->MODER |= 0x10000000; //A14 output GPIOA->ODR |= 0x00004000; //A14 logic 1 #swd-pins-using-as-i/o2014-10-26 08:31 AM
Perhaps you'd want to mask the bits before ORing in new ones. In other SPL releases there have been examples of turning off the SWD/JTAG interfaces.
2014-10-26 01:14 PM
thanks Clive1 for answer.
Found the problem.first must GPIO->MODER register reset.True code: GPIOA->MODER &= 0xC3FFFFFF; //A13(SWDIO) ve A14(SWCLK) reset GPIOA->MODER |= 0x14000000; //A13 ve A14 output GPIOA->PUPDR &= 0x00000000; //A port No pull up, no pull down GPIOA->ODR |= 0x00004000; //A14 logic 1 GPIOA->ODR |= 0x00002000; //A13 logic 1Good working.