Mega2560 < UART > STM32F4Discovery

Hello!

I would like to use Arduino Mega 2560 as simple UART-to-USB converter. I would like to send messages from STM32F4Discovery board to Arduino Mega 2560 via UART and then from Arduino to PC via virtual COM port.

How do I connect Arduino to STM32F4Discovery? Do I need any extra electronics? If I understand correctly, Arduino's UART has voltage level 5V?

You need to post a link to this STM32F4Discovery device. Without knowing what that is, your questions can not be answered safely.

In general terms: I have done this with Arduino Uno, but should be same for Mega. Using Software Serial library to set Arduino to accept serial communication from digital ports other than PD0 and 1. I have PD2,3 connected to my STM PB6,7 set for Alternate Function, in this case USART1........so your STM32F4 works as Xbee might. Of course you have to know how to program STM for USART. The code for the Arduino is very simple, acting as the interface between STM and PC, where you can use Arduino IDE's serial monitor or use Processing to receive the characters from the Arduino. You'll need to send data a character at a time, of course using USART protocol.