NANO 328p boot loader

I received a bunch of nanos last week and used them on platformio, no issues.

I then needed to use Arduino IDE 1.8.5 and compiled something but could not upload it. Being a 3rd party nano, I used my USBtinyISP and put the stock bootloader on it. Worked like a charm. Uploaded several times.

Went back to PlatformIO and it would not do an upload to that board any more.

I sacrificed another board with the same results.

The boards still work fine with the Arduino IDE.

PlatformIO core 3.5.3a
Windows 10/64,Windows 7/32


Updating tool-scons                      @ 2.20501.4      [Up-to-date]
Updating tool-unity                      @ 1.20403.0      [Up-to-date]
Updating contrib-pysite                  @ 0.2.0          [Up-to-date]
Updating contrib-piohome                 @ 0.9.5          [Up-to-date]
Updating tool-pioplus                    @ 1.1.7          [Up-to-date]

Platform Manager
================
Platform Atmel AVR
--------
Updating atmelavr                        @ 1.8.2          [Up-to-date]
Updating toolchain-atmelavr              @ 1.40902.1      [Up-to-date]
Updating framework-arduinoavr            @ 1.10620.2      [Up-to-date]
Updating tool-avrdude                    @ 1.60300.2      [Up-to-date]

Platform Atmel SAM
--------
Updating atmelsam                        @ 3.1.0          [Up-to-date]
Updating framework-arduinosam            @ 2.10618.1      [Up-to-date]
Updating framework-mbed                  @ 4.151.0        [Up-to-date]
Updating toolchain-gccarmnoneeabi        @ 1.40804.0      [Up-to-date]
Updating tool-avrdude                    @ 1.60300.2      [Up-to-date]
Updating tool-bossac                     @ 1.10700.0      [Up-to-date]

Platform Espressif 8266
--------
Updating espressif8266                   @ 1.6.0          [Up-to-date]
Updating tool-mkspiffs                   @ 1.200.0        [Up-to-date]
Updating tool-esptool                    @ 1.409.0        [Up-to-date]
Updating tool-espotapy                   @ 1.1.0          [Up-to-date]
Updating framework-arduinoespressif8266  @ 1.20400.3      [Up-to-date]
Updating toolchain-xtensa                @ 1.40802.0      [Up-to-date]

Platform ST STM32
--------
Updating ststm32                         @ 4.2.0          [Up-to-date]
Updating framework-mbed                  @ 4.50802.0      [Up-to-date]
Updating framework-arduinoststm32        @ 2.1.180219     [Up-to-date]
Updating toolchain-gccarmnoneeabi        @ 1.70201.0      [Up-to-date]

I have no issues with any other boards.

Here is the output of the attempted upload.

Configuring upload protocol...
AVAILABLE: arduino
CURRENT: upload_protocol = arduino
Looking for upload port...
Use manually specified: com3
Uploading .pioenvs\nano328\firmware.hex
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x54
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x54
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x54
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x54
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x54
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x54
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x54
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x54
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x54
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x54

avrdude done.  Thank you.

*** [upload] Error 1

anyone even looking into this?

Activate verbose output by executing pio settings set force_verbose Yes and re-upload. You should see the avrdude command and the used config file. Activate verbosity in the Arduino IDE to see what config file it uses. Compare the two.

Just say that you’re using a Uno instead.
The “new” bootloader that comes with Arduino IDE is incompatible with the old one.

Do the same if you are using MiniCore in your Nano (GitHub - MCUdude/MiniCore: Arduino hardware package for ATmega8, ATmega48, ATmega88, ATmega168, ATmega328 and ATmega328PB)… This works, I still don’t know if it’s possible to add MiniCore to platform io.

[env:blink1]
platform = atmelavr
board = uno
framework = arduino
1 Like

Good suggestion. No success.

Hummmm, I wonder if there is another problem not related to the bootloader.
But, as you say it works ok on Arduino IDE that looks to be the problem.
I was told in the Arduino forum that the “new” Nano bootloader was not a good choice, it was much better to write the Uno bootloader to the Nano, and from then on use the board as a Uno.
An alternative was to use the MiniCore bootloader, I installed it in Arduino IDE and burnt the boot loader with an USBASP v2. When I tried that board on platorm io it didn’t work as a Nano, I tried to change the .ini to uno and it worked immediately.
Or you can burn the “old” Nano bootloader. => Tools/Board: Arduino Nano/Processor: ATmega328p/ATmega328p (old bootloader) then write the bootloader.

Never thought of that one.

No dice. Time to hang around some more tolerant boards for a while.

Same problem. I have some Nanos I can program with Arduino IDE but not Platformio. Is there a fix in the works? Maybe a parameter that needs setting in the platformio.ini file???
:-\

Try telling Platformio your Nano is an Uno. Worked for me.
In platformio.ini; platform=atmelavr, board=uno, framework=-arduino.
:wink: Ian

I have never been given a solution that worked.

In platform.ini, use board = nanoatmega328new

From: Arduino Nano ATmega328 (New Bootloader) — PlatformIO latest documentation

Sorry for the bump but this pops up higher in search rankings than the linked page, and I need to clear up the ‘uno’ abuse above.

2 Likes

Please describe your error. What’s the verbose upload log for you? (pio run -t upload -v). Otherwise we can’t really help you…

I take it you had the same problem (Nano’s not uploading with PIO) and using nanoatmega328new as board type fixed it for you? Meaning the old workaround of using the uno board type with the new bootloader (mentioned above) is no longer needed?

Hey, these settings worked for me

[env:nano]
platform = atmelavr
board = nanoatmega328
framework = arduino
monitor_speed = 115200