Skip to main content

Avoiding hangups

Problem description

We see that the smart SOC boards can 'hang up' either by themselves, or if touched inappropriately. If the factory boot loader is installed, you see that the LED blinks super quickly when a hangup happens. If there is no bootloader, it can still hang up, but then there is no visible signal of it.

This issue concerns all Pro Mini boards, all 328p(b) based designs. Everything we have done up to now.

Root cause

If for whatever reason the watchdog resets the microcontroller, the factory bootloader locks itself into an infinite restart loop. This is a known issue that was fixed for the Arduino Uno, but not yet for the Pro Mini series.

Solution: custom Optiboot bootloader

Navigate to:

Arduino/Content/Java/hardware/arduino/avr

Open the board.txt and find the line starting:

pro.menu.cpu.8MHzatmega328.bootloader.file

The correct value is:

pro.menu.cpu.8MHzatmega328.bootloader.file=optiboot/optiboot_atmega328_pro_8MHz_56k.hex

Save it.

Now navigate further down to bootloaders/optiboot and copy in there this file:

optiboot_atmega328_pro_8MHz_56k.hex

Restart the Arduino IDE, and burn the bootloader. Problem solved.

Solution when not using bootloader

The setup function must start exactly like this:

#include <avr/wdt.h>

void setup() {
  MCUSR = 0;
  wdt_disable();