Skip to main content
i__it
Associate II
March 5, 2014
Question

InitStructure Significantly Changes USART Output

  • March 5, 2014
  • 11 replies
  • 2379 views
Posted on March 05, 2014 at 23:37

Hi all,

I'm hoping this is an easy one and just something I am missing. A google didn't return anything obviously relating to my problem.

I have some messy code that sets up my USART peripheral correctly. I have used    

GPIO_InitTypeDef GPIO_InitStructure;

USART_InitTypeDef USART_InitStructure;

...cast as global structures at the top of the script. Main then uses these to setup the usart and begin transmitting.

This works correctly. However, as my code grows I now have the need to put GPIO init in to it's own function. I noticed when doing this that having the USART_InitTypeDef USART_InitStructure; structure declared locally to the function the usart output did 'funny' things (not expected output). GPIO Init structure location seems to have no affect.

Please advise!

Thanks as always guys,

Ian

    This topic has been closed for replies.

    11 replies

    Tesla DeLorean
    Guru
    March 6, 2014
    Posted on March 06, 2014 at 19:22

    IS there a chance my startup script is incorrect (and not clearing the stack memory it intends to use?)

    The goat isn't sure, I will stare at it harder...

    0690X00000602rVQAQ.jpg
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..