Search code examples
mbed

What causes LowPowerTimer to crash during instantiation?


Upon instantiating a LowPowerTimer, like so:

LowPowerTimer* lowPowerTimer = new LowPowerTimer();

It crashes on my own target. It works 100% on the STM32F429-discovery evaluation board.

What could cause the problem? All other code runs perfectly. There are enough memory and flash. The micro is of the same family. Are there any prerequisites that I do not know of? The micro I'm using is the STM32F413RH with a 26MHz external crystal.

I use the mbed platform and code in C++, FWIW...


Solution

  • So what I found was that in the targets.json file I had to override the lse_available macro. The lse_available macro states that a low-speed external oscillator is connected to the micro - and then the Low Power Ticker would use that as its source. But if you set it to 'not connected', it uses other clock sources.