From d321e5241203f115592f7f48a515d71e9639ef2f Mon Sep 17 00:00:00 2001 From: xuhonghao <50578534+xhhhm@users.noreply.github.com> Date: Tue, 6 Sep 2022 13:01:03 +0800 Subject: [PATCH] [bsp][APM32][APM32F407VGT6] (#6377) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用APM32F407VGT6芯片发现shell命令行无法接收命令,解决shell命令行输入问题 将board.c中的: GPIO_ConfigStruct.mode = GPIO_MODE_IN; GPIO_ConfigStruct.pupd = GPIO_PUPD_UP; 修改为: GPIO_ConfigStruct.mode = GPIO_MODE_AF; GPIO_ConfigStruct.pupd = GPIO_PUPD_NOPULL; 使用APM32F407VGT6测试成功 --- bsp/apm32/apm32f407ig-minibroard/board/board.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp/apm32/apm32f407ig-minibroard/board/board.c b/bsp/apm32/apm32f407ig-minibroard/board/board.c index 978d1db477..711ac85898 100644 --- a/bsp/apm32/apm32f407ig-minibroard/board/board.c +++ b/bsp/apm32/apm32f407ig-minibroard/board/board.c @@ -25,7 +25,7 @@ void apm32_usart_init(void) GPIO_Config(GPIOA, &GPIO_ConfigStruct); GPIO_ConfigPinAF(GPIOA, GPIO_PIN_SOURCE_9, GPIO_AF_USART1); - GPIO_ConfigStruct.mode = GPIO_MODE_IN; + GPIO_ConfigStruct.mode = GPIO_MODE_AF; GPIO_ConfigStruct.pin = GPIO_PIN_10; GPIO_ConfigStruct.pupd = GPIO_PUPD_UP; GPIO_ConfigStruct.speed = GPIO_SPEED_50MHz; @@ -44,7 +44,7 @@ void apm32_usart_init(void) GPIO_Config(GPIOA, &GPIO_ConfigStruct); GPIO_ConfigPinAF(GPIOA, GPIO_PIN_SOURCE_2, GPIO_AF_USART2); - GPIO_ConfigStruct.mode = GPIO_MODE_IN; + GPIO_ConfigStruct.mode = GPIO_MODE_AF; GPIO_ConfigStruct.pin = GPIO_PIN_3; GPIO_ConfigStruct.pupd = GPIO_PUPD_UP; GPIO_ConfigStruct.speed = GPIO_SPEED_50MHz; -- GitLab