From 10c7217822211e267a111d7c677a996fea1f9c3c Mon Sep 17 00:00:00 2001 From: Antony Pavlov Date: Sun, 17 Nov 2019 11:34:44 +0300 Subject: [PATCH] STM8L-DISCOVERY: enable UART output (#279) The BOARDINIT routine from STM8L-DISCOVERY/boardcore.inc remaps UART interface to PA2/PA3 pins but the PA2 output mode set code is missed. As a result UART produces no output. The commit fixes the problem by setting up PA2 as push-pull output. Signed-off-by: Antony Pavlov --- STM8L-DISCOVERY/boardcore.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/STM8L-DISCOVERY/boardcore.inc b/STM8L-DISCOVERY/boardcore.inc index be19113..10159ce 100644 --- a/STM8L-DISCOVERY/boardcore.inc +++ b/STM8L-DISCOVERY/boardcore.inc @@ -15,6 +15,8 @@ BOARDINIT: ; Board I/O initialization MOV CLK_PCKENR1,#0x21 ; Enable USART1[5] and TIM2[0] MOV SYSCFG_RMPCR1,#0x10 ; Map USART1 to PA2[TX] and PA3[RX] + BSET PA_DDR,#2 ; Setup PA2[USART1_TX] as output + BSET PA_CR1,#2 ; Setup PA2[USART1_TX] as push-pull output ; Leds init BSET PE_DDR,#7 ; PE7 LED green