2018-02-20 07:06 PM
Hi,
I amUsing STM32F429-NUCLEO- I write the code for UART3 transmit/receive (poling method) and the board is transmitting but the data is not receiving. Pls help me to fix the issue.
Find the attached source code
Thanks,
Note: this post was migrated and contained many threaded conversations, some content may be missing.2018-02-20 08:00 PM
...
/* Infinite loop */
/* USER CODE BEGIN WHILE */ HAL_UART_Transmit(&huart3, pbufftx, strlen(pbufftx), 0xFFFF);while (1)
{ // Perhaps use the debugger as see what != HAL_OK values are returnedif(HAL_UART_Receive(&huart3, pbuffrx, 1, 0xFFFF)==HAL_OK)
{ HAL_UART_Transmit(&huart3, pbuffrx, 1, 0xFFFF); }/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */...
2018-02-20 09:15 PM
Alternative
while (1) { if (USART3->SR & 0x20) // RXNE USART3->DR = USART3->DR; // Echo if (USART3->SR & 0x0F) // Errors USART3->DR; // Clear }2018-02-20 10:10 PM
this also not working.
2018-02-20 10:24 PM
Perhaps it is not actually receiving data? Don't open a peripheral view of the USART in the debugger.
Check GPIO settings in debugger.
2018-02-20 10:56 PM
Gpio settings are correct(PD8 and PD9 is used for USART)
Still no data receiving
2018-02-20 11:19 PM
It's nucleo board so you should be able to use the VCOM - does it work fine? It eliminated external UART-to-USB converter as ST-LINK provides this feature.
2018-02-20 11:41 PM
receive process ends with hall time out ;(
2018-02-20 11:55 PM
Connect TXD with RXD using a wire (simple testing loop), send a few char and after receiving a char switch on a LED. Just to eliminate the cabling issue (not sure what you are connecting the uart3 to).
Second, does it imply that other uarts work fine?
2018-02-21 12:11 AM
I have verified the cable connection with PC and it is correct. The nucleo board can transmit data but not receiving and always exit with time out. I tested UART2 and 3 both are behaving same.
The simple testing loop also not working.