Skip to content

Commit

Permalink
STM8L-DISCOVERY: enable UART output
Browse files Browse the repository at this point in the history
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 <antonynpavlov@gmail.com>
  • Loading branch information
frantony committed Nov 16, 2019
1 parent 6df71a9 commit 1f6a8e2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions STM8L-DISCOVERY/boardcore.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1f6a8e2

Please sign in to comment.