cancel
Showing results for 
Search instead for 
Did you mean: 

UART not receiving data when sent through putty

rahul7515
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

28 REPLIES 28
Andrew Neil
Evangelist III

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

rahul7515
Associate III

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

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

 


@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

 

well i can't just desolder those miniature smd resistors

changing the board is no solution and besides even if it is connected to its out why does that matter i am directly giving my input their it should directly go to the mcu 


@rahul7515 wrote:

i can't just desolder those miniature smd resistors


Of course you can - that's exactly why they're there!

All you need is to break the connection - you don't need to be careful about not damaging the "resistors".

 

Alternatively, again, get yourself a USB-to-RS232 converter (or two; or a double), and connect to the DE9(s):

AndrewNeil_0-1718793643112.png

AndrewNeil_1-1718793692497.png

 

 


@rahul7515 wrote:

 even if it is connected to its out why does that matter


Think about it:

If the ST3232C output is giving a '1', and your FL232RL output tries to give a '0' you are shorting the '1' and '0' together - that's not going to work!

Similarly, If the ST3232C output is giving a '0', and your FL232RL output tries to give a '1' you are again shorting a '1' and '0' together - that's not going to work!

 

It's a general principle of electronics that you can't just* wire two outputs together.

It's fine to have one output driving two (or more) inputs (so long as you don't overload the output) - that's why the transmit from your MCU works.

 

* there are special cases of outputs specifically designed for this - but you can't just do it without "special measures"

 

#ShortingOutputs

Hello @rahul7515 ,

As stated by @Andrew Neil there is a short circuit between RS232 transceiver output going to UART_Rx and your FL232RL bridge output!

It's a very basic concept in digital electronics: don't connect two outputs directly together. For that either ORing the outputs or using open-drain config which is not possible in your case.

So you don't have any solution than disconnecting ST3232C by removing the adequate 0 ohm resistors.

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.