Skip to main content
Explorer II
June 19, 2024
Solved

UART not receiving data when sent through putty

  • June 19, 2024
  • 3 replies
  • 8121 views

i am using stm3210e-eval board which has stm32f103zgt6 mcu and i trying to send data on its uart but i am not able to receive any. i am trying to receiving it through blocking mode 

 

 

uint8_t rx[10];
HAL_UART_Receive(&huart2,rx,1,HAL_MAX_DELAY);
HAL_Delay(1000);

 

 

now this is the code and i have put the breakpoint on HAL_Delay so that as soon as data is received it will next stop on HAL_Delay but it does not break it stays stuck into uart function there and is not data getting received. I am using FL232RL to send data from putty to mcu pins of uart i can ensure that data is being sent from putty because when i hit enter onto putty i can see the green led getting blinked with each send of data but i am not getting anything over there but i can send data from mcu to putty i can see that clearly so what is happening

PS: i have double checked the baud rate it correctly set and the uart is transmit and receive mode i have tried changing it to receive mode only but that doesn't help 

image of putty configuration for sending the data

Screenshot 2024-06-19 091954.png

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

    actually the problem was something else. in CubeIDE we can directly select the board and it loads all the pre configuration and i believed it to be configured right but it wasn't apparently the Rx pin wasn't set in any mode. I set it to input mode and then put the pin in pull down mode and el voila I got it.

    3 replies

    Super User
    June 19, 2024

    @rahul7515 wrote:

    i am using stm3210e-eval board


    So the same as here:

    https://community.st.com/t5/stm32-mcus-products/uart-sending-some-else-data-and-not-as-intended/td-p/686958

     


    @rahul7515 wrote:

    . I am using FL232RL to send data from putty to mcu pins of uart


    As noted in that previous thread, the stm3210e-eval board has RS232 Transceivers connected to the MCU's UART pins:

    AndrewNeil_0-1718789020795.png

    https://community.st.com/t5/stm32-mcus-products/uart-sending-some-else-data-and-not-as-intended/m-p/687059/highlight/true#M252609

    So you'll need to disconnect those before connecting your FL232RL ...

    rahul7515Author
    Explorer II
    June 19, 2024

    well i cannot just disconnect those because they are on board and soldered and i am not sending the data onto rs232 pin but the actual MCU pins given as header PA2 and 3 or PA9,10

    Super User
    June 19, 2024

    Are there not any links or solder bridges to disconnect them?

    You can't just connect the FL232RL output - because it will be shorted to the ST3232C output!

    Or just get yourself a USB-to-RS232 converter, and connect to the DE9 

     

    EDIT:

    Or use a Nucleo-F103RB instead ?

    https://www.st.com/en/evaluation-tools/nucleo-f103rb.html

     

    Super User
    June 19, 2024

    @Andrew Neil wrote:

    Are there not any links or solder bridges to disconnect them?


    Yes, there are zero-ohm links on every output from the ST3232C chips  to the MCU input pins:

    AndrewNeil_0-1718790856916.png

     

    Graduate II
    June 22, 2024

    Obviously something is wrong as the IC has the right input and right power so it should get the right output. If the output is not shorted it should be the right level. Something is wrong with this development board. So I recommend either getting a new board or putting a level converter on a solderless breadboard and wiring it up to a different UART pin of the MCU. Or use a TTL level serial cable and avoid RS232 levels. It's not rocket science.

    rahul7515Author
    Explorer II
    June 22, 2024

    well brother i tried using with different board stm3210e as my company had 2 of them but still getting the same result there must be something else