File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
bsp/stm32/libraries/HAL_Drivers/drivers Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1111 * 2020-05-02 whj4674672 support stm32h7 uart dma
1212 * 2020-09-09 forest-rain support stm32wl uart
1313 * 2020-10-14 Dozingfiretruck Porting for stm32wbxx
14+ * 2025-08-24 ItsGettingWorse Fixed bugs under different optimization levels
1415 */
1516
1617#include "board.h"
@@ -353,7 +354,10 @@ static int stm32_putc(struct rt_serial_device *serial, char c)
353354#else
354355 uart -> handle .Instance -> DR = c ;
355356#endif
356- while (__HAL_UART_GET_FLAG (& (uart -> handle ), UART_FLAG_TC ) == RESET && -- block_timeout );
357+ while (__HAL_UART_GET_FLAG (& (uart -> handle ), UART_FLAG_TC ) == RESET && -- block_timeout )
358+ {
359+ __DSB (); // Data Synchronization Barrier
360+ }
357361 return (block_timeout != 0 ) ? 1 : -1 ;
358362}
359363
You can’t perform that action at this time.
0 commit comments