Skip to main content
julien239955_stm1_stmicro_com
Associate
May 16, 2011
Question

Overrun Error using USART1

  • May 16, 2011
  • 4 replies
  • 940 views
Posted on May 16, 2011 at 15:09

Overrun Error using USART1

    This topic has been closed for replies.

    4 replies

    julien239955_stm1_stmicro_com
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 14:35

    [EDIT] : I found another problem not regarding the STM32. The post is to be closed Thanks all.

    OK I will change this.

    I forgot to say something, my USART is linked to the PC by a XBee module and it is also stood by as the STM32 is. I'm trying a solution which just comes to me. I'll shared it here if it works.

    Andrew Neil
    Super User
    May 17, 2011
    Posted on May 17, 2011 at 14:35

        while( !(RCC_GetFlagStatus(RCC_FLAG_PLLRDY)== SET) );

     

    Never have a busy-loop wait in an ISR!
    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    julien239955_stm1_stmicro_com
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 14:35

    Thanks for the advise.

    Tesla DeLorean
    Guru
    May 17, 2011
    Posted on May 17, 2011 at 14:35

    [EDIT] : I found another problem not regarding the STM32. The post is to be closed Thanks all.

     

    OK I will change this.

     

     

    I forgot to say something, my USART is linked to the PC by a XBee module and it is also stood by as the STM32 is. I'm trying a solution which just comes to me. I'll shared it here if it works.

    Notwithstanding this apparent fix, you should always check for parity, framing, overrun, etc errors, and clear them by reading the data register. Even if you choose to ignore the error, it must be cleared before the USART will work properly again.
    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..