STM32L startup difficulties

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
andyturk
Posts: 23
Joined: Tue May 01, 2012 7:22 pm

STM32L startup difficulties

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32L startup difficulties

Post by Giovanni »

Hi,

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

giovanni
andyturk
Posts: 23
Joined: Tue May 01, 2012 7:22 pm

Re: STM32L startup difficulties

Post 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?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32L startup difficulties

Post 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
andyturk
Posts: 23
Joined: Tue May 01, 2012 7:22 pm

Re: STM32L startup difficulties

Post 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
Post Reply