To understand all of this stuff, take a look at "Table 18-1. Equations for Calculating Baud Rate Register Setting" from the datasheet on page 189. The equation you suggested you found in some example code
UBRR1 = (F_CPU / 4 / baud - 1) / 2;
... is kind of close to the equation for Asynchronous Double Speed mode (U2Xn = 1)... but not exactly.
If you know the baud rate and crystal speed you intend to operate at, I would just pull the register settings out of "Table 18-9. Examples of UBRRn Settings for Commonly Used Oscillator Frequencies" on datasheet page 210 and call it a day. The only reason to use any of those equations is if you want to be able to change the settings dynamically at run-time for some reason (or if you want to do thins "elegantly" in software, I prefer compile time certainty for something like this to remove doubt).
For the settings you outlined in your question, that would be:
UCSR1A = 0; // importantly U2X1 = 0
UCSR1B = 0; // interrupts enabled in here if you like
UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); // no parity, 8 data bits, 1 stop bit
UCSR1D = 0; // no cts, no rts
UBRR1 = 103; // 9600 baud @ 16MHz XTAL with U2X1 = 0
As a side note, while the hardware does store the baud rate register (UBBRn) as two 8-bit registers, in software there is no need to treat it as such. You can access the High and Low registers (e.g. UBRR1H and UBRR1L respectively) but you can also just
assign to (or read from) the named "combined" register as though it was a 16-bit register.
UBRR1 = 0x0343;
is functionally equivalent to UBRR1H = 0x03; UBRR1L = 0x43;
There is something wrong with the module if it does not work with x-ctu.
Try doing the +++ command at all possible comm settings until it works. It sounds like the two modules are programmed for different baud rates.
Best Answer
Probably the logic levels of the UARTs of the two MCUs are not compatible, since they are powered with different voltage levels.
As the the STM32F405 datasheet says, that MCU has a supply voltage range of 1.8V...3.6V, whereas the Arduino UNO board powers its MCU (ATmega 328P) at 5V.
As Bence Kaulics confirms in its comment, your F4 discovery board powers its MCU at 3V, so a logic high on its TX line cannot be higher than 3V, which is the exact minimum input voltage required for a logic high for an ATmega328P powered at 5V (VIH=0.6Vcc=0.6*5V=3V – see datasheetat p.313):
So you need a level shifter between the two boards on the TX line of your discovery board and, possibly, also on its RX line (but this latter could be not necessary, because the STM32 MCU has 5V-tolerant inputs).
Something like this level shifter may work for you: