Arduino UNO upload ok, mega2560 no work


#1

Hello,
i try first time platformio and i installed with Atom.

if i start a new project and i connect a arduino Uno on Com-Port (USB) then upload works fine.
if i start newe Project with mega2560 board and i try to upload then i get some error messages and upload no work
c:/users/xxxxx/.platformio/packages/toolchain-atmelavr/bin/…/lib/gcc/avr/5.4.0/…/…/…/…/avr/bin/ld.exe: cannot open output file .pioenvs\megaatmega2560\firmware.elf: No such

file or directory

collect2.exe: error: ld returned 1 exit status

what i can do?

best regards
Achim

i try now again and get this errors

Configuring upload protocol…

AVAILABLE: wiring

CURRENT: upload_protocol = wiring

Looking for upload port…

Use manually specified: COM10

Uploading .pioenvs\megaatmega2560\firmware.hex

avrdude: ser_open(): can’t open device “\.\COM10”: Das System kann die angegebene Datei nicht finden.

avrdude: ser_drain(): read error: Das Handle ist ung�ltig.

avrdude: ser_send(): write error: sorry no info avail

avrdude: stk500_send(): failed to send command to serial port

avrdude: ser_recv(): read error: Das Handle ist ung�ltig.

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: ser_send(): write error: sorry no info avail

avrdude: stk500_send(): failed to send command to serial port

avrdude: ser_recv(): read error: Das Handle ist ung�ltig.

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: ser_send(): write error: sorry no info avail

avrdude: stk500_send(): failed to send command to serial port

avrdude: ser_recv(): read error: Das Handle ist ung�ltig.

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: ser_send(): write error: sorry no info avail

avrdude: stk500_send(): failed to send command to serial port

avrdude: ser_recv(): read error: Das Handle ist ung�ltig.

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: ser_send(): write error: sorry no info avail

avrdude: stk500_send(): failed to send command to serial port

avrdude: ser_recv(): read error: Das Handle ist ung�ltig.

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: ser_send(): write error: sorry no info avail

avrdude: stk500_send(): failed to send command to serial port

avrdude: ser_recv(): read error: Das Handle ist ung�ltig.

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: stk500v2_getsync(): timeout communicating with programmer

avrdude done. Thank you.

*** [upload] Error 1

[ERROR] Took 3.51 seconds

  • Linter

Severity Provider Description Line

  • Git

  • GitHub

Initialize a new project directory with a Git repository

Create repository

My platformio.ini
[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
upload_port = COM10
upload_flags = -P$UPLOAD_PORT

edit 2:
i add now upload_flags
and get this messages

Assembler messages:

Fatal error: can’t create .pioenvs\megaatmega2560\FrameworkArduino\WInterrupts.c.o: No such file or directory

*** [.pioenvs\megaatmega2560\FrameworkArduino\WInterrupts.c.o] Error 1

Assembler messages:

Fatal error: can’t create .pioenvs\megaatmega2560\FrameworkArduino\WMath.cpp.o: No such file or directory

*** [.pioenvs\megaatmega2560\FrameworkArduino\WMath.cpp.o] Error 1

Assembler messages:

Fatal error: can’t create .pioenvs\megaatmega2560\FrameworkArduino\abi.cpp.o: No such file or directory

*** [.pioenvs\megaatmega2560\FrameworkArduino\abi.cpp.o] Error 1

Assembler messages:

Fatal error: can’t create .pioenvs\megaatmega2560\FrameworkArduino\WString.cpp.o: No such file or directory

*** [.pioenvs\megaatmega2560\FrameworkArduino\WString.cpp.o] Error 1


Upload Problem Platformio
#2

Do you manually specify COM10 as your upload interface in the platformio.ini? Is it still the correct port?


#3

First
thanks for help

yes i try to write the port-number in my platformio.ini
like that

[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
upload_port = COM10
upload_flags = -P$UPLOAD_PORT

if is a problem when Arduino-IDE is open?
if i use this port in arduino-ide then works fine

if i put a arduino-Uno on this port works in platformio also fine
i get only the problems with the mega2560 board

and in the UNO-platformio.ini is that

[env:uno]
platform = atmelavr
board = uno
framework = arduino

no port, no any other… and this works fine

edit:2

now i try other project with default platformio.ini
and now works

[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino

what i can do in feature if i get this problem again?
can i check on command-line some connections to COM-Port or any other?

little problem again:

wher i can add some library?
i get this error
src\main.cpp:2:34: fatal error: cactus_io_BME280_I2C.h: No such file or directory

the cactus_io_BME280_I2C.h lib i can’t find in your lib registry


#4

I think it is more likely the com port is busy. Do you have the monitor open in the arduino ide? Do you have an app open to the com port?


#5

Hello,
Ardino IDE is open but the seriel monitor there is closed.
in don#t have any other app but maybe you have right because in arduino IDE i have had sometimes problems with my com-port if i connect USB new on any arduino… maybe thats the problem in my computer.
Otherrwise i wonder because i do this steps

  1. i test a sketch with arduino ide and load up to arduino board (this works)
  2. i close there the seriel monitor
  3. i go to platformio and try to load up any sketch (this no works)

now i not find any reason why platformio now can upload and sometimes not


#6

Another thought would be to not specify the com port. For authentic uno and mega, platformio is able to find it. Good 3rd party can also be automatically found.

Not specifying the com port may simplify things enough to find your real problem.


#7

Thanks a lot
now runs good all