Skip to main content
ian239955
Associate III
July 11, 2013
Question

f4 discovery rs232 baud problem

  • July 11, 2013
  • 4 replies
  • 738 views
Posted on July 11, 2013 at 10:29

Hi, 

I have it working but seem to get about 1/3 of the baud rate that I program into 

USART_InitStructure.USART_BaudRate

In other words, I have to set it to 9600*3 to get a baud rate of approximately 9600 baud.

Maybe I have to change something in system_stm32f4xx.c but I'm not sure what?

Thanks

    This topic has been closed for replies.

    4 replies

    waclawek.jan
    Super User
    July 11, 2013
    Posted on July 11, 2013 at 10:52

    My crystal ball says, that you attempt to use firmware intended for the STM32-EVAL board (with 25MHz crystal) on an 'F4 DISCOVERY (8MHz crystal). But my crystal ball used to be wrong at times.

    From system_stm32f4xx.c:

      * 4. The default value of HSE crystal is set to 25MHz, refer to ''HSE_VALUE'' define

      *    in ''stm32f4xx.h'' file. When HSE is used as system clock source, directly or

      *    through PLL, and you are using different crystal you have to adapt the HSE

      *    value to your own configuration.

    JW

    ian239955
    ian239955Author
    Associate III
    July 11, 2013
    Posted on July 11, 2013 at 16:29

    Thanks, your crystal ball was right!

    Cheers, Ian

    jj2
    Associate
    July 11, 2013
    Posted on July 11, 2013 at 18:47

    Might that ''xtal ball'' soon provide, Internet Access?

    waclawek.jan
    Super User
    July 12, 2013
    Posted on July 12, 2013 at 10:18

    > Might that ''xtal ball'' soon provide, Internet Access?

    :D