2026-01-20 5:41 PM
Cube setting is OK!
First run OK!
2026-01-20 6:13 PM - edited 2026-01-20 6:14 PM
The functions you listed will work as expected with the latest HAL library. You are probably executing a DMA transmit somewhere that you've forgotten about or you are using 3+ year old library code.
If you still have problems, please provide a full compile-able project which shows the issue.
Here is code which functions without error on a new STM32H723 project:
if (HAL_UART_Transmit(&huart4, data, sizeof(data), HAL_MAX_DELAY) != HAL_OK) {
Error_Handler();
}
if (HAL_UART_AbortReceive(&huart4) != HAL_OK) {
Error_Handler();
}
if (HAL_UARTEx_ReceiveToIdle_DMA(&huart4, &data, sizeof(data)) != HAL_OK) {
Error_Handler();
}
if (HAL_UART_Transmit(&huart4, data, sizeof(data), HAL_MAX_DELAY) != HAL_OK) {
Error_Handler();
}
TX and RX states for UART are independent and are handled correctly within HAL.
Related/duplicate:
HAL_UART_Transmit_DMA 使用 HAL_UART_AbortReceive 後異常 - STMicroelectronics Community