Portenta H7 Machine Control and Hardware Watchdog

Hello all :slight_smile: ,
and another problem occurs to me with the arduino h7 machine control and i hope someone can help me.

So iam programming a arduino h7 machine control and the codeworks fine. The board is powered with a extern 24V power supply. And i can connect and disconnect the serial connection (cable) like i want and nothing happens to the board. Its running like it should.

So far so good. I integrated a watchdog for restarts if something goes wrong.
.h:

# include <mbed.h>
#include <Watchdog.h> 
using namespace mbed;
using namespace rtos;

Watchdog &watchdog = Watchdog::get_instance();

setup()-function:
watchdog.start(8000);

loop()-function:
watchdog.kick();

so i only inserted this codesnippets.
And now the board restarts after the defined 8seconds which are triggered when i pull out the serial cable to the PC. When i don`t do that, the code runs like intended.

Is there a context between watchdog or mbed object and a serial connection?
I have no idea.

Thanks :slight_smile:
Sarah

Hi Sarah,

Can I ask where you got the Watchdog.h library from, is it WatchDog - Arduino Reference? In which case it looks to be only compatible form AVR boards so it probably won't work with the mbed based PMC.

What are you anticipating going wrong? I have a PMC in a production environment and it has proven to be very stable.

Hello and sorry for the late reply.
The WatchDog library we use is a part of mbed OS and can be found here: Watchdog - API references and tutorials | Mbed OS 6 Documentation

We have also found a solution to our problem. With the Portenta Machine Control the WatchDog can only be reset (at least for us) in a created mbed thread. In the main arduino loop() the WatchDog is not resetted.