From 1c1001335e9ab92baa86aa8d285ba2644b717abb Mon Sep 17 00:00:00 2001 From: Erick Ahmed Date: Wed, 24 Jun 2026 13:08:43 +0200 Subject: [PATCH] Wait until UART ready --- Core/Src/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Core/Src/main.c b/Core/Src/main.c index 69c046c..cf51c07 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -102,7 +102,7 @@ void uart_debug_print(const char *fmt, ...) if (len > 0) { - while (HAL_UART_GetState(&huart1) & HAL_UART_STATE_BUSY_TX); + while (huart1.gState != HAL_UART_STATE_READY); HAL_UART_Transmit(&huart1, (uint8_t*)buf, len, 100); } } @@ -134,7 +134,6 @@ int main(void) /* MCU Configuration--------------------------------------------------------*/ - /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */