arduino / arduino/ArduinoCore-avr

ProMini: Reboot loop when using watchdog

Open
#150 25 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
1.5k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Hi there,

i have the following problem:

I have an arduino sketch which accept some configuration-details over the serial connection. After applying some configuration, a "reboot" is required. On my leonardo and micro boards, this works quite well by using the watchdog to reset the board:

``` c++
wdt_enable( WDTO_1S );
while(1) {}
```

But with an arduino pro mini at 3,3V/8Mhz the board loops in a restart-loop, forever.
It seems that this issue is already known on the net:

https://andreasrohner.at/posts/Electronics/How-to-make-the-Watchdog-Timer-work-on-an-Arduino-Pro-Mini-by-replacing-the-bootloader/

I know that there are othr techniques to "reboot" an arduino, but the WDT seems to be the only real hardware reboot, triggered by software.

Of course I can use the optiboot bootloader to overcome this issue. But this adds some additional complexity and arduino ide tweaking-skills, which I would like to avoid (there are other people using my sketches/libraries which won't be able to tweak the arduino ide properly).

Would it be possible to fix this in Arduino IDE directly? For example by switching to optiboot by default or fix the "bug" in the current used bootloader?!

### Additional context

#### Additional reports

- https://github.com/arduino/ArduinoCore-avr/issues/150#issuecomment-392363065
- https://github.com/arduino/Arduino/issues/6228
- https://arduino.stackexchange.com/questions/2922/watchdog-timer-stuck-in-restart-loop-green-led-flashing/45281

---

Keywords

- "Arduino Nano bootloop watchdog timer"

Contributor guide

No contributing guide indexed for this repository

Research direction

No repository file or test is named. Start by reproducing the watchdog reset with the provided sketch on an Arduino Pro Mini at 3.3V/8MHz, then inspect the current bootloader behavior and compare it with the referenced optiboot approach. Done means the board performs one software-triggered watchdog reboot without entering a restart loop or requiring Arduino IDE configuration changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, cpp
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.