Reset Handler

05 Mar 2010

Hey all,

At the moment, I need to run a function when the mbed is reset (i.e just before the default reset handler), First of all, am I correct in assuming that the reset button on the mbed generates and interrupt which calls some sort of reset handler? If so, is it possible to change the reset ISR (in other words, overload the reset button) to call another function before it continues to reset the mbed?

I looked around the forum but it seems the closest reference I found was the function mbed_reset() somewhere..

05 Mar 2010

What kind of function do you need to run? And why?

I don't think you can "catch" the reset button since it probably just pulls the reset pin on the CPU.

06 Mar 2010


I wanted to run fclose() among other things. I am doing some data logging and storing the data on the mbed flashdrive. I don't like the fact that I have to fclose every time I write to the file. When you don't close the file and the mbed is reset theres trouble..

Maybe I can use an InterruptIn with an ISR that calls fclose() and mbed_reset()?