Skip to main content
Associate
Feb 28, 2024 10:25 AM UTC
Question

UART Transmit issue

Hi there,

I have a gps receive code on f411 black-pill, and it is work fine. Recently, the system updated software packages to F4 1.28.0, found that the HAL library HAL_UART_Transmit does not work on each UART tx port, but HAL_UART_Receive_IT normal, I wonder if anyone is experiencing the same problem, and how to solve it. The function of HAL_UART_Transmit just use for printf as following

 

int __io_putchar (int ch)

{

HAL_UART_Transmit (&huart1, (uint8_t *)&ch, 1, 0xFFFF);

return ch;

} /* __io_putchar() */

 

 

This topic has been closed for replies.

5 replies

Andrew Neil
Super User
Feb 28, 2024 10:31 AM UTC

Please use this button to properly post source code:

AndrewNeil_0-1709116165966.png

 

You're not checking the return value of HAL_UART_Transmit - you should do that, and see if it's giving you an error code to identify what's going wrong.

Have you tried stepping into HAL_UART_Transmit to see what's happening?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
JamesLinAuthor
Associate
Feb 28, 2024 12:02 PM UTC

Hi Andrew,

Thanks for your information. I have step into HAL_UART_Transmit, and the HAL_UART_Transmit return HAL_OK, as the attachment. So, I have no idea on the problem.

Andrew Neil
Super User
Feb 28, 2024 12:09 PM UTC

How do you determine that it's not transmitting?

Have you checked for activity at the STM32 pins ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Andrew Neil
Super User
Feb 28, 2024 3:18 PM UTC

@JamesLin wrote:

Recently, the system updated software packages to F4 1.28.0, found that the HAL library HAL_UART_Transmit does not work ... but HAL_UART_Receive_IT normal


Similar:

https://community.st.com/t5/other-software/hal-uart-transmit-issue-after-f4-1-28-0-update/td-p/645168 ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.