cancel
Showing results for 
Search instead for 
Did you mean: 

InitStructure Significantly Changes USART Output

i_
Associate II
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

11 REPLIES 11
i_
Associate II
Posted on March 06, 2014 at 19:14

Thanks guys, I think i fully understand now.

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

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
Up vote any posts that you find helpful, it shows what's working..