1
\$\begingroup\$

I am using STM32F4 MCU I'm trying to implement OTA update on it most of the work is done. Now when we switch the firmware from old to new firmware it requires restart. In order to switch to new firmware I need to hard reset it or restart it which fails the purpose of OTA

Basically I want to restart/ hard reset microcontroller after it receives new firmware start from different memory address.

\$\endgroup\$
9
  • 5
    \$\begingroup\$ What microcontroller? \$\endgroup\$
    – user39382
    Commented Aug 8, 2017 at 8:32
  • 2
    \$\begingroup\$ I've never come across a micro with a cord switch! Would you try to explain that a bit better please? :) \$\endgroup\$
    – DiBosco
    Commented Aug 8, 2017 at 8:34
  • 2
    \$\begingroup\$ I think you are describing a watchdog circuit. \$\endgroup\$
    – Martin
    Commented Aug 8, 2017 at 8:41
  • 4
    \$\begingroup\$ what Nickagian said. Combining the comments above into one: Please state exactly what device you're talking about, and at least as importantly, Why and What you're trying to do – this smells a lot like the XY Problem. Anyway, without giving more info, this question remains too vague to be answered. \$\endgroup\$ Commented Aug 8, 2017 at 8:57
  • 2
    \$\begingroup\$ Why do you think you need a hard reset? What's wrong with calling NVIC_SystemReset() from the ARM CMSIS library? (Or implementing NVIC_SystemReset() in your own code.) \$\endgroup\$
    – kkrambo
    Commented Aug 8, 2017 at 13:05

2 Answers 2

6
\$\begingroup\$

What you describe is a watchdog circuit.

It is a circuit that, when enabled, resets your µC after a given time, unless its timer is reset (through code or by sending it a pulse).

Its intended use is to restart frozen microcontrollers after a failure. A correctly working code should reset the watch at regular intervals, but in case of a failure (data corruption, bug, infinite loop, etc.) the watchdog no longer gets resetted, and triggers the reset of the microcontroller.

There even often is a flag that is set if the watchdog triggers a reset, so that the restarting microcontroller knows that it happened, and can run additional self-test, throw/log an alert, etc.

Many microcontrollers have a watchdog feature, but if yours does not, there are dedicated watchdog IC, or you can even build yours, and a 555 is a mean to do just that. Google "555 timer watchdog" for more details.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you. I am working on STM32F4 series MCU. It definitely has watchdog features. I'll search about it and try to implement in the code. I was thinking of old school 555 timer way of doing it but the solution was already built into the system already. \$\endgroup\$
    – Davinder
    Commented Aug 8, 2017 at 11:04
1
\$\begingroup\$

There are dedicated reset chips for that.

Another alternative is to use the watchdog timer to cause a reset.

Using a GPIO pin to pull reset low isn't quite reliable. In some cases using a GPIO pin to activate a bjt or MOSFET to discharge a capacitor on the reset pin can work. But not 100 percent reliable in a noisy environment.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.