Skip to main content
Explorer
June 22, 2024
Solved

Not able to "Receive" data via UART on STM32f429-disco

  • June 22, 2024
  • 1 reply
  • 2316 views

hello guys, 
i am using a FTDI FT232B17 for serial communicaiton with my stm32f429 board. i'm using keil uvision, and not using any libraries other than stm32f429xx.h to write the code. i am facing problems "receiving" data from the ftdi-ft232 to my STM32 board. i have successfully sent data from stm32f429 and am able to see it on tera-term/real-term etc, but i am not able to echo or receive data, any ideas where it could be wrong? i have double checked my hardware connections. while running the program when i click "send" from the Real-term, light blinks on the ft232 board but unfortunately nothing is received on stm32.

    This topic has been closed for replies.
    Best answer by sk12

    guys turns out, PA0 and PA1 didnt work because of being connected to the RAM and they were pulled low, i check with the oscilloscope if the signal was received on PA1, it was indeed but since it was pulled low, i used a different port, PC10 and PC11 which did work 

    1 reply

    Super User
    June 22, 2024

    Hi,

    >any ideas where it could be wrong?

    in your program ...

    or hardware: did you check with scope, data coming to F429 rx pin ?

    + Which uart ? Did you check, nothing connected on your board to the rx pin ?

    sk12Author
    Explorer
    June 22, 2024

    i toggled the on-board LED on my code to find where i am wrong, it turns out 

    unsigned char UART4_read(void) {
        // working led_tog();
    /*problem*/ while (!(UART4->SR & USART_SR_RXNE)) {
    //here LED toggling continuously in loop led_tog();
        //not togling led_tog();
    return UART4->DR; 
    }

    it turns out it is stuck in 'while (!(UART4->SR & USART_SR_RXNE))' loop and not accepting any data even after me sending it through the real-term application, setting the SAME baud rate and all other parameters like stop bits etc. 
    the issue got to be with the TX pin(PA0) on-board connected to RX of the ft232, either the TX Pin on ft232 is damaged or could be the wire.. are the most visible problems to me when i think about it.. what could it be?
     
    Graduate II
    June 22, 2024

    Make sure to clear any pending errors on the UART, so noise, framing type errors.

    The STM32F429I-DISCO likely to have very few unconflicted pins.

    Provide a wiring diagram and initialization code for clocks, pins and peripheral. 

    char InChar(void)
    {
     while((USART_RS232->SR & USART_SR_RXNE) == 0) // Wait for Char
     {
     if (USART_RS232->SR & (USART_SR_PE | USART_SR_FE | USART_SR_NE | USART_SR_ORE)) // Check/Clear Errors
     USART_RS232->DR;
     }
     return((char)USART_RS232->DR); // Read Char
    }