Skip to content

Commit 4cb13dd

Browse files
committed
fix(st-uart): correct UART enable test in flush function
Correct test if UART is enabled. Avoid panic when flush has not happened in the given time. The function just exits in that case. Signed-off-by: Yann Gautier <yann.gautier@foss.st.com> Change-Id: I550211d348687b52dcf23b5f13f4afc891801e6a Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/tf-a/+/315186 ACI: CITOOLS <MDG-smet-aci-reviews@list.st.com> ACI: CIBUILD <MDG-smet-aci-builds@list.st.com>
1 parent 230b4d8 commit 4cb13dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/st/uart/aarch32/stm32_console.S

+2-2
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,13 @@ func console_stm32_core_flush
240240
#endif /* ENABLE_ASSERTIONS */
241241
/* Skip flush if UART is not enabled */
242242
ldr r1, [r0, #USART_CR1]
243-
ands r1, r1, #USART_CR1_UE
243+
tst r1, #USART_CR1_UE
244244
beq 1f
245245
/* Check Transmit Data Register Empty */
246246
mov r2, #USART_TIMEOUT
247247
txe_loop_3:
248248
subs r2, r2, #1
249-
beq plat_panic_handler
249+
beq 1f
250250
ldr r1, [r0, #USART_ISR]
251251
tst r1, #USART_ISR_TXE
252252
beq txe_loop_3

0 commit comments

Comments
 (0)