10

Update: I started playing with a genuine Deumilanove and exactly same problem happened to it - d13 led blinking, but avrdude says stk500_recv(): programmer is not responding

I uploaded a largish sketch ~15kb to Arduino Nano v3.0 (clone) and that left the board in an unusable state. When connected to USB, a power LED goes on immediately and 1-2 seconds later the yellow "L" starts blinking really fast. Here's the board I use, it's a cheap clone, but it worked really well before today.

Now, when I try to upload a new sketch I get an error:

avrdude: stk500_recv(): programmer is not responding

I tried making and ISP programmer out of genuine Duemilanove, using nano's ISP pins and tried following official instructions (didn't use any capacitors/resistors). Either way when I click "Burn Bootloader" result is the same error:

avrdude: stk500_getsync(): not in sync: resp=0x15

I have connected "debug" leds to D7,8,9 and heartbeat fades in and out in idle, others stay dark. When I click "Burn Bootloader" all leds go dark then it does few quick blinks on 7, then similar pattern for 8, and then heartbeat resumes. Sometimes this sequence is repeated twice.

I also tried editing preferences.txt to bypass bootloader, but that didn't help.

How do I restore this board or do a low level reset? It seems to be in some failure mode, with pin 13 oscillating, but I don't know what that means.

Boycott Russia
  • 311
  • 1
  • 2
  • 9

4 Answers4

11

I successfully restored both boards using the reset button:

  1. Power off the board (I disconnected the USB cable from computer)
  2. Press and hold the reset button
  3. Connect USB cable (keep holding the reset button)
  4. Click "Upload Sketch"
  5. Wait a second or two until Arduino software says "Uploading..." in the status bar
  6. Release the reset button

Use these steps to upload any small sketch, Blink example is a good choice.

Boycott Russia
  • 311
  • 1
  • 2
  • 9
1

Use "upload.verbose=true" in the preferences.txt of the Arduino IDE (File->preferences-> Click on the file), this helps you to find the right moment to release the reset button (Step 5 of Paul's method).

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
.
.
         Using Port                    : COM19
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
release here ^^^^
1

Try changing processor type to ATmega328(old bootloader) in Tools->Processor. My Nano board blinked led like it had bootloader but I couldn't upload sketch and that helped.

1

There is bug related to watchdog in original old Arduino bootloader. You can switch to different bootloader, e.g. "Optiboot".

Explanation of issue from ATmega48A/PA/88A/PA/168A/PA/328/P datasheet, section 10.10.5 Watchdog Timer, page 48:

If the Watchdog is accidentally enabled, for example by a runaway pointer or brown-out condition, the device will be reset and the Watchdog Timer will stay enabled. If the code is not set up to handle the Watchdog, this might lead to an eternal loop of time-out resets. To avoid this situation, the application software should always clear the Watchdog System Reset Flag (WDRF) and the WDE control bit in the initialization routine, even if the Watchdog is not in use.

Reset from button is not helping, only power off/on reset give device change to boot again (and flash new software). Explanation of this, from 11.9.1 MCUSR – MCU Status Register, page 54:

Bit 3 – WDRF: Watchdog System Reset Flag This bit is set if a Watchdog System Reset occurs. The bit is reset by a Power-on Reset, or by writing a logic zero to the flag.

Greenonline
  • 3,152
  • 7
  • 36
  • 48
niziak
  • 11
  • 1