From 12acb99a38a24c239beba952fd0053d952fc19d1 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 25 May 2021 22:13:09 -0400 Subject: stm32: Fix USART3 on stm32f1 and stm32f2 Commit 6a3c357a incorrectly disabled support for USART3 on stm32f1 and stm32f2 - restore that support. Also, add support for USART3 on PD9/PD8 on stm32f103. Signed-off-by: Kevin O'Connor --- src/stm32/stm32f1.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/stm32/stm32f1.c') diff --git a/src/stm32/stm32f1.c b/src/stm32/stm32f1.c index 34c28573..86a5efac 100644 --- a/src/stm32/stm32f1.c +++ b/src/stm32/stm32f1.c @@ -160,6 +160,10 @@ gpio_peripheral(uint32_t gpio, uint32_t mode, int pullup) // TIM3 full remap stm32f1_alternative_remap(AFIO_MAPR_TIM3_REMAP_FULLREMAP_Msk, AFIO_MAPR_TIM3_REMAP_FULLREMAP); + } else if ((gpio == GPIO('D', 8) || gpio == GPIO('D', 9)) && func == 7) { + // USART3 remap + stm32f1_alternative_remap(AFIO_MAPR_USART3_REMAP_FULLREMAP_Msk, + AFIO_MAPR_USART3_REMAP_FULLREMAP); } else if ((gpio == GPIO('D', 12) || gpio == GPIO('D', 13) || gpio == GPIO('D', 14) -- cgit v1.2.3-70-g09d2