Problem verifying/uploading through command line with arduino --verify --upload


I am trying to verify/upload to a Mega 2560 from command line executing

./arduino --verify --board "arduino:avr:mega" ./examples/01.Basics/Blink/Blink.ino

but I get the following error

avr-g++: error: missing device or architecture after '-mmcu=' .

Any help?

Is there a list of the --board parameter boards?



You need to specify the complete fqbn (fully qualified board name). The easiest way to find this is to:

  • (in the Arduino IDE) File > Preferences > Show verbose output during: > compilation (check) > OK
  • Sketch > Verify/compile
  • After the compilation finishes, scroll all the way to the top of the black console window at the bottom of the Arduino IDE window. As part of the first line you will see something that looks like this:

So in this example your fqbn to use with the --board option of Arduino CLI is arduino:avr:mega:cpu=atmega2560. Thus the correct command would be:

./arduino --verify --board "arduino:avr:mega:cpu=atmega2560" ./examples/01.Basics/Blink/Blink.ino