The current UART polling write function performs blocking transmission without any timeout control. In scenarios where the peripheral stalls or transmission never completes, the function can hang indefinitely.
Introduce a timeout parameter or use a predefined constant to limit the polling duration and return an error status if the timeout expires before transmission completion.