UART Transmit issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-28 2:25 AM
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() */
- Labels:
-
STM32F4 Series
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-28 2:31 AM
Please use this button to properly post source code:
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 designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-28 4:02 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-28 4:09 AM
How do you determine that it's not transmitting?
Have you checked for activity at the STM32 pins ?
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-28 5:04 AM
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 ..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-28 7:18 AM - edited ‎2024-02-28 7:19 AM
@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:
A complex system designed from scratch never works and cannot be patched up to make it work.
