Where is port A registers configured for pins 13 and 14 to configure SWD?
STM32F407VGT6
Here is my code:
#include "main.h"
int main(void)
{
RCC->AHB1ENR|=RCC_AHB1ENR_GPIOAEN;
while (1)
{
}
}
For port A registers (pins 13 and 14) is the configuration done in the IDE? In the code, I did not find the configuration of port A registers, but SWD still works.
What settings are needed to install SWD on pins 13 and 14 of port A?
I looked at the GPIOA_MODER register, it looks like this: 1010 1000 0000 0000 0000 0000 0000 0000
It turns out pins 13 and 14 are set to Alternate function mode.
For some reason, pin 15 of port A is also set to Alternate function mode, although pin 15 of port A is a general purpose pin.
I cleared those GPIOA->MODER=0; bits, but they are not overwritten when the IDE is restarted.
I have to erase the whole chip to get into it.
In the code, I did not find where port A is configured, but if the configuration occurs through the IDE, then why are the bits not restored after I erase them GPIOA->MODER=0;
------------------------
Port A registers start at address 0x40020000.
