user48730: I'm trying to add a watchdog on an Arduino Nano, for my code, and I'm following exactly code in this manual, but after the amount of time for not resetting the watchdog- it resets but does not reboot.
At last paragraph- it says that :"

However, I could not find something similar in Optiboot bootloader (If
  I'm wrong, correct me please!), used by Arduino UNO and other new
  boards. It seems that they sacrificed this check for size. So, it is
  possible that watchdog timer will be enabled after reset, so -  if you
  set it's value too low, your board may never come out of bootloader
  stage. So, to be always on the safe side, set watchdog to longer
  periods (2S and more).

So I've tried for 8s, but still same result.
What is wrong ?

EDIT1:

#include <avr/wdt.h>
int k=1;
void setup() {
  Serial.begin(9600);
  wdt_enable(WDTO_8S);
}
void loop() {
  //do stuff here
  k++;
  wdt_reset();
  Serial.println(1000 * k);
  delay(1000 * k);

}


user37622: the "old" Nano bootloader doesn't clear the Watchdog flag and while the bootloader waits for the upload, the board resets.
flash the "new" bootloader to Nano
In IDE 1.8.6 you can select version of Nano in Tools menu. It is the 'new' bootloader if you select "Atmega328p" and 'old' if you select "Atmega328p (Old bootloader)". If you invoke "Burn bootloader" it will use the bootloader for the selected option.

48730: <p>I'm trying to add a watchdog on an Arduino Nano, for my code, and I'm following exactly code in <a href="https://tushev.org/articles/arduino/5/arduino-and-watchdog-timer" rel="nofollow noreferrer">this manual</a>, but after the amount of time for not resetting the watchdog- it resets but does not reboot.</p>

<p>At last paragraph- it says that :"</p>

<blockquote>
  <p>However, I could not find something similar in Optiboot bootloader (If
  I'm wrong, correct me please!), used by Arduino UNO and other new
  boards. It seems that they sacrificed this check for size. So, it is
  possible that watchdog timer will be enabled after reset, so -  if you
  set it's value too low, your board may never come out of bootloader
  stage. So, to be always on the safe side, set watchdog to longer
  periods (2S and more).</p>
</blockquote>

<p>So I've tried for 8s, but still same result.</p>

<p>What is wrong ?</p>

<blockquote>
  <p>EDIT1:</p>
</blockquote>

<pre><code>#include &lt;avr/wdt.h&gt;
int k=1;
void setup() {
  Serial.begin(9600);
  wdt_enable(WDTO_8S);
}
void loop() {
  //do stuff here
  k++;
  wdt_reset();
  Serial.println(1000 * k);
  delay(1000 * k);

}
</code></pre>
 37622: <p>the "old" Nano bootloader doesn't clear the Watchdog flag and while the bootloader waits for the upload, the board resets.</p>

<p>flash the "new" bootloader to Nano</p>

<p>In IDE 1.8.6 you can select version of Nano in Tools menu. It is the 'new' bootloader if you select "Atmega328p" and 'old' if you select "Atmega328p (Old bootloader)". If you invoke "Burn bootloader" it will use the bootloader for the selected option.</p>
