6 years, 7 months ago.

Is there a way to turn off the scheduler ticker?

I am trying to demonstrate (to my students) how an ISR can wake up the MCU from sleep()

In mbed 2, this was relatively easy to do: Call sleep() from main and use a Ticker or InterruptIn to wake it, run the ISR, and return back to the sleep state.

For example:

int main() {

set up Ticker and attach to a function... etc.... code not shown

while (1) { sleep(); printf("ISR Completed\n\r"); }

}

In mbed-os 5.x, this rapidly prints "ISR Completed" presumably because the scheduler timer is waking the CPU from sleep? This is despite me only using the main thread.

Assuming my assumption is correct, is there a way in mbed-os 5 to turn off the scheduler / associated timer?

Which target is this? Does it help if you call core_util_critical_section_enter(); before sleeping? If that helps then it's a bug in the HAL for the board that you're using.

posted by Jan Jongboom 06 Oct 2017

I’ll try that. It’s a Nucleo F429ZI

posted by Nicholas Outram 06 Oct 2017

I tried what you suggested and it made no difference.

posted by Nicholas Outram 11 Oct 2017

Ok - I've resolved it (my bad) - when I created a project from a template, I assumed it was using the latest library version. I manually updated it, and it now works.

posted by Nicholas Outram 11 Oct 2017
Be the first to answer this question.