Page 1 of 1

STM32L startup difficulties

Posted: Sat Apr 06, 2013 8:47 pm
by andyturk
I'm bringing up a blinker app on a new homemade board with a STM32L151 running at 1.8V. The code seems to work fine... except when the mcu hard faults at power on. Usually, when I apply power, it faults (not sure where) and then sits in the hard fault handler drawing about 4mA. When the application runs, the LED flashes and the board draws about 1.25mA since it's configured to use only the MSI oscillator. My guess is that when it faults, the HSI is running too and that's why the power draw is higher.

The curious thing is that resetting the mcu in the debugger or by grounding nRST *always* brings up the app correctly. So what's the difference between a power on reset and an external nRST reset?

I checked for power glitches and haven't found any. I set up a slow square wave on a function generator to repeatedly apply power to the board at 1 second intervals. All the VDD pins ramp together to 1.8V over the course of 1mSec, so I don't think the problem lies there.

Any suggestions on where to look next?

Image

Re: STM32L startup difficulties

Posted: Sat Apr 06, 2013 9:14 pm
by Giovanni
Hi,

Could it be a problem with reset circuitry? it is possible it needs a longer reset state.

giovanni

Re: STM32L startup difficulties

Posted: Sat Apr 06, 2013 9:20 pm
by andyturk
Giovanni wrote:Could it be a problem with reset circuitry? it is possible it needs a longer reset state.


Umm, what reset circuitry? :?

When I've used F103 parts before, they worked fine without anything connected to nRST. Once power was applied, the mcu resets and runs normally.

Maybe the L is different in that respect?

Re: STM32L startup difficulties

Posted: Sat Apr 06, 2013 9:47 pm
by Giovanni
I think it is always required, this one has a reset IC for example: https://www.olimex.com/Products/ARM/ST/ ... 2-P152.pdf

Giovanni

Re: STM32L startup difficulties

Posted: Sat Apr 06, 2013 10:03 pm
by andyturk
Apparently, it's OK to leave nRST floating because it has an internal pull up. BOOT0 does not, so it can't be left floating.

Doh!

After tying BOOT0 to ground, the board boots normally. :D

Image