Skip to main content
manes69692
Associate II
February 2, 2009
Question

uasrt1 baudrate when using printf

  • February 2, 2009
  • 3 replies
  • 873 views
Posted on February 02, 2009 at 07:02

uasrt1 baudrate when using printf

    This topic has been closed for replies.

    3 replies

    manes69692
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:01

    Hi

    I'm using the printf function , but it looks my baudrate is always 9600Bd

    whatever value I put in the usart1_brr.

    I do an include , and call the printf function

    the first thing in my main program is set the clock to pll and 72Mhz

    after that setting the baudrate , but whatever value I write in the baudrate register , it always prints at 9600 Bd.

    What must I do to change the baudrate ?

    Regards ,

    Ronny

    m3allem
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 13:01

    Hi Ronny,

    Could you send your clock+UART configurations?

    However, you have to retarget the C library printf function to the USART as described in the STM32 firmware library example. I attach it!

    B.R.

    M3allem.

    st3
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:01

    This depends entirely on how your particulat printf has been implemented; specifically, the USART ''driver'' part.

    Therefore, without knowing what printf you're using, it is impossible to answer!

    You should check the documentation for your toolchain - it should describe its implementation, and how to adapt it to your own requirements.