0
\$\begingroup\$

I'm working on a project that has chosen an RPi3 model B board as part of the system. We previously had an external watchdog system that would cut the entire system power if the watchdog expired. This external watchdog system has been "optimized out" now due to various changes needed for UL certification, so I'm looking to add a dedicated watchdog chip to the Rpi. We already have a custom power supply board that plugs into the 40 pin expansion header (http://pi4j.com/pins/model-3b-rev1.html), so my plan is to do a new version of that board that includes a WDT chip.

The requirements are:

  1. Fairly long timeout, e.g. >= 3 minutes. We'd prefer to not have to modify the bootloader & kernel to pat the WDT while the system is powering up. We'd like to just pat the WDT from the main userspace application.
  2. Low cost. Looking for a chip level solution rather than some type of external module.
  3. The WDT can be easily patted from a GPIO line on the 40 pin RPi header
  4. Optional - some type of indication the WDT is about to fire. I've only used simple WDT chips before that reset the system when they expire. I'd be quite good if we were also able to log the fact in Linux that the WDT is about to expire, then have it reset the system.
  5. Optional - also can reset the RPi on brownout conditions.

It'd be great to hear if anyone else has made an external custom WDT for an RPi system like this and if anyone can recommend a WDT chip that can meet these requirements.

Thank you.

\$\endgroup\$
1
\$\begingroup\$

The "about to fire" indication can be implemented by delaying the reset pulse.

I suggest using a small microcontroller together with reset chip. The internal separately clocked hardware windowed WDT on the MCU can keep the micro honest and then you can use that to implement the reset. For example, you can implement a windowed WDT.

The implementation should be easy enough for anyone that thoroughly understands both microcontrollers and watchdog timers. It won't be much more than a couple of chips.

I assume you've already considered the RPi internal hardware WDT and found it wanting, but you could combine the two to increase the likelihood of a reset occurring under any conceivable circumstances.

\$\endgroup\$
  • 1
    \$\begingroup\$ Thanks Spehro, I think I'll go with this solution (small microcontroller). \$\endgroup\$ – SeanLabs Jun 25 '18 at 19:56
1
\$\begingroup\$

The BL233 is a Serial to I2C interface chip. One of its design goals is to support small linux devices (RPi and Routers) for unattended, remote, battery operation.

It has a built in watchdog function for exactly this purpose, that can fire when there is no serial action for some (long) period.

As the watchdog runs a control macro, it can perform all sorts of complex operations. In your case it could set an alert pin to the RPi, turn a light on, then delay before doing a hard power reset.

It also has power-on macro, and a sleep function that can be used to turn the RPi into a battery power logging system - for example a remote mesh network with cameras, that turns on once every 15mins to relay messages, or implement a hardware wakeup pin.

There is a board that can plug onto RPi for testing. (drawings at end)

The BL233 "C" variant has enhanced sleep and watchdog functions, that are not in released documents, but just ask for more details if you are interested, and we can tell you how to do exactly what you want.

If you need an unattended device to be guaranteed to work long-term and not lock up, the only way is to have an external watchdog, that does a full power cycle. Using internal watchdogs, or relying on the reset pin cannot be expected to guarantee reset

[I am the manufacturer of this product]

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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