Why is the USART receiver pin configured as "input floating"?
They say:


RX is a floating input (0b0100) which is its default state although you may wish to enable the pullup/down feature if it suits your application. Lastly, the APB2 peripheral clock will need to be enabled for the USART.


I don't know the STM32 specifically but that seems reasonable if they are setting up the pin basic function in this manner and then mapping a functional block to it.

This simply says that it is an input pin and that as they expect it to be hard driven by an external source it does not usually need a pullup or pull down to define its default state and so may "float" as it will never be left floating in practice.

You might have asked the equivalent question about the TX pin. They say


The TX pin, PA9 should be set up as a push-pull output using the alternate function at low frequencly (0b1010).


ie they are making it a generic output with no regard to its specific UART function.

Clearly [tm] the UART functionality is set up independently of the basic pin functionality.



Read more: http://www.micromouseonline.com/2009/12/31/stm32-usart-basics/#ixzz1pl023oib

Read more: http://www.micromouseonline.com/2009/12/31/stm32-usart-basics/#ixzz1pkyxYtpZ