cancel
Showing results for 
Search instead for 
Did you mean: 

How to receive and transmit one UART data to another UART in STM32f051c8t6tr

jm.2
Associate II

Hi,

I am working on stm32f051c8t6tr microcontroller, from this I want to read some sensor data with UART1 and same data I want to transmit to another UART. Can you please suggest some example code related to my task. I am new to this controller.

I have tried one code also but its not working, I will share the code in below

HAL_UART_Receive(&huart1,(uint8_t *)buffer,10,10);

HAL_UART_Transmit(&huart2,(uint8_t *)buffer,10,10);

The above two line of code only I tried, buts its not giving any output; Please help me on this.

20 REPLIES 20
S.Ma
Principal

First test your sensor with bluetooth HC-05 or similar from a pc.

If this passes, implement a sw fifo tx and rx between both uart to be clean. Use byte uart interrupt. Gas sensor are usually slow response time, high bitrate probably not needed.