9 years, 4 months ago.

Interrupt handler not executed

I am trying to use this library with the NUCLEO-L152RE, but the interrupt handler is never entered. I am unsure about the NVIC initialization.

Question relating to:

Erik - / WakeUp Featured
Wake-up timer library to wake from deepsleep/power-down KL25z, LPC800-MAX, LPC812, powerdown, Sleep, wake-up

1 Answer

9 years, 4 months ago.

I don't have the L152 myself, so cannot test it. If we don't find a solution I can retest it on one of the Nucleo boards I do have, but of course that is something different.

What you can try: First of all, does the RTC run when using time functions: http://developer.mbed.org/handbook/Time. If no, then there is the issue since the library uses that RTC.

If it does run, can you try in this file: http://developer.mbed.org/users/Sissors/code/WakeUp/file/f3adba7cf7c4/Device/WakeUp_STM_RTC.cpp, on line 24 to increase the wait to like 1 second? (That is assuming you removed the RTC code again from you main, if you keep that then just add the wait after you set the RTC time).

If the RTC library is the same for all Nucleo boards, the WakeUp value can only be set to an integer, fractional values will not work. There is an RTC issue in any case that still persists where the RTC registers are reset on power cycle or hardware reset with or without back up cell and with or without 32KHz crystal option fitted.

That's with latest SRC and WakeUp library builds.

posted by Paul Staron 17 Dec 2014

Yeah but WakeUp should not be affected by the RTC being reset, since if needed it should enable the RTC, add the timeout value to the current time, and set that as alarm value.

Also any integer time in milliseconds should work, since it only accepts integers for ms :). If the time in seconds is supplied fractions should work. Did you observe something else? Because then I need to have a look at that :(.

posted by Erik - 17 Dec 2014

Yes WakeUp::set_ms(500); does work. But WakeUp::set(.5); does not as you indicate. So no worries there.

I'm just hoping if I keep banging on about the RTC reset issue, one of the 'big guns' may pick up on it and sort it out. I have tried but too much interrelated code in the library's for me.

posted by Paul Staron 17 Dec 2014

Heh I see the set is also using integers, wonder why I didn't do floats there. So the 0.5 gets rounded to 0, which is not really intended. No reason not to have floats for that one tbh.

posted by Erik - 17 Dec 2014

The first suggestions works - RTC runs when using time functions . Second suggestion makes no difference - still not entering interrupt service routine. Thanks so far.

posted by Hennie Strydom 18 Dec 2014

Can you post the code you are using? Then I'll try to have a look at it in the weekend to see if it still works on my boards. I assume you are using the latest mbed libs for both WakeUp and mbed?

Might be that yours uses different name for the interrupt vector, while also having this one defined. But thats something I got to look into. But without the MCU myself I can't make guarantees.

posted by Erik - 18 Dec 2014