Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

Ability to freeze Arduino / micro-controller?

2 posters

Go down  Message [Page 1 of 1]

marjan.mrak



Since there is a watchdog option (in Arduino Uno board at least), it would be great to be able to simulate a "frozen" board, which would then had to be revived with watchdog reset.

A very real-life test / situation with high-current devices....

Regards,
Marjan



Last edited by marjan.mrak on Sat Feb 19, 2022 8:49 am; edited 1 time in total

arcachofo

arcachofo

it would be great to be able to simulate a "frozen" board,
What do you mean by "frozen".

Sleep modes are not yet implemented, but I'm working on it.

marjan.mrak



"Frozen" means that processor "hangs" - it stops running "dead".

This is not sleeping - processor cannot be made run again - except if reset pin is pulled down.

So the principle of watchdog mechanism is, that watchdog resets processor, if watchdog's timer "timeouts". In order to make it sure, that watchdog "knows", that processor is "alive", there must be an "in time watchdog-timer-reload" implemented in user code.

Marjan

arcachofo

arcachofo

Watchdog timer should be working.
But you have to activate it in Properties->Config->Enable Watchdog.

"Frozen" means that processor "hangs" - it stops running "dead".

This is not sleeping - processor cannot be made run again - except if reset pin is pulled down.
Well... I could keep asking waht "hangs" or "dead" means.
I mean exactly what stops to work and why, for example if an external clock is used it could be a bad connection that stops the cpu, but this is a hardware problem.
Or it could happen that an error in the firmware breaks the intended operation, but the cpu is indeed still running but stuck in an infinite loop or something similar.
In any case, the watchdog is a timer, so it must keep running in order for a watchdog reset to happen.

One way to simulate this is by adding an infinite loop in your firmware that happens at certain conditions.

marjan.mrak



I am sure you have experienced at least once in your lifetime your PC to "freeze". You know: mouse pointer stopped moving, not a single key on a keyboard worked. So the only way for you to be able to bring "frozen" computer back to life was to reset it, or power-cycle it (on / off).

The same goes with everything else that contains a CPU.

CPUs are very sensitive devices. The cause of their temporary resignation(?) is in most cases strong electromagnetic interference, or spikes on I/O lines. CPU just stops working (as if it's clock would be taken off), and cannot be revived in no other way as to be put to reset - either over RST pin, or power-cycle.

And a watchdog being a third option.

infinite loop is not what I am looking for. The purpose of my request is to be able to simulate (and thus create) a "bullet-proof" embedded devices, which should be able to "come back to life" even if their CPU stopped working without being destroyed.

arcachofo

arcachofo

The purpose of my request is to be able to simulate (and thus create) a "bullet-proof" embedded devices, which should be able to "come back to life" even if their CPU stopped working without being destroyed.
You can't simulate every possible scenario in simulide, specially if it is due to a hardware malfunctioning.

You can check that the watchdog is doing its job, for example forcing an infinite loop.
But the watchdog is just a timer and it could "stop working" like the cpu or any other periferical.

marjan.mrak



I seriously doubt that microcontroller would be designed in such way that it's watchdog would "die" with it.

But anyway, you have a point there. I throw my towel. Smile

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum