cancel
Showing results for 
Search instead for 
Did you mean: 

UART message not Receiving in ESP32 from STM32

mast3rshinobi
Associate II

hi all,

I'm Trying to send a string from STM32F401RE MCU to EPS32 Via UART i have programmed both STM as well as ESP32 and i successfully verified that data is available on UART pin of STM

 
mast3rshinobi_2-1699771354335.png

 

Data on UART Pins of STM

But I'm not able to receive data on ESP32, i double checked the UART Hardware connection is correct

and i configured STM UART in TX_ONLY mode , did not configure any hardware flow pins ,baudrate is 9600,1 stop bit and not using parity

 

 
mast3rshinobi_3-1699771410201.png
ESP32 UART RX

 

I'm receiving some Garbage value on Arduino

can anyone please help me with the UART message not Receiving in ESP32

1 ACCEPTED SOLUTION

Accepted Solutions
mast3rshinobi
Associate II

Hello All,

Thanks for taking your time and Interest in Solving the Issue, I figured the Solution for this problem, I was using USART2 peripheral but i did not know SB62 and SB63 Are by default OFF(means

mast3rshinobi_1-1699812514806.png

 

)  

mast3rshinobi_0-1699812417466.png

I got the Above Information from User Manual of STM32F401RE,

So in my Implementation I used UART6 Peripheral instead of 2, So i'm receiving the data on ESP32

mast3rshinobi_2-1699812679355.png

 

View solution in original post

8 REPLIES 8

Provide a wiring diagram. Output from STM32 needs to go to input of ESP32, need common ground.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mast3rshinobi
Associate II

Hello Thanks for the reply

mast3rshinobi_0-1699782551799.png

I followed the wiring Connections as mentioned in the above image Where Device 1 is STM32 and Device 2 is ESP32, Both the devices are powered using PC USB Port

I'm not familiar with which ESP32 board you're using or the physical pins involved. Check the signal with a scope, I think you've already established the STM32 is doing what it's supposed to be doing, so focus on why the code on Arduino doesn't function as expected. Perhaps to character level forwarding instead of string.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ELowe
Associate III

I looks like ESP is having difficulties interpreting STM32's messages, or your serial viewer is having same issue. Check both.

mast3rshinobi
Associate II

Hello All,

Thanks for taking your time and Interest in Solving the Issue, I figured the Solution for this problem, I was using USART2 peripheral but i did not know SB62 and SB63 Are by default OFF(means

mast3rshinobi_1-1699812514806.png

 

)  

mast3rshinobi_0-1699812417466.png

I got the Above Information from User Manual of STM32F401RE,

So in my Implementation I used UART6 Peripheral instead of 2, So i'm receiving the data on ESP32

mast3rshinobi_2-1699812679355.png

 

Manual for NUCLEO-F401RE board, the STM32F401RE is a chip. 

It would be good practice moving forward to identify exactly what boards and hardware you're using, with enough specificity a manual could be found.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
kali7989
Associate II

@mast3rshinobi @Tesla DeLorean iam facing the same issue, receiving garbage value, could you please share clock configuration and USART6 details for your board ? iam using STM32f407vet6 board USART6 with half_duplex (Only transmit)

thanks & regards

If clocking from an external source (oscillator or crystal, HSE), make sure the the HSE_VALUE in stm32f4xx_hal_conf.h is reflective of the correct speed. Otherwise the baud math is broken.

Send a constant stream of 'U' or 0x55 bytes, and scope the UART_TX signal to confirm the speed you're actually transmitting at.

If you're transmitting properly, check the receiver..

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..