cancel
Showing results for 
Search instead for 
Did you mean: 

usart strange behaviour, need restart

pcu
Associate II
Posted on June 04, 2013 at 15:10

Hello I have a strange behaviour with usart (1 and 4) on STM32F217.

I use it as output log. When I build and debug, nothing leaves the STM. After a ''debug'' reset in atollic(a restart)  it works fine.

I tried these two operations:

-after one loop of program, try a soft reset. But not good.

-an external reset. But not good.

I don't know where to search. I compared register when it works and when it doesn't but no difference (for USART and NVIC).

It is exactly the same with DMA and USART transmit. It is fine at the second time (only after debugger reset).

If somebody has an idea?

Pierre
2 REPLIES 2
Posted on June 04, 2013 at 15:20

Pay attention to whether the HSE and PLL start properly.

Pay attention to the order in which you enable clocks, and start peripherals, etc.

Check to see if the code gets stuck in a loop somewhere. Use LED/GPIO to track progress through startup code and initialization so you can pin point where things are failing or stuck.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
pcu
Associate II
Posted on June 04, 2013 at 16:31

yes the order to enable clock was wrong, clock for GPIOx was enabled after GPIO_PinAFConfig().

Thank you.

Pierre