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

27 REPLIES 27

the thing is you don't have any solution and instead you give me an alternative to do something else.....that is no solution. i am stuck in a  company project and i don't have time to make a schematic for how i have connected. Can't you trust what i am saying. the problem isn't in code as i said earlier, it's the voltage level. do you have any proper reason for that as why is that happening?

 

look for the STM3210E-eval board schematic that's all you need to see

IMG_20240621_164234_535.jpg

here is your scope image. The upper blue output of ST3232ECTR IC and i am getting what I wrote on putty i.e. RDFS

below yellow is the output from MOXA which is some gibberish data getting into input of the IC. You can clearly see the voltage levels written below left corner

Without a wiring diagram/schematic  I don't know what I'm looking at. The ST3232ECTR  has 4 outputs, so I don't know what you mean by "output". Also I don't know your probe setting, so 200mV can also be 2V if you have a x10 probe. (That's a very nice scope btw. Not cheap. If your employer can afford that he can get you anything you need, in fact hourly rates exceed the price of many cheap tools anyway, so don't hesitate to ask your employer for things you need)

My recommendation: draw a wiring diagram on a piece of paper and see at which point in your circuit the signal voltage and/or timing isn't correct. Check ground connection, input impedance, supply voltage, reset/enable lines, etc. with a multimeter to see if there are shorts or open connections that shouldn't be there or parts of the circuit that do not get the right voltage or enable/reset levels. It shouldn't take much time.

 

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

Screenshot 2024-06-22 091650.png

the probe is at 1x and there is literally nothing in between as you can see in the schematics also i have looked at the board seems to be a straight line without anything in between. I even tried simulating the inside of the IC on multisim and got a result of 3.3V over there, why here i am not getting

If you haven't configured PA3 as an output and the level converter and the MCU are properly supplied, then R1out should be high or low. If your measurements are correct the converter IC seems to be broken.Try a different board.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

PA3 is configured as input and i have checked the power supply via DMM it is 3.3V as it should be. on the board there are 2 of them and i have tried with both of the IC by changing UART1 to UART2 but i have seen no difference although if i transmit anything from my mcu to putty, that is properly transmitted and seen on the terminal. i don't understand how can 2 of the IC be broken and yet work on way properly but not the other way around that too half way i am getting data just not at the correct voltage level

unsigned_char_array
Senior III

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.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

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