I am trying to configure STM32F4 USART peripheral. I thought that USART Receiver pin(RX) must be programmed as Alternate function to USART works correctly and then the data is present on the I/O pin can moves into the USART Receiver Shift register.
I mean that according to the following pictures taken from the STM32F4 Reference manual, when we do configure a pin as Alternate function it gives a way for the data to moves into the Alternate function input(here it is Receiver shift register) but when that pin is configured as Floating input (second picture) the data on that pin is just sampled into the input data register.
So logically i think that USART can't do it's job correctly when Receiver pin is configured as Floating input. but incredibly it does work in a correct way and i dont know why?!
The same Problem has been discussed here : Why is the USART receiver pin configured as “input floating”?
But i couldn't find my answer there.
Ambiguous point is that however in Floating input mode the data will also be sent to the connected Alternate functions But it's important to specify which peripheral this data will be sent to.
When the microcontroller starts up from Reset mode, Reset values of almost all Registers is 0 so for instance pin 7 by default is connected to AF0 which that isn't for USART periph. So if we select Floating input mode for that pin and don't determine which alternate function we want to send the data, then the data might be sent to the wrong peripheral instead of USART receiver shift register.
But incredibly without determining the peripheral which we want to select as our Alternate function, USART does the work correctly. Actually my question is WHY does USART work correctly in this way (without determining The actual Alternate function)?