Upload to nano gives "avrdude: stk500_recv(): programmer is not responding"

Environment:

  • Mac (macOS Catalina 10.15.2)
  • Visual Studio Code with latest platformio plugin
  • board: Nano clone

My platformio.ini:

[env:nanoatmega328]
platform = atmelavr
board = nanoatmega328new
framework = Arduino
monitor_speed = 115200

When I try to flash my newly arrived Arduino Nano boards I get (verbose is on):

building .pio/build/nanoatmega328/firmware.hex
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
DATA:    [====      ]  39.7% (used 814 bytes from 2048 bytes)
PROGRAM: [==========]  96.4% (used 29614 bytes from 30720 bytes)
Configuring upload protocol...
AVAILABLE: arduino
CURRENT: upload_protocol = arduino
Looking for upload port...
Auto-detected: /dev/cu.usbserial-14640
Uploading .pio/build/nanoatmega328/firmware.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file ".pio/build/nanoatmega328/firmware.hex"
avrdude: writing flash (29614 bytes):

Writing | ################################################avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding

As you can see, the sync works at the beginning and the writing #### also
only at the end of the ## the avrdude… error pops up.

If I just flash the blink sketch it works but If I flash my design it fails
The code I am flashing is quite big 96.4% used, could that be the issue?
However It does flash correctly on other brand of (clone) nano.

I have tried the following stuff already:

  • board = nanotmega328 (so not the new one)

Any help is appreciated (otherwise I guess the 5 nano’s I bought are for the trash…)

I just commented a bunch of code out so that the PROGMEM was only 76% used (and not 96%) and now it uploads! What is going on? it should work even at 96% as this is not full no?

For Flash yes, since it’s completely static over the runtime of the program.

Starting here the bootloader burned into the Nano seems to stop responding. The bootloader is responsible for writing the firmware from UART / COM port into the flash. It may have some weird or old bootloader on it though which doesn’t allow for the maximum size. It should only allocate the first 2KB of flash for itself, leaving 30 of the 32KB flash for the user (Arduino Nano ATmega328P bootloader difference - Arduino Stack Exchange). I’ll try to see when the bootloader fails with my older Arduino Nano clone.

I will try to burn a new bootloader using the Arduino ide. I could not find a way to get any sort of version from the installed bootloader.
But I will see if it has the WDT reset issue (then it would be an old one). Never burned a new one before… fingers crossed :slight_smile:

1 Like

I burned a new bootloader on the nano (using Arduino IDE + Arduino as ISP cfr Arduino - bootloader Upgrade - StudioPieters® I did have to use a cap of 1uF and not 10-100uF as the article said for the RESET pin).

I can now successfully flash the nano with my big 96% PROGMEM sketch.
I guess it must have been some strange bootloader that was installed on the Nano clones!

1 Like

Unfortunately the firmware flashed (using the Arduino IDE) is the “old” one which has the watchdog bug (keeps resetting once watchdog is triggered). Any idea where I can find the new nano bootloader?

Turns out I was wrong regarding the old bootloader.
If in the Arduino IDE you select :

Tools -> Processor -> ATMega328P : it burns the new bootloader
Tools -> Processor -> ATMega328P (Old bootloader) : you guessed it, then it burns the old one

Case closed!

1 Like

It seams the old bootloader is able to flash the 96% PROGMEM (but then the WDT is not working) and the new bootloader not!