The debug pins are in AF pull-up/pull-down after reset:
PA14: SWCLK in pull-down
PA13: SWDIO in pull-up
When the pin is configured as output, the value written to the output data register
(GPIOx_ODR) is output on the I/O pin. It is po ssible to use the output driver in push-pull
mode or open-drain mode (only the low level is driven, high level is HI-Z).
你是个明眼人,
PA14: SWCLK in pull-down
PA13: SWDIO in pull-up
When the pin is configured as output, the value written to the output data register
(GPIOx_ODR) is output on the I/O pin. It is po ssible to use the output driver in push-pull
mode or open-drain mode (only the low level is driven, high level is HI-Z).
测试不行
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14;
GPIO_Init(GPIOA, &GPIO_InitStructure);
复用成普通I/O,不开启AF模式,但是要开启AFIO时钟。普通I/O复用成其他功能管脚才需要开AFmode