cancel
Showing results for 
Search instead for 
Did you mean: 

UART Transmit issue

JamesLin
Associate

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() */

 

 

5 REPLIES 5
Andrew Neil
Evangelist III

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?

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.

How do you determine that it's not transmitting?

Have you checked for activity at the STM32 pins ?

Hello,

Before going to use printf(), try HAL_UART_Transmit() in a simple example and as said by @Andrew Neil  you need to check an activity on UART TX pin. If there is nothing outputted you have to share you code as we can help you efficiently.
As ST we don't support  neither black-pill boards nor other X-pill flavors, but we can have a try ..

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Andrew Neil
Evangelist III

@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 ?