STM32L startup difficulties
Posted: Sat Apr 06, 2013 8:47 pm
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?

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?

