How to use the watchdog timer with the Seeeduino mega v3.0?

I tried to use the watchdog timer to do a software reset.

wdt_enable(WDTO_2S) while(1) {};

The reset works fine but after that the board keeps resetting in an infinite loop.
Therefore I disabled the watchdog in the start of the setup() function:

void setup() { wdt_disable(); }
This doesn’t help, it keeps resetting which is weird because it has 2 seconds to disable.
Because of the infinite resets, it is difficult to load a new program but not impossible.

How can the watchdog be used?

hi~ you can have a try~