Megaatmega1280 *** [upload] Error 1

Hello,

I am having trouble to upload to a megaatmega1280 target. The code compiles successfully, but it can not be uploaded. I just tried to upload the same code using Arduino IDE and worked fine. The same occurred on a PC running Ubuntu 14.04 and on a Mac running Mac OS X Sierra. Here follows the error message.

Linking .pioenvs/megaatmega1280/firmware.elf
Checking program size
text data bss dec hex filename
1892 44 166 2102 836 .pioenvs/megaatmega1280/firmware.elf
Building .pioenvs/megaatmega1280/firmware.hex
Looking for upload port…
Use manually specified: /dev/tty.usbserial-A600ecwl
Uploading .pioenvs/megaatmega1280/firmware.hex
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x73
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x74
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x61
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x72
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x74
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x0a
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x65
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x63
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x68
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x6f

avrdude done. Thank you.

*** [upload] Error 1
=============================== [ERROR] Took 6.26 seconds =============================

Thank you very much.

Hello,

I forgot to say I am using Platformio Core on Shell. I just tried the same code on the Atom IDE and worked fine. But I still need to use it on Shell because I have to program and debug targets on remote PCs, so shell is more convenient.

Thanks.

Do you mean that it works from Shell?

Exactly. I was trying to upload to an Arduino board using the command “platformio run --target upload” when I got these error messages. From Arduino IDE or Platformio IDE on Atom the upload works fine.

Thank you.

It looks that you have multiple PIO Cores in a system. As you have mentioned above, if you use PIO IDE it works well because PIO IDE uses built-in latest PIO Core.

Nevertheless, if you use custom Shell/Terminal it doesn’t work. You can check PIO Core version via pio --version.