Getting a Micro to work with MIDIUSB library

Hello!

I'm trying to revive a project. I have this button and joystick controller that runs on a Micro. I have used it in the past, two different ways. Currently, I have a program written on it that allows me to control my computer as a mouse through HID. I would like to be able to use it as a MIDI USB controller. I have in the past used the MIDI-USB library (by Gary Grewal) to use my controller within Ableton. I went to upload a simple code for analog to midi an then I got this error: 'MIDIUSB can only be used with an USB MCU.'

So I did a little digging and read somewhere that Micro is no longer supported for that library. Then I read that you can alter it as if it were a Genuino and it will write. Genuino is no longer supported on the IDE. I have version 2.X, so I downloaded 1.~8 (I think, whatever last stable version is recommended on the site.) It's not there. Which version would have support?

Moreover, does anyone have any recommendations on any possible method to use my Micro as a MIDI USB device, in general? This is a project from four years ago that I would really love to revive as last painstakingly as possible. I didn't expect this.

I would appreciate any suggestions on a workaround with this library - or another library to try out that is compatible with sending analog to MIDI thru USB.

Thank you!

nonsense. do you notice letter D in word MIDI ? it means Digital. you say what frequency should be played, how loud and how long - MIDI generate this tone for you. or some program like Ableton can store commands with timestamp for placing on playback timeline.

Try the USB-MIDI library from FortySevenEffects. This is under active development.

This library depends on the Arduino MIDI Library and Arduino's MIDIUSB.

When installing this library from the Arduino IDE, both will be downloaded and installed in the same directory as this library.

This might just work straight off the bat. Otherwise you might have to alter the Arduino.h file to include your board.

Are you sure you selected the correct board from the Tools > Board menu?

Where did you see this? Do you have a link?
The MIDIUSB library definitely still supports the ATmega32U4.

This is an unhelpful pedantic response. What I am doing is converting varying electric current into data.

That's a about different library.

This one is unsupported: GitHub - rkistner/arcore: MIDI-USB Support for Arduino
This one is supported: GitHub - arduino-libraries/MIDIUSB: A MIDI library over USB, based on PluggableUSB (this is the one by Gary Grewal)

Yes but just quoting something I wrote in an other thread with other code is not a very good responce to what I posted. Or am I missing something?

Thanks for the suggestion earlier Mike. It's been a busy day and I intend to take a look at what you shared! That was a response to a someone else's comment. It happens to be a quote from you. I seem to have confused two libraries, one with and one without a hyphen, anyhow, NEITHER are working and produce the same error claiming I cannot use this board.

I'm not sure. I have Arduino Micro as the selected board, of course.

I seem to have confused two libraries, one with and one without a hyphen, anyhow, NEITHER are working and produce the same error claiming I cannot use this board when I try and compile an example code.

I'm not sure why this could be. I have Arduino Micro as the selected board, of course.

Are you seeing your board showing up as one of the ports?
Can you upload the blink test program?

I tested out if some of my old stuff worked and I couldn't select the correct port for it. Turns out that my lead has gone faulty. So when I used a new lead things started to happen.

I did try it on a Leonardo because that was the first thing that came to hand. It also conveniently has a reset push button, which the Arduino Micro does not have. However it is simple to fit a temporary one, from the reset pin to ground.

If you double tap the reset button you should see about 8 seconds of the built in LED fade in and out. Do you see that if you double click the reset? This is the board searching for a USB port. This can be used because bad code in a board can screw up the normal working of the board. Try the double click just before the code finishes compiling and before it starts looking for a port to use for the download. You should see this LED fading bit before the code starts to be downloaded anyway.

This code fires random notes at regular intervals. Check out it works by either using the MIDI Monitor App and Garage Band if you have them. You can see it is old code but it still works.

/*
 * MIDIUSB_test.ino
 *
 * Created: 4/6/2015 10:47:08 AM
 * Author: gurbrinder grewal
 * Modified by Arduino LLC (2015)
 */ 

#include "MIDIUSB.h"

// First parameter is the event type (0x09 = note on, 0x08 = note off).
// Second parameter is note-on/note-off, combined with the channel.
// Channel can be anything between 0-15. Typically reported to the user as 1-16.
// Third parameter is the note number (48 = middle C).
// Fourth parameter is the velocity (64 = normal, 127 = fastest).

void noteOn(byte channel, byte pitch, byte velocity) {
  midiEventPacket_t noteOn = {0x09, 0x90 | channel, pitch, velocity};
  MidiUSB.sendMIDI(noteOn);
}

void noteOff(byte channel, byte pitch, byte velocity) {
  midiEventPacket_t noteOff = {0x08, 0x80 | channel, pitch, velocity};
  MidiUSB.sendMIDI(noteOff);
}

void setup() {
  Serial.begin(250000);
  Serial1.begin(250000);
}

// First parameter is the event type (0x0B = control change).
// Second parameter is the event type, combined with the channel.
// Third parameter is the control number number (0-119).
// Fourth parameter is the control value (0-127).

void controlChange(byte channel, byte control, byte value) {
  midiEventPacket_t event = {0x0B, 0xB0 | channel, control, value};
  MidiUSB.sendMIDI(event);
}

void loop() {
    int val;
  val = random(20,100);
    noteOn(0, val, 64);
    MidiUSB.flush();
    delay(100);
    noteOff(0, val, 64);
    MidiUSB.flush();
   delay(800);
   Serial1.println(val);
  // controlChange(0, 10, 65); // Set the value of controller 10 on channel 0 to 65
}

Just to check things I loaded and ran one of my more complex codes that use other libraries. This still loads and runs.

Basically it takes the MIDI output from my WX11 MIDI wind controller and alters it so the breath control affects the volume throughout the duration of the note and not just for the initial blow. It also has switches that add all sorts of things like transposing the notes into different keys, generating triads for a single note, and lots of other stuff. There is also an OLED display in there as well.

Without the schematic the code is useless on its own, but I will just show the start of this code to give you an idea of the libraries involved, and they all still work.

/*
 * MIDI massager for the WX11 transpose x semitones depending on the 
 * settings
 * set up voice for sax in XG format. Other modes in GM 
 * Mike Cook
 * uses MIDI library 5.0.2 on a Micro with output on Serial1 ( midi 5 pin )
 * for OLED display library see https://github.com/olikraus/u8g2/wiki
 */

#include <MIDI.h>
#include <USB-MIDI.h>
#include <Encoder.h>
#include <EEPROM.h>
#include <Wire.h>
#include <U8g2lib.h>
#include <stdio.h>
#include <stdlib.h>
#include "GM_names.h"
#include "Encoder.h"

Thanks for the replies Mike. So, I'm not having any trouble uploading code to my microprocessor. I have the correct board selected. I can upload any code successfully, and even use the controller as an HID device, however when I try to use the library it claims that my board is not a USB MCU - very confusing.

It is.
Check that the version of the MIDIUSB is the latest which is 1.0.5.

I dragged out an actual Arduino Micro Which compiled and run the code perfectly. Note it shows Arduino Micro as the source of the code.
This is a screen Dump From MIDI Monitor which shows it running.

Also what IDE are you running. I am using 1.8.19, maybe you are running something different?

Hey Mike,

Happy new year. Hope you had good holidays. I'm finally back troubleshooting this problem. Thanks for the helpful replies earlier. I would like to explain more explicitly the problem I am encountering that I cannot solve.

I am trying to compile code that uses the library MIDIUSB (version 1.0.5.) I using Arduino IDE version 2.1.1 - but I have also tested this out on the original Arduino IDE latest version 1.8.18, and I get the same results.

Here is a screenshot from the error on serial monitor on 2.1.1.

As you can see the board selected is Arduino Micro.

What's strange about this issue is this:

  1. I can successfully use this microcontroller as an HID through USB with another code that gives me mouse control. This is as expected. I can switch sketches with the same hardware and board and port selections in the IDE, and then get an error claiming the processor is not USB MCU!
  2. I have tested the compilation of the MISIUSB write example sketch above to another Micro which is not included in my current circuit build that I had lying around. When I tested it, it also came with the same error. These two boards are from the same generic Pro Micro ATmega32U4 build same purchase order earlier this year. https://a.co/d/a94cJk7

I have used these generic boards in the past build of this USB MIDI controller project.

Hopefully that gives you a better idea. I feel stuck on this. It just doesn't make sense, and I don't know what troubleshooting angle to take now besides purchasing a brand device and re-soldering this entire protoboard... I would really hope not to.

Hopefully you understand my problem better now. This is why I hit the forum boards for the first time. Thanks for all the communication so far, earlier in November!

Do you have any more ideas on this?

Please enable verbose output during compilation in the IDE preferences, click verify, and post the full output (between code fences).

Here is verbose output copy and paste:

FQBN: arduino:avr:micro
Using board 'micro' from platform in folder: /Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6
Using core 'arduino' from platform in folder: /Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6

Detecting libraries used...
/Users/avi/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MICRO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8037 "-DUSB_MANUFACTURER=\"Unknown\"" "-DUSB_PRODUCT=\"Arduino Micro\"" -I/Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/micro /private/var/folders/0j/7b000wx91g1bcxv2pyr1j1l00000gn/T/arduino/sketches/D1B9AC025FF32311BDBF2E3621B3075B/sketch/MIDIUSB_write.ino.cpp -o /dev/null
Alternatives for MIDIUSB.h: [MIDIUSB@1.0.5]
ResolveLibrary(MIDIUSB.h)
  -> candidates: [MIDIUSB@1.0.5]
/Users/avi/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MICRO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8037 "-DUSB_MANUFACTURER=\"Unknown\"" "-DUSB_PRODUCT=\"Arduino Micro\"" -I/Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/micro -I/Users/avi/Documents/Arduino/libraries/MIDIUSB/src /private/var/folders/0j/7b000wx91g1bcxv2pyr1j1l00000gn/T/arduino/sketches/D1B9AC025FF32311BDBF2E3621B3075B/sketch/MIDIUSB_write.ino.cpp -o /dev/null
Error while detecting libraries included by /private/var/folders/0j/7b000wx91g1bcxv2pyr1j1l00000gn/T/arduino/sketches/D1B9AC025FF32311BDBF2E3621B3075B/sketch/MIDIUSB_write.ino.cpp
/Users/avi/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MICRO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8037 "-DUSB_MANUFACTURER=\"Unknown\"" "-DUSB_PRODUCT=\"Arduino Micro\"" -I/Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/micro -I/Users/avi/Documents/Arduino/libraries/MIDIUSB/src /Users/avi/Documents/Arduino/libraries/MIDIUSB/src/MIDIUSB.cpp -o /dev/null
Error while detecting libraries included by /Users/avi/Documents/Arduino/libraries/MIDIUSB/src/MIDIUSB.cpp
Generating function prototypes...
/Users/avi/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MICRO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8037 "-DUSB_MANUFACTURER=\"Unknown\"" "-DUSB_PRODUCT=\"Arduino Micro\"" -I/Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/micro -I/Users/avi/Documents/Arduino/libraries/MIDIUSB/src /private/var/folders/0j/7b000wx91g1bcxv2pyr1j1l00000gn/T/arduino/sketches/D1B9AC025FF32311BDBF2E3621B3075B/sketch/MIDIUSB_write.ino.cpp -o /private/var/folders/0j/7b000wx91g1bcxv2pyr1j1l00000gn/T/arduino/sketches/D1B9AC025FF32311BDBF2E3621B3075B/preproc/ctags_target_for_gcc_minus_e.cpp
In file included from /Users/avi/Documents/Arduino/MIDIUSB-master/examples/MIDIUSB_write/MIDIUSB_write.ino:9:0:
/Users/avi/Documents/Arduino/libraries/MIDIUSB/src/MIDIUSB.h:18:2: error: #error MIDIUSB can only be used with an USB MCU.
 #error MIDIUSB can only be used with an USB MCU.
  ^~~~~

Using library MIDIUSB at version 1.0.5 in folder: /Users/avi/Documents/Arduino/libraries/MIDIUSB 
exit status 1

Compilation error: exit status 1

Something fishy is going on with your Arduino core installation. Can you post the contents of the boards.txt and platform.txt files in /Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6? Did you modify those files?

I've never even navigated the IDE application library. I took a look. Here are the two files you were curious about:

boards.txt

# See: https://arduino.github.io/arduino-cli/latest/platform-specification/

menu.cpu=Processor

##############################################################

yun.name=Arduino Yún
yun.upload.via_ssh=true

yun.vid.0=0x2341
yun.pid.0=0x0041
yun.vid.1=0x2341
yun.pid.1=0x8041
yun.vid.2=0x2A03
yun.pid.2=0x0041
yun.vid.3=0x2A03
yun.pid.3=0x8041
yun.upload_port.0.vid=0x2341
yun.upload_port.0.pid=0x0041
yun.upload_port.1.vid=0x2341
yun.upload_port.1.pid=0x8041
yun.upload_port.2.vid=0x2A03
yun.upload_port.2.pid=0x0041
yun.upload_port.3.vid=0x2A03
yun.upload_port.3.pid=0x8041
yun.upload_port.4.board=yun

yun.upload.tool=avrdude
yun.upload.tool.default=avrdude
yun.upload.tool.network=arduino_ota
yun.upload.protocol=avr109
yun.upload.maximum_size=28672
yun.upload.maximum_data_size=2560
yun.upload.speed=57600
yun.upload.disable_flushing=true
yun.upload.use_1200bps_touch=true
yun.upload.wait_for_upload_port=true

yun.bootloader.tool=avrdude
yun.bootloader.tool.default=avrdude
yun.bootloader.low_fuses=0xff
yun.bootloader.high_fuses=0xd8
yun.bootloader.extended_fuses=0xfb
yun.bootloader.file=caterina/Caterina-Yun.hex
yun.bootloader.noblink=caterina/Caterina-Yun-noblink.hex
yun.bootloader.unlock_bits=0x3F
yun.bootloader.lock_bits=0x2F

yun.build.mcu=atmega32u4
yun.build.f_cpu=16000000L
yun.build.vid=0x2341
yun.build.pid=0x8041
yun.build.usb_product="Arduino Yun"
yun.build.board=AVR_YUN
yun.build.core=arduino
yun.build.variant=yun
yun.build.extra_flags={build.usb_flags}

##############################################################

uno.name=Arduino Uno

uno.vid.0=0x2341
uno.pid.0=0x0043
uno.vid.1=0x2341
uno.pid.1=0x0001
uno.vid.2=0x2A03
uno.pid.2=0x0043
uno.vid.3=0x2341
uno.pid.3=0x0243
uno.vid.4=0x2341
uno.pid.4=0x006A
uno.upload_port.0.vid=0x2341
uno.upload_port.0.pid=0x0043
uno.upload_port.1.vid=0x2341
uno.upload_port.1.pid=0x0001
uno.upload_port.2.vid=0x2A03
uno.upload_port.2.pid=0x0043
uno.upload_port.3.vid=0x2341
uno.upload_port.3.pid=0x0243
uno.upload_port.4.vid=0x2341
uno.upload_port.4.pid=0x006A
uno.upload_port.5.board=uno

uno.upload.tool=avrdude
uno.upload.tool.default=avrdude
uno.upload.tool.network=arduino_ota
uno.upload.protocol=arduino
uno.upload.maximum_size=32256
uno.upload.maximum_data_size=2048
uno.upload.speed=115200

uno.bootloader.tool=avrdude
uno.bootloader.tool.default=avrdude
uno.bootloader.low_fuses=0xFF
uno.bootloader.high_fuses=0xDE
uno.bootloader.extended_fuses=0xFD
uno.bootloader.unlock_bits=0x3F
uno.bootloader.lock_bits=0x0F
uno.bootloader.file=optiboot/optiboot_atmega328.hex

uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.board=AVR_UNO
uno.build.core=arduino
uno.build.variant=standard

##############################################################

unomini.name=Arduino Uno Mini

unomini.vid.0=0x2341
unomini.pid.0=0x0062
unomini.upload_port.0.vid=0x2341
unomini.upload_port.0.pid=0x0062
unomini.upload_port.4.board=unomini

unomini.upload.tool=avrdude
unomini.upload.tool.default=avrdude
unomini.upload.tool.network=arduino_ota
unomini.upload.protocol=arduino
unomini.upload.maximum_size=32256
unomini.upload.maximum_data_size=2048
unomini.upload.speed=115200

unomini.bootloader.tool=avrdude
unomini.bootloader.tool.default=avrdude
unomini.bootloader.low_fuses=0xFF
unomini.bootloader.high_fuses=0xDE
unomini.bootloader.extended_fuses=0xFD
unomini.bootloader.unlock_bits=0x3F
unomini.bootloader.lock_bits=0x0F
unomini.bootloader.file=optiboot/optiboot_atmega328.hex

unomini.build.mcu=atmega328p
unomini.build.f_cpu=16000000L
unomini.build.board=AVR_UNO
unomini.build.core=arduino
unomini.build.variant=standard

##############################################################

diecimila.name=Arduino Duemilanove or Diecimila

diecimila.upload_port.0.board=diecimila

diecimila.upload.tool=avrdude
diecimila.upload.tool.default=avrdude
diecimila.upload.tool.network=arduino_ota
diecimila.upload.protocol=arduino

diecimila.bootloader.tool=avrdude
diecimila.bootloader.tool.default=avrdude
diecimila.bootloader.low_fuses=0xFF
diecimila.bootloader.unlock_bits=0x3F
diecimila.bootloader.lock_bits=0x0F

diecimila.build.f_cpu=16000000L
diecimila.build.board=AVR_DUEMILANOVE
diecimila.build.core=arduino
diecimila.build.variant=standard

## Arduino Duemilanove or Diecimila w/ ATmega328P
## ----------------------------------------------
diecimila.menu.cpu.atmega328=ATmega328P

diecimila.menu.cpu.atmega328.upload.maximum_size=30720
diecimila.menu.cpu.atmega328.upload.maximum_data_size=2048
diecimila.menu.cpu.atmega328.upload.speed=57600

diecimila.menu.cpu.atmega328.bootloader.high_fuses=0xDA
diecimila.menu.cpu.atmega328.bootloader.extended_fuses=0xFD
diecimila.menu.cpu.atmega328.bootloader.file=atmega/ATmegaBOOT_168_atmega328.hex

diecimila.menu.cpu.atmega328.build.mcu=atmega328p

## Arduino Duemilanove or Diecimila w/ ATmega168
## ---------------------------------------------
diecimila.menu.cpu.atmega168=ATmega168

diecimila.menu.cpu.atmega168.upload.maximum_size=14336
diecimila.menu.cpu.atmega168.upload.maximum_data_size=1024
diecimila.menu.cpu.atmega168.upload.speed=19200

diecimila.menu.cpu.atmega168.bootloader.high_fuses=0xdd
diecimila.menu.cpu.atmega168.bootloader.extended_fuses=0xF8
diecimila.menu.cpu.atmega168.bootloader.file=atmega/ATmegaBOOT_168_diecimila.hex

diecimila.menu.cpu.atmega168.build.mcu=atmega168

##############################################################

nano.name=Arduino Nano

nano.upload_port.0.board=nano

nano.upload.tool=avrdude
nano.upload.tool.default=avrdude
nano.upload.tool.network=arduino_ota
nano.upload.protocol=arduino

nano.bootloader.tool=avrdude
nano.bootloader.tool.default=avrdude
nano.bootloader.unlock_bits=0x3F
nano.bootloader.lock_bits=0x0F

nano.build.f_cpu=16000000L
nano.build.board=AVR_NANO
nano.build.core=arduino
nano.build.variant=eightanaloginputs

## Arduino Nano w/ ATmega328P
## --------------------------
nano.menu.cpu.atmega328=ATmega328P

nano.menu.cpu.atmega328.upload.maximum_size=30720
nano.menu.cpu.atmega328.upload.maximum_data_size=2048
nano.menu.cpu.atmega328.upload.speed=115200

nano.menu.cpu.atmega328.bootloader.low_fuses=0xFF
nano.menu.cpu.atmega328.bootloader.high_fuses=0xDA
nano.menu.cpu.atmega328.bootloader.extended_fuses=0xFD
nano.menu.cpu.atmega328.bootloader.file=optiboot/optiboot_atmega328.hex

nano.menu.cpu.atmega328.build.mcu=atmega328p

## Arduino Nano w/ ATmega328P (old bootloader)
## --------------------------
nano.menu.cpu.atmega328old=ATmega328P (Old Bootloader)

nano.menu.cpu.atmega328old.upload.maximum_size=30720
nano.menu.cpu.atmega328old.upload.maximum_data_size=2048
nano.menu.cpu.atmega328old.upload.speed=57600

nano.menu.cpu.atmega328old.bootloader.low_fuses=0xFF
nano.menu.cpu.atmega328old.bootloader.high_fuses=0xDA
nano.menu.cpu.atmega328old.bootloader.extended_fuses=0xFD
nano.menu.cpu.atmega328old.bootloader.file=atmega/ATmegaBOOT_168_atmega328.hex

nano.menu.cpu.atmega328old.build.mcu=atmega328p

## Arduino Nano w/ ATmega168
## -------------------------
nano.menu.cpu.atmega168=ATmega168

nano.menu.cpu.atmega168.upload.maximum_size=14336
nano.menu.cpu.atmega168.upload.maximum_data_size=1024
nano.menu.cpu.atmega168.upload.speed=19200

nano.menu.cpu.atmega168.bootloader.low_fuses=0xff
nano.menu.cpu.atmega168.bootloader.high_fuses=0xdd
nano.menu.cpu.atmega168.bootloader.extended_fuses=0xF8
nano.menu.cpu.atmega168.bootloader.file=atmega/ATmegaBOOT_168_diecimila.hex

nano.menu.cpu.atmega168.build.mcu=atmega168

##############################################################

mega.name=Arduino Mega or Mega 2560

mega.vid.0=0x2341
mega.pid.0=0x0010
mega.vid.1=0x2341
mega.pid.1=0x0042
mega.vid.2=0x2A03
mega.pid.2=0x0010
mega.vid.3=0x2A03
mega.pid.3=0x0042
mega.vid.4=0x2341
mega.pid.4=0x0210
mega.vid.5=0x2341
mega.pid.5=0x0242
mega.upload_port.0.vid=0x2341
mega.upload_port.0.pid=0x0010
mega.upload_port.1.vid=0x2341
mega.upload_port.1.pid=0x0042
mega.upload_port.2.vid=0x2A03
mega.upload_port.2.pid=0x0010
mega.upload_port.3.vid=0x2A03
mega.upload_port.3.pid=0x0042
mega.upload_port.4.vid=0x2341
mega.upload_port.4.pid=0x0210
mega.upload_port.5.vid=0x2341
mega.upload_port.5.pid=0x0242
mega.upload_port.6.board=mega

mega.upload.tool=avrdude
mega.upload.tool.default=avrdude
mega.upload.tool.network=arduino_ota
mega.upload.maximum_data_size=8192

mega.bootloader.tool=avrdude
mega.bootloader.tool.default=avrdude
mega.bootloader.low_fuses=0xFF
mega.bootloader.unlock_bits=0x3F
mega.bootloader.lock_bits=0x0F

mega.build.f_cpu=16000000L
mega.build.core=arduino
mega.build.variant=mega
# default board may be overridden by the cpu menu
mega.build.board=AVR_MEGA2560

## Arduino Mega w/ ATmega2560
## -------------------------
mega.menu.cpu.atmega2560=ATmega2560 (Mega 2560)

mega.menu.cpu.atmega2560.upload.protocol=wiring
mega.menu.cpu.atmega2560.upload.maximum_size=253952
mega.menu.cpu.atmega2560.upload.speed=115200

mega.menu.cpu.atmega2560.bootloader.high_fuses=0xD8
mega.menu.cpu.atmega2560.bootloader.extended_fuses=0xFD
mega.menu.cpu.atmega2560.bootloader.file=stk500v2/stk500boot_v2_mega2560.hex

mega.menu.cpu.atmega2560.build.mcu=atmega2560
mega.menu.cpu.atmega2560.build.board=AVR_MEGA2560

## Arduino Mega w/ ATmega1280
## -------------------------
mega.menu.cpu.atmega1280=ATmega1280

mega.menu.cpu.atmega1280.upload.protocol=arduino
mega.menu.cpu.atmega1280.upload.maximum_size=126976
mega.menu.cpu.atmega1280.upload.speed=57600

mega.menu.cpu.atmega1280.bootloader.high_fuses=0xDA
mega.menu.cpu.atmega1280.bootloader.extended_fuses=0xF5
mega.menu.cpu.atmega1280.bootloader.file=atmega/ATmegaBOOT_168_atmega1280.hex

mega.menu.cpu.atmega1280.build.mcu=atmega1280
mega.menu.cpu.atmega1280.build.board=AVR_MEGA

##############################################################

megaADK.name=Arduino Mega ADK

megaADK.vid.0=0x2341
megaADK.pid.0=0x003f
megaADK.vid.1=0x2341
megaADK.pid.1=0x0044
megaADK.vid.2=0x2A03
megaADK.pid.2=0x003f
megaADK.vid.3=0x2A03
megaADK.pid.3=0x0044
megaADK.upload_port.0.vid=0x2341
megaADK.upload_port.0.pid=0x003f
megaADK.upload_port.1.vid=0x2341
megaADK.upload_port.1.pid=0x0044
megaADK.upload_port.2.vid=0x2A03
megaADK.upload_port.2.pid=0x003f
megaADK.upload_port.3.vid=0x2A03
megaADK.upload_port.3.pid=0x0044
megaADK.upload_port.4.board=megaADK

megaADK.upload.tool=avrdude
megaADK.upload.tool.default=avrdude
megaADK.upload.tool.network=arduino_ota
megaADK.upload.protocol=wiring
megaADK.upload.maximum_size=253952
megaADK.upload.maximum_data_size=8192
megaADK.upload.speed=115200

megaADK.bootloader.tool=avrdude
megaADK.bootloader.tool.default=avrdude
megaADK.bootloader.low_fuses=0xFF
megaADK.bootloader.high_fuses=0xD8
megaADK.bootloader.extended_fuses=0xFD
megaADK.bootloader.file=stk500v2/stk500boot_v2_mega2560.hex
megaADK.bootloader.unlock_bits=0x3F
megaADK.bootloader.lock_bits=0x0F

megaADK.build.mcu=atmega2560
megaADK.build.f_cpu=16000000L
megaADK.build.board=AVR_ADK
megaADK.build.core=arduino
megaADK.build.variant=mega

##############################################################

leonardo.name=Arduino Leonardo
leonardo.vid.0=0x2341
leonardo.pid.0=0x0036
leonardo.vid.1=0x2341
leonardo.pid.1=0x8036
leonardo.vid.2=0x2A03
leonardo.pid.2=0x0036
leonardo.vid.3=0x2A03
leonardo.pid.3=0x8036
leonardo.upload_port.0.vid=0x2341
leonardo.upload_port.0.pid=0x0036
leonardo.upload_port.1.vid=0x2341
leonardo.upload_port.1.pid=0x8036
leonardo.upload_port.2.vid=0x2A03
leonardo.upload_port.2.pid=0x0036
leonardo.upload_port.3.vid=0x2A03
leonardo.upload_port.3.pid=0x8036
leonardo.upload_port.4.board=leonardo

leonardo.upload.tool=avrdude
leonardo.upload.tool.default=avrdude
leonardo.upload.tool.network=arduino_ota
leonardo.upload.protocol=avr109
leonardo.upload.maximum_size=28672
leonardo.upload.maximum_data_size=2560
leonardo.upload.speed=57600
leonardo.upload.disable_flushing=true
leonardo.upload.use_1200bps_touch=true
leonardo.upload.wait_for_upload_port=true

leonardo.bootloader.tool=avrdude
leonardo.bootloader.tool.default=avrdude
leonardo.bootloader.low_fuses=0xff
leonardo.bootloader.high_fuses=0xd8
leonardo.bootloader.extended_fuses=0xcb
leonardo.bootloader.file=caterina/Caterina-Leonardo.hex
leonardo.bootloader.unlock_bits=0x3F
leonardo.bootloader.lock_bits=0x2F

leonardo.build.mcu=atmega32u4
leonardo.build.f_cpu=16000000L
leonardo.build.vid=0x2341
leonardo.build.pid=0x8036
leonardo.build.usb_product="Arduino Leonardo"
leonardo.build.board=AVR_LEONARDO
leonardo.build.core=arduino
leonardo.build.variant=leonardo
leonardo.build.extra_flags={build.usb_flags}

##############################################################

leonardoeth.name=Arduino Leonardo ETH
leonardoeth.vid.0=0x2a03
leonardoeth.pid.0=0x0040
leonardoeth.vid.1=0x2a03
leonardoeth.pid.1=0x8040
leonardoeth.upload_port.0.vid=0x2a03
leonardoeth.upload_port.0.pid=0x0040
leonardoeth.upload_port.1.vid=0x2a03
leonardoeth.upload_port.1.pid=0x8040
leonardoeth.upload_port.2.board=leonardoeth

leonardoeth.upload.tool=avrdude
leonardoeth.upload.tool.default=avrdude
leonardoeth.upload.tool.network=arduino_ota
leonardoeth.upload.protocol=avr109
leonardoeth.upload.maximum_size=28672
leonardoeth.upload.maximum_data_size=2560
leonardoeth.upload.speed=57600
leonardoeth.upload.disable_flushing=true
leonardoeth.upload.use_1200bps_touch=true
leonardoeth.upload.wait_for_upload_port=true

leonardoeth.bootloader.tool=avrdude
leonardoeth.bootloader.tool.default=avrdude
leonardoeth.bootloader.low_fuses=0xff
leonardoeth.bootloader.high_fuses=0xd8
leonardoeth.bootloader.extended_fuses=0xcb
leonardoeth.bootloader.file=caterina/Caterina-LeonardoEthernet.hex
leonardoeth.bootloader.unlock_bits=0x3F
leonardoeth.bootloader.lock_bits=0x2F

leonardoeth.build.mcu=atmega32u4
leonardoeth.build.f_cpu=16000000L
leonardoeth.build.vid=0x2a03
leonardoeth.build.pid=0x8040
leonardoeth.build.usb_product="Arduino Leonardo ETH"
leonardoeth.build.board=AVR_LEONARDO_ETH
leonardoeth.build.core=arduino
leonardoeth.build.variant=leonardo
leonardoeth.build.extra_flags={build.usb_flags}

##############################################################

micro.name=Arduino Micro

micro.vid.0=0x2341
micro.pid.0=0x0037
micro.vid.1=0x2341
micro.pid.1=0x8037
micro.vid.2=0x2A03
micro.pid.2=0x0037
micro.vid.3=0x2A03
micro.pid.3=0x8037
micro.vid.4=0x2341
micro.pid.4=0x0237
micro.vid.5=0x2341
micro.pid.5=0x8237
micro.upload_port.0.vid=0x2341
micro.upload_port.0.pid=0x0037
micro.upload_port.1.vid=0x2341
micro.upload_port.1.pid=0x8037
micro.upload_port.2.vid=0x2A03
micro.upload_port.2.pid=0x0037
micro.upload_port.3.vid=0x2A03
micro.upload_port.3.pid=0x8037
micro.upload_port.4.vid=0x2341
micro.upload_port.4.pid=0x0237
micro.upload_port.5.vid=0x2341
micro.upload_port.5.pid=0x8237
micro.upload_port.6.board=micro

micro.upload.tool=avrdude
micro.upload.tool.default=avrdude
micro.upload.tool.network=arduino_ota
micro.upload.protocol=avr109
micro.upload.maximum_size=28672
micro.upload.maximum_data_size=2560
micro.upload.speed=57600
micro.upload.disable_flushing=true
micro.upload.use_1200bps_touch=true
micro.upload.wait_for_upload_port=true

micro.bootloader.tool=avrdude
micro.bootloader.tool.default=avrdude
micro.bootloader.low_fuses=0xff
micro.bootloader.high_fuses=0xd8
micro.bootloader.extended_fuses=0xcb
micro.bootloader.file=caterina/Caterina-Micro.hex
micro.bootloader.unlock_bits=0x3F
micro.bootloader.lock_bits=0x2F

micro.build.mcu=atmega32u4
micro.build.f_cpu=16000000L
micro.build.vid=0x2341
micro.build.pid=0x8037
micro.build.usb_product="Arduino Micro"
micro.build.board=AVR_MICRO
micro.build.core=arduino
micro.build.variant=micro
micro.build.extra_flags={build.usb_flags}

##############################################################

esplora.name=Arduino Esplora
esplora.vid.0=0x2341
esplora.pid.0=0x003C
esplora.vid.1=0x2341
esplora.pid.1=0x803C
esplora.vid.2=0x2A03
esplora.pid.2=0x003C
esplora.vid.3=0x2A03
esplora.pid.3=0x803C
esplora.upload_port.0.vid=0x2341
esplora.upload_port.0.pid=0x003C
esplora.upload_port.1.vid=0x2341
esplora.upload_port.1.pid=0x803C
esplora.upload_port.2.vid=0x2A03
esplora.upload_port.2.pid=0x003C
esplora.upload_port.3.vid=0x2A03
esplora.upload_port.3.pid=0x803C
esplora.upload_port.4.board=esplora

esplora.upload.tool=avrdude
esplora.upload.tool.default=avrdude
esplora.upload.tool.network=arduino_ota
esplora.upload.protocol=avr109
esplora.upload.maximum_size=28672
esplora.upload.maximum_data_size=2560
esplora.upload.speed=57600
esplora.upload.disable_flushing=true
esplora.upload.use_1200bps_touch=true
esplora.upload.wait_for_upload_port=true

esplora.bootloader.tool=avrdude
esplora.bootloader.tool.default=avrdude
esplora.bootloader.low_fuses=0xff
esplora.bootloader.high_fuses=0xd8
esplora.bootloader.extended_fuses=0xcb
esplora.bootloader.file=caterina/Caterina-Esplora.hex
esplora.bootloader.unlock_bits=0x3F
esplora.bootloader.lock_bits=0x2F

esplora.build.mcu=atmega32u4
esplora.build.f_cpu=16000000L
esplora.build.vid=0x2341
esplora.build.pid=0x803c
esplora.build.usb_product="Arduino Esplora"
esplora.build.board=AVR_ESPLORA
esplora.build.core=arduino
esplora.build.variant=leonardo
esplora.build.extra_flags={build.usb_flags}

##############################################################

mini.name=Arduino Mini

mini.upload_port.0.board=mini

mini.upload.tool=avrdude
mini.upload.tool.default=avrdude
mini.upload.tool.network=arduino_ota
mini.upload.protocol=arduino

mini.bootloader.tool=avrdude
mini.bootloader.tool.default=avrdude
mini.bootloader.low_fuses=0xff
mini.bootloader.unlock_bits=0x3F
mini.bootloader.lock_bits=0x0F

mini.build.f_cpu=16000000L
mini.build.board=AVR_MINI
mini.build.core=arduino
mini.build.variant=eightanaloginputs

## Arduino Mini w/ ATmega328P
## --------------------------
mini.menu.cpu.atmega328=ATmega328P

mini.menu.cpu.atmega328.upload.maximum_size=28672
mini.menu.cpu.atmega328.upload.maximum_data_size=2048
mini.menu.cpu.atmega328.upload.speed=115200

mini.menu.cpu.atmega328.bootloader.high_fuses=0xd8
mini.menu.cpu.atmega328.bootloader.extended_fuses=0xFD
mini.menu.cpu.atmega328.bootloader.file=optiboot/optiboot_atmega328-Mini.hex

mini.menu.cpu.atmega328.build.mcu=atmega328p

## Arduino Mini w/ ATmega168
## -------------------------
mini.menu.cpu.atmega168=ATmega168

mini.menu.cpu.atmega168.upload.maximum_size=14336
mini.menu.cpu.atmega168.upload.maximum_data_size=1024
mini.menu.cpu.atmega168.upload.speed=19200

mini.menu.cpu.atmega168.bootloader.high_fuses=0xdd
mini.menu.cpu.atmega168.bootloader.extended_fuses=0xF8
mini.menu.cpu.atmega168.bootloader.file=atmega/ATmegaBOOT_168_ng.hex

mini.menu.cpu.atmega168.build.mcu=atmega168

##############################################################

ethernet.name=Arduino Ethernet

ethernet.upload_port.0.board=ethernet

ethernet.upload.tool=avrdude
ethernet.upload.tool.default=avrdude
ethernet.upload.tool.network=arduino_ota
ethernet.upload.protocol=arduino
ethernet.upload.maximum_size=32256
ethernet.upload.maximum_data_size=2048
ethernet.upload.speed=115200

ethernet.bootloader.tool=avrdude
ethernet.bootloader.tool.default=avrdude
ethernet.bootloader.low_fuses=0xff
ethernet.bootloader.high_fuses=0xde
ethernet.bootloader.extended_fuses=0xFD
ethernet.bootloader.file=optiboot/optiboot_atmega328.hex
ethernet.bootloader.unlock_bits=0x3F
ethernet.bootloader.lock_bits=0x0F

ethernet.build.variant=ethernet
ethernet.build.mcu=atmega328p
ethernet.build.f_cpu=16000000L
ethernet.build.board=AVR_ETHERNET
ethernet.build.core=arduino

##############################################################

fio.name=Arduino Fio

fio.upload_port.0.board=fio

fio.upload.tool=avrdude
fio.upload.tool.default=avrdude
fio.upload.tool.network=arduino_ota
fio.upload.protocol=arduino
fio.upload.maximum_size=30720
fio.upload.maximum_data_size=2048
fio.upload.speed=57600

fio.bootloader.tool=avrdude
fio.bootloader.tool.default=avrdude
fio.bootloader.low_fuses=0xFF
fio.bootloader.high_fuses=0xDA
fio.bootloader.extended_fuses=0xFD
fio.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex
fio.bootloader.unlock_bits=0x3F
fio.bootloader.lock_bits=0x0F

fio.build.mcu=atmega328p
fio.build.f_cpu=8000000L
fio.build.board=AVR_FIO
fio.build.core=arduino
fio.build.variant=eightanaloginputs

##############################################################

bt.name=Arduino BT

bt.upload_port.0.board=bt

bt.upload.tool=avrdude
bt.upload.tool.default=avrdude
bt.upload.tool.network=arduino_ota
bt.upload.protocol=arduino
bt.upload.speed=19200
bt.upload.disable_flushing=true

bt.bootloader.tool=avrdude
bt.bootloader.tool.default=avrdude
bt.bootloader.low_fuses=0xff
bt.bootloader.unlock_bits=0x3F
bt.bootloader.lock_bits=0x0F

bt.build.f_cpu=16000000L
bt.build.board=AVR_BT
bt.build.core=arduino
bt.build.variant=eightanaloginputs

## Arduino BT w/ ATmega328P
## ------------------------
bt.menu.cpu.atmega328=ATmega328P
bt.menu.cpu.atmega328.upload.maximum_size=28672
bt.menu.cpu.atmega328.upload.maximum_data_size=2048

bt.menu.cpu.atmega328.bootloader.high_fuses=0xd8
bt.menu.cpu.atmega328.bootloader.extended_fuses=0xFD
bt.menu.cpu.atmega328.bootloader.file=bt/ATmegaBOOT_168_atmega328_bt.hex

bt.menu.cpu.atmega328.build.mcu=atmega328p

## Arduino BT w/ ATmega168
## -----------------------
bt.menu.cpu.atmega168=ATmega168
bt.menu.cpu.atmega168.upload.maximum_size=14336
bt.menu.cpu.atmega168.upload.maximum_data_size=1024

bt.menu.cpu.atmega168.bootloader.high_fuses=0xdd
bt.menu.cpu.atmega168.bootloader.extended_fuses=0xF8
bt.menu.cpu.atmega168.bootloader.file=bt/ATmegaBOOT_168.hex

bt.menu.cpu.atmega168.build.mcu=atmega168

##############################################################

LilyPadUSB.name=LilyPad Arduino USB
LilyPadUSB.vid.0=0x1B4F
LilyPadUSB.pid.0=0x9207
LilyPadUSB.vid.1=0x1B4F
LilyPadUSB.pid.1=0x9208
LilyPadUSB.upload_port.0.vid=0x1B4F
LilyPadUSB.upload_port.0.pid=0x9207
LilyPadUSB.upload_port.1.vid=0x1B4F
LilyPadUSB.upload_port.1.pid=0x9208
LilyPadUSB.upload_port.2.board=LilyPadUSB

LilyPadUSB.upload.tool=avrdude
LilyPadUSB.upload.tool.default=avrdude
LilyPadUSB.upload.tool.network=arduino_ota
LilyPadUSB.upload.protocol=avr109
LilyPadUSB.upload.maximum_size=28672
LilyPadUSB.upload.maximum_data_size=2560
LilyPadUSB.upload.speed=57600
LilyPadUSB.upload.disable_flushing=true
LilyPadUSB.upload.use_1200bps_touch=true
LilyPadUSB.upload.wait_for_upload_port=true

LilyPadUSB.bootloader.tool=avrdude
LilyPadUSB.bootloader.tool.default=avrdude
LilyPadUSB.bootloader.low_fuses=0xff
LilyPadUSB.bootloader.high_fuses=0xd8
LilyPadUSB.bootloader.extended_fuses=0xce
LilyPadUSB.bootloader.file=caterina-LilyPadUSB/Caterina-LilyPadUSB.hex
LilyPadUSB.bootloader.unlock_bits=0x3F
LilyPadUSB.bootloader.lock_bits=0x2F

LilyPadUSB.build.mcu=atmega32u4
LilyPadUSB.build.f_cpu=8000000L
LilyPadUSB.build.vid=0x1B4F
LilyPadUSB.build.pid=0x9208
LilyPadUSB.build.usb_product="LilyPad USB"
LilyPadUSB.build.board=AVR_LILYPAD_USB
LilyPadUSB.build.core=arduino
LilyPadUSB.build.variant=leonardo
LilyPadUSB.build.extra_flags={build.usb_flags}

##############################################################

lilypad.name=LilyPad Arduino

lilypad.upload_port.0.board=lilypad

lilypad.upload.tool=avrdude
lilypad.upload.tool.default=avrdude
lilypad.upload.tool.network=arduino_ota
lilypad.upload.protocol=arduino

lilypad.bootloader.tool=avrdude
lilypad.bootloader.tool.default=avrdude
lilypad.bootloader.unlock_bits=0x3F
lilypad.bootloader.lock_bits=0x0F

lilypad.build.f_cpu=8000000L
lilypad.build.board=AVR_LILYPAD
lilypad.build.core=arduino
lilypad.build.variant=standard

## LilyPad Arduino w/ ATmega328P
## -----------------------------
lilypad.menu.cpu.atmega328=ATmega328P

lilypad.menu.cpu.atmega328.upload.maximum_size=30720
lilypad.menu.cpu.atmega328.upload.maximum_data_size=2048
lilypad.menu.cpu.atmega328.upload.speed=57600

lilypad.menu.cpu.atmega328.bootloader.low_fuses=0xFF
lilypad.menu.cpu.atmega328.bootloader.high_fuses=0xDA
lilypad.menu.cpu.atmega328.bootloader.extended_fuses=0xFD
lilypad.menu.cpu.atmega328.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex

lilypad.menu.cpu.atmega328.build.mcu=atmega328p

## LilyPad Arduino w/ ATmega168
## ----------------------------
lilypad.menu.cpu.atmega168=ATmega168

lilypad.menu.cpu.atmega168.upload.maximum_size=14336
lilypad.menu.cpu.atmega168.upload.maximum_data_size=1024
lilypad.menu.cpu.atmega168.upload.speed=19200

lilypad.menu.cpu.atmega168.bootloader.low_fuses=0xe2
lilypad.menu.cpu.atmega168.bootloader.high_fuses=0xdd
lilypad.menu.cpu.atmega168.bootloader.extended_fuses=0xF8
lilypad.menu.cpu.atmega168.bootloader.file=lilypad/LilyPadBOOT_168.hex

lilypad.menu.cpu.atmega168.build.mcu=atmega168

##############################################################

pro.name=Arduino Pro or Pro Mini

pro.upload_port.0.board=pro

pro.upload.tool=avrdude
pro.upload.tool.default=avrdude
pro.upload.tool.network=arduino_ota
pro.upload.protocol=arduino

pro.bootloader.tool=avrdude
pro.bootloader.tool.default=avrdude
pro.bootloader.unlock_bits=0x3F
pro.bootloader.lock_bits=0x0F

pro.build.board=AVR_PRO
pro.build.core=arduino
pro.build.variant=eightanaloginputs

## Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega328P
## --------------------------------------------------
pro.menu.cpu.16MHzatmega328=ATmega328P (5V, 16 MHz)

pro.menu.cpu.16MHzatmega328.upload.maximum_size=30720
pro.menu.cpu.16MHzatmega328.upload.maximum_data_size=2048
pro.menu.cpu.16MHzatmega328.upload.speed=57600

pro.menu.cpu.16MHzatmega328.bootloader.low_fuses=0xFF
pro.menu.cpu.16MHzatmega328.bootloader.high_fuses=0xDA
pro.menu.cpu.16MHzatmega328.bootloader.extended_fuses=0xFD
pro.menu.cpu.16MHzatmega328.bootloader.file=atmega/ATmegaBOOT_168_atmega328.hex

pro.menu.cpu.16MHzatmega328.build.mcu=atmega328p
pro.menu.cpu.16MHzatmega328.build.f_cpu=16000000L

## Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328P
## ---------------------------------------------------
pro.menu.cpu.8MHzatmega328=ATmega328P (3.3V, 8 MHz)

pro.menu.cpu.8MHzatmega328.upload.maximum_size=30720
pro.menu.cpu.8MHzatmega328.upload.maximum_data_size=2048
pro.menu.cpu.8MHzatmega328.upload.speed=57600

pro.menu.cpu.8MHzatmega328.bootloader.low_fuses=0xFF
pro.menu.cpu.8MHzatmega328.bootloader.high_fuses=0xDA
pro.menu.cpu.8MHzatmega328.bootloader.extended_fuses=0xFD
pro.menu.cpu.8MHzatmega328.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex

pro.menu.cpu.8MHzatmega328.build.mcu=atmega328p
pro.menu.cpu.8MHzatmega328.build.f_cpu=8000000L

## Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega168
## -------------------------------------------------
pro.menu.cpu.16MHzatmega168=ATmega168 (5V, 16 MHz)

pro.menu.cpu.16MHzatmega168.upload.maximum_size=14336
pro.menu.cpu.16MHzatmega168.upload.maximum_data_size=1024
pro.menu.cpu.16MHzatmega168.upload.speed=19200

pro.menu.cpu.16MHzatmega168.bootloader.low_fuses=0xff
pro.menu.cpu.16MHzatmega168.bootloader.high_fuses=0xdd
pro.menu.cpu.16MHzatmega168.bootloader.extended_fuses=0xF8
pro.menu.cpu.16MHzatmega168.bootloader.file=atmega/ATmegaBOOT_168_diecimila.hex

pro.menu.cpu.16MHzatmega168.build.mcu=atmega168
pro.menu.cpu.16MHzatmega168.build.f_cpu=16000000L

## Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega168
## --------------------------------------------------
pro.menu.cpu.8MHzatmega168=ATmega168 (3.3V, 8 MHz)

pro.menu.cpu.8MHzatmega168.upload.maximum_size=14336
pro.menu.cpu.8MHzatmega168.upload.maximum_data_size=1024
pro.menu.cpu.8MHzatmega168.upload.speed=19200

pro.menu.cpu.8MHzatmega168.bootloader.low_fuses=0xc6
pro.menu.cpu.8MHzatmega168.bootloader.high_fuses=0xdd
pro.menu.cpu.8MHzatmega168.bootloader.extended_fuses=0xF8
pro.menu.cpu.8MHzatmega168.bootloader.file=atmega/ATmegaBOOT_168_pro_8MHz.hex

pro.menu.cpu.8MHzatmega168.build.mcu=atmega168
pro.menu.cpu.8MHzatmega168.build.f_cpu=8000000L

##############################################################

atmegang.name=Arduino NG or older

atmegang.upload_port.0.board=atmegang

atmegang.upload.tool=avrdude
atmegang.upload.tool.default=avrdude
atmegang.upload.tool.network=arduino_ota
atmegang.upload.protocol=arduino
atmegang.upload.speed=19200

atmegang.bootloader.tool=avrdude
atmegang.bootloader.tool.default=avrdude
atmegang.bootloader.unlock_bits=0x3F
atmegang.bootloader.lock_bits=0x0F

atmegang.build.mcu=atmegang
atmegang.build.f_cpu=16000000L
atmegang.build.board=AVR_NG
atmegang.build.core=arduino
atmegang.build.variant=standard

## Arduino NG or older w/ ATmega168
## --------------------------------
atmegang.menu.cpu.atmega168=ATmega168

atmegang.menu.cpu.atmega168.upload.maximum_size=14336
atmegang.menu.cpu.atmega168.upload.maximum_data_size=1024

atmegang.menu.cpu.atmega168.bootloader.low_fuses=0xff
atmegang.menu.cpu.atmega168.bootloader.high_fuses=0xdd
atmegang.menu.cpu.atmega168.bootloader.extended_fuses=0xF8
atmegang.menu.cpu.atmega168.bootloader.file=atmega/ATmegaBOOT_168_ng.hex

atmegang.menu.cpu.atmega168.build.mcu=atmega168

## Arduino NG or older w/ ATmega8
## ------------------------------
atmegang.menu.cpu.atmega8=ATmega8

atmegang.menu.cpu.atmega8.upload.maximum_size=7168
atmegang.menu.cpu.atmega8.upload.maximum_data_size=1024

atmegang.menu.cpu.atmega8.bootloader.low_fuses=0xdf
atmegang.menu.cpu.atmega8.bootloader.high_fuses=0xca
atmegang.menu.cpu.atmega8.bootloader.extended_fuses=
atmegang.menu.cpu.atmega8.bootloader.file=atmega8/ATmegaBOOT-prod-firmware-2009-11-07.hex

atmegang.menu.cpu.atmega8.build.mcu=atmega8

##############################################################

robotControl.name=Arduino Robot Control
robotControl.vid.0=0x2341
robotControl.pid.0=0x0038
robotControl.vid.1=0x2341
robotControl.pid.1=0x8038
robotControl.vid.2=0x2A03
robotControl.pid.2=0x0038
robotControl.vid.3=0x2A03
robotControl.pid.3=0x8038
robotControl.upload_port.0.vid=0x2341
robotControl.upload_port.0.pid=0x0038
robotControl.upload_port.1.vid=0x2341
robotControl.upload_port.1.pid=0x8038
robotControl.upload_port.2.vid=0x2A03
robotControl.upload_port.2.pid=0x0038
robotControl.upload_port.3.vid=0x2A03
robotControl.upload_port.3.pid=0x8038
robotControl.upload_port.4.board=robotControl

robotControl.upload.tool=avrdude
robotControl.upload.tool.default=avrdude
robotControl.upload.tool.network=arduino_ota
robotControl.upload.protocol=avr109
robotControl.upload.maximum_size=28672
robotControl.upload.maximum_data_size=2560
robotControl.upload.speed=57600
robotControl.upload.disable_flushing=true
robotControl.upload.use_1200bps_touch=true
robotControl.upload.wait_for_upload_port=true

robotControl.bootloader.tool=avrdude
robotControl.bootloader.tool.default=avrdude
robotControl.bootloader.low_fuses=0xff
robotControl.bootloader.high_fuses=0xd8
robotControl.bootloader.extended_fuses=0xcb
robotControl.bootloader.file=caterina-Arduino_Robot/Caterina-Robot-Control.hex
robotControl.bootloader.unlock_bits=0x3F
robotControl.bootloader.lock_bits=0x2F

robotControl.build.mcu=atmega32u4
robotControl.build.f_cpu=16000000L
robotControl.build.vid=0x2341
robotControl.build.pid=0x8038
robotControl.build.usb_product="Robot Control"
robotControl.build.board=AVR_ROBOT_CONTROL
robotControl.build.core=arduino
robotControl.build.variant=robot_control
robotControl.build.extra_flags={build.usb_flags}

##############################################################

robotMotor.name=Arduino Robot Motor
robotMotor.vid.0=0x2341
robotMotor.pid.0=0x0039
robotMotor.vid.1=0x2341
robotMotor.pid.1=0x8039
robotMotor.vid.2=0x2A03
robotMotor.pid.2=0x0039
robotMotor.vid.3=0x2A03
robotMotor.pid.3=0x8039
robotMotor.upload_port.0.vid=0x2341
robotMotor.upload_port.0.pid=0x0039
robotMotor.upload_port.1.vid=0x2341
robotMotor.upload_port.1.pid=0x8039
robotMotor.upload_port.2.vid=0x2A03
robotMotor.upload_port.2.pid=0x0039
robotMotor.upload_port.3.vid=0x2A03
robotMotor.upload_port.3.pid=0x8039
robotMotor.upload_port.4.board=robotMotor

robotMotor.upload.tool=avrdude
robotMotor.upload.tool.default=avrdude
robotMotor.upload.tool.network=arduino_ota
robotMotor.upload.protocol=avr109
robotMotor.upload.maximum_size=28672
robotMotor.upload.maximum_data_size=2560
robotMotor.upload.speed=57600
robotMotor.upload.disable_flushing=true
robotMotor.upload.use_1200bps_touch=true
robotMotor.upload.wait_for_upload_port=true

robotMotor.bootloader.tool=avrdude
robotMotor.bootloader.tool.default=avrdude
robotMotor.bootloader.low_fuses=0xff
robotMotor.bootloader.high_fuses=0xd8
robotMotor.bootloader.extended_fuses=0xcb
robotMotor.bootloader.file=caterina-Arduino_Robot/Caterina-Robot-Motor.hex
robotMotor.bootloader.unlock_bits=0x3F
robotMotor.bootloader.lock_bits=0x2F

robotMotor.build.mcu=atmega32u4
robotMotor.build.f_cpu=16000000L
robotMotor.build.vid=0x2341
robotMotor.build.pid=0x8039
robotMotor.build.usb_product="Robot Motor"
robotMotor.build.board=AVR_ROBOT_MOTOR
robotMotor.build.core=arduino
robotMotor.build.variant=robot_motor
robotMotor.build.extra_flags={build.usb_flags}

##############################################################

gemma.vid.0=0x2341
gemma.pid.0=0x0c9f
gemma.upload_port.0.vid=0x2341
gemma.upload_port.0.pid=0x0c9f
gemma.upload_port.1.board=gemma

gemma.name=Arduino Gemma

gemma.bootloader.low_fuses=0xF1
gemma.bootloader.high_fuses=0xD5
gemma.bootloader.extended_fuses=0xFE
gemma.bootloader.tool=avrdude
gemma.bootloader.tool.default=avrdude
gemma.bootloader.lock_bits=
gemma.bootloader.unlock_bits=
gemma.bootloader.file=gemma/gemma_v1.hex

gemma.build.mcu=attiny85
gemma.build.f_cpu=8000000L
gemma.build.core=arduino
gemma.build.variant=gemma
gemma.build.board=AVR_GEMMA

gemma.upload.tool=avrdude
gemma.upload.tool.default=avrdude
gemma.upload.tool.network=arduino_ota
gemma.upload.maximum_size=5310

##############################################################

# Adafruit Circuit Playground 32u4 w/Caterina Configuration
circuitplay32u4cat.name=Adafruit Circuit Playground
circuitplay32u4cat.bootloader.low_fuses=0xff
circuitplay32u4cat.bootloader.high_fuses=0xd8
circuitplay32u4cat.bootloader.extended_fuses=0xcb
circuitplay32u4cat.bootloader.file=caterina/Caterina-Circuitplay32u4.hex
circuitplay32u4cat.bootloader.unlock_bits=0x3F
circuitplay32u4cat.bootloader.lock_bits=0x2F
circuitplay32u4cat.bootloader.tool=avrdude
circuitplay32u4cat.bootloader.tool.default=avrdude
circuitplay32u4cat.build.mcu=atmega32u4
circuitplay32u4cat.build.f_cpu=8000000L
circuitplay32u4cat.build.vid=0x239A
circuitplay32u4cat.build.pid=0x8011
circuitplay32u4cat.build.core=arduino
circuitplay32u4cat.build.variant=circuitplay32u4
circuitplay32u4cat.build.board=AVR_CIRCUITPLAY
circuitplay32u4cat.build.usb_product="Circuit Playground"
circuitplay32u4cat.build.usb_manufacturer="Adafruit"
circuitplay32u4cat.build.extra_flags={build.usb_flags}
circuitplay32u4cat.upload.protocol=avr109
circuitplay32u4cat.upload.maximum_size=28672
circuitplay32u4cat.upload.speed=57600
circuitplay32u4cat.upload.disable_flushing=true
circuitplay32u4cat.upload.use_1200bps_touch=true
circuitplay32u4cat.upload.wait_for_upload_port=true
circuitplay32u4cat.upload.tool=avrdude
circuitplay32u4cat.upload.tool.default=avrdude
circuitplay32u4cat.upload.tool.network=arduino_ota
circuitplay32u4cat.vid.0=0x239A
circuitplay32u4cat.pid.0=0x8011
circuitplay32u4cat.upload_port.0.vid=0x239A
circuitplay32u4cat.upload_port.0.pid=0x8011
circuitplay32u4cat.upload_port.1.board=circuitplay32u4cat

##############################################################

yunmini.name=Arduino Yún Mini
yunmini.upload.via_ssh=true

yunmini.vid.0=0x2a03
yunmini.pid.0=0x0050
yunmini.vid.1=0x2a03
yunmini.pid.1=0x8050
yunmini.upload_port.0.vid=0x2a03
yunmini.upload_port.0.pid=0x0050
yunmini.upload_port.1.vid=0x2a03
yunmini.upload_port.1.pid=0x8050
yunmini.upload_port.2.board=yunmini

yunmini.upload.tool=avrdude
yunmini.upload.tool.default=avrdude
yunmini.upload.tool.network=arduino_ota
yunmini.upload.protocol=avr109
yunmini.upload.maximum_size=28672
yunmini.upload.maximum_data_size=2560
yunmini.upload.speed=57600
yunmini.upload.disable_flushing=true
yunmini.upload.use_1200bps_touch=true
yunmini.upload.wait_for_upload_port=true

yunmini.bootloader.tool=avrdude
yunmini.bootloader.tool.default=avrdude
yunmini.bootloader.low_fuses=0xff
yunmini.bootloader.high_fuses=0xd8
yunmini.bootloader.extended_fuses=0xfb
yunmini.bootloader.file=caterina/Caterina-YunMini.hex
yunmini.bootloader.unlock_bits=0x3F
yunmini.bootloader.lock_bits=0x2F

yunmini.build.mcu=atmega32u4
yunmini.build.f_cpu=16000000L
yunmini.build.vid=0x2a03
yunmini.build.pid=0x8050
yunmini.build.usb_product="Arduino Yún Mini"
yunmini.build.board=AVR_YUNMINI
yunmini.build.core=arduino
yunmini.build.variant=yun
yunmini.build.extra_flags={build.usb_flags}

##############################################################

chiwawa.name=Arduino Industrial 101
chiwawa.upload.via_ssh=true

chiwawa.vid.0=0x2a03
chiwawa.pid.0=0x0056
chiwawa.vid.1=0x2a03
chiwawa.pid.1=0x8056
chiwawa.upload_port.0.vid=0x2a03
chiwawa.upload_port.0.pid=0x0056
chiwawa.upload_port.1.vid=0x2a03
chiwawa.upload_port.1.pid=0x8056
chiwawa.upload_port.2.board=chiwawa

chiwawa.upload.tool=avrdude
chiwawa.upload.tool.default=avrdude
chiwawa.upload.tool.network=arduino_ota
chiwawa.upload.protocol=avr109
chiwawa.upload.maximum_size=28672
chiwawa.upload.maximum_data_size=2560
chiwawa.upload.speed=57600
chiwawa.upload.disable_flushing=true
chiwawa.upload.use_1200bps_touch=true
chiwawa.upload.wait_for_upload_port=true

chiwawa.bootloader.tool=avrdude
chiwawa.bootloader.tool.default=avrdude
chiwawa.bootloader.low_fuses=0xff
chiwawa.bootloader.high_fuses=0xd8
chiwawa.bootloader.extended_fuses=0xfb
chiwawa.bootloader.file=caterina/Caterina-Industrial101.hex
chiwawa.bootloader.unlock_bits=0x3F
chiwawa.bootloader.lock_bits=0x2F

chiwawa.build.mcu=atmega32u4
chiwawa.build.f_cpu=16000000L
chiwawa.build.vid=0x2a03
chiwawa.build.pid=0x8056
chiwawa.build.usb_product="Arduino Industrial 101"
chiwawa.build.board=AVR_INDUSTRIAL101
chiwawa.build.core=arduino
chiwawa.build.variant=yun
chiwawa.build.extra_flags={build.usb_flags}

##############################################################

one.name=Linino One
one.upload.via_ssh=true

one.vid.0=0x2a03
one.pid.0=0x0001
one.vid.1=0x2a03
one.pid.1=0x8001
one.upload_port.0.vid=0x2a03
one.upload_port.0.pid=0x0001
one.upload_port.1.vid=0x2a03
one.upload_port.1.pid=0x8001
one.upload_port.2.board=one

one.upload.tool=avrdude
one.upload.tool.default=avrdude
one.upload.tool.network=arduino_ota
one.upload.protocol=avr109
one.upload.maximum_size=28672
one.upload.maximum_data_size=2560
one.upload.speed=57600
one.upload.disable_flushing=true
one.upload.use_1200bps_touch=true
one.upload.wait_for_upload_port=true

one.bootloader.tool=avrdude
one.bootloader.tool.default=avrdude
one.bootloader.low_fuses=0xff
one.bootloader.high_fuses=0xd8
one.bootloader.extended_fuses=0xfb
one.bootloader.file=caterina/Caterina-LininoOne.hex
one.bootloader.unlock_bits=0x3F
one.bootloader.lock_bits=0x2F

one.build.mcu=atmega32u4
one.build.f_cpu=16000000L
one.build.vid=0x2a03
one.build.pid=0x8001
one.build.usb_product="Linino One"
one.build.board=AVR_LININO_ONE
one.build.core=arduino
one.build.variant=yun
one.build.extra_flags={build.usb_flags}

##############################################################

unowifi.name=Arduino Uno WiFi
unowifi.vid.0=0x2A03
unowifi.pid.0=0x0057
unowifi.upload_port.0.vid=0x2A03
unowifi.upload_port.0.pid=0x0057
unowifi.upload_port.1.board=unowifi

unowifi.upload.tool=avrdude
unowifi.upload.tool.default=avrdude
unowifi.upload.tool.network=arduino_ota
unowifi.upload.protocol=arduino
unowifi.upload.maximum_size=32256
unowifi.upload.maximum_data_size=2048
unowifi.upload.speed=115200
unowifi.upload.network.endpoint_upload=/pgm/upload
unowifi.upload.network.endpoint_sync=/pgm/sync
unowifi.upload.network.sync_return=204:SYNC
unowifi.upload.network.endpoint_reset=/log/reset
unowifi.upload.network.port=80

unowifi.bootloader.tool=avrdude
unowifi.bootloader.tool.default=avrdude
unowifi.bootloader.low_fuses=0xFF
unowifi.bootloader.high_fuses=0xDE
unowifi.bootloader.extended_fuses=0x05
unowifi.bootloader.unlock_bits=0x3F
unowifi.bootloader.lock_bits=0x0F
unowifi.bootloader.file=optiboot/optiboot_atmega328.hex

unowifi.build.mcu=atmega328p
unowifi.build.f_cpu=16000000L
unowifi.build.board=AVR_UNO_WIFI_DEV_ED
unowifi.build.core=arduino
unowifi.build.variant=standard
unowifi.build.esp_ch_uart_br=19200
unowifi.build.extra_flags=-DESP_CH_UART -DESP_CH_UART_BR={build.esp_ch_uart_br}

##############################################################

and

platform.txt


# Arduino AVR Core and platform.
# ------------------------------
#
# For more info:
# https://arduino.github.io/arduino-cli/latest/platform-specification/

name=Arduino AVR Boards
version=1.8.6

# AVR compile variables
# ---------------------

compiler.warning_flags=-w
compiler.warning_flags.none=-w
compiler.warning_flags.default=
compiler.warning_flags.more=-Wall
compiler.warning_flags.all=-Wall -Wextra

# Default "compiler.path" is correct, change only if you want to override the initial value
compiler.path={runtime.tools.avr-gcc.path}/bin/
compiler.c.cmd=avr-gcc
compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects
compiler.c.elf.flags={compiler.warning_flags} -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections
compiler.c.elf.cmd=avr-gcc
compiler.S.flags=-c -g -x assembler-with-cpp -flto -MMD
compiler.cpp.cmd=avr-g++
compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto
compiler.ar.cmd=avr-gcc-ar
compiler.ar.flags=rcs
compiler.objcopy.cmd=avr-objcopy
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
compiler.elf2hex.flags=-O ihex -R .eeprom
compiler.elf2hex.cmd=avr-objcopy
compiler.ldflags=
compiler.libraries.ldflags=
compiler.size.cmd=avr-size

# This can be overridden in boards.txt
build.extra_flags=

# These can be overridden in platform.local.txt
compiler.c.extra_flags=
compiler.c.elf.extra_flags=
compiler.S.extra_flags=
compiler.cpp.extra_flags=
compiler.ar.extra_flags=
compiler.objcopy.eep.extra_flags=
compiler.elf2hex.extra_flags=

# AVR compile patterns
# --------------------

## Compile c files
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"

## Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"

## Compile S files
recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"

## Create archives
# archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value
archive_file_path={build.path}/{archive_file}
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"

## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} {compiler.libraries.ldflags} "{build.path}/{archive_file}" "-L{build.path}" -lm

## Create output files (.eep and .hex)
recipe.objcopy.eep.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep"
recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"

## Save hex
recipe.output.tmp_file={build.project_name}.hex
recipe.output.save_file={build.project_name}.{build.variant}.hex

## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).*
recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).*
recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*

## Preprocessor
preproc.includes.flags=-w -x c++ -M -MG -MP
recipe.preproc.includes="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.includes.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}"

preproc.macros.flags=-w -x c++ -E -CC
recipe.preproc.macros="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.macros.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{preprocessed_file_path}"

# Required discoveries and monitors
# ---------------------------------
pluggable_discovery.required.0=builtin:serial-discovery
pluggable_discovery.required.1=builtin:mdns-discovery
pluggable_monitor.required.serial=builtin:serial-monitor

# AVR Uploader/Programmers tools
# ------------------------------

tools.avrdude.path={runtime.tools.avrdude.path}
tools.avrdude.cmd.path={path}/bin/avrdude
tools.avrdude.config.path={path}/etc/avrdude.conf

tools.avrdude.upload.params.verbose=-v
tools.avrdude.upload.params.quiet=-q -q
# tools.avrdude.upload.verify is needed for backwards compatibility with IDE 1.6.8 or older, IDE 1.6.9 or newer overrides this value
tools.avrdude.upload.verify=
tools.avrdude.upload.params.noverify=-V
tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} {upload.verify} -p{build.mcu} -c{upload.protocol} "-P{serial.port}" -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i"

tools.avrdude.program.params.verbose=-v
tools.avrdude.program.params.quiet=-q -q
# tools.avrdude.program.verify is needed for backwards compatibility with IDE 1.6.8 or older, IDE 1.6.9 or newer overrides this value
tools.avrdude.program.verify=
tools.avrdude.program.params.noverify=-V
tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} {program.verify} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i"

tools.avrdude.erase.params.verbose=-v
tools.avrdude.erase.params.quiet=-q -q
tools.avrdude.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Ulock:w:{bootloader.unlock_bits}:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m

tools.avrdude.bootloader.params.verbose=-v
tools.avrdude.bootloader.params.quiet=-q -q
tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i" -Ulock:w:{bootloader.lock_bits}:m

tools.avrdude_remote.upload.pattern=/usr/bin/run-avrdude /tmp/sketch.hex {upload.verbose} -p{build.mcu}

# The following rule is deprecated by pluggable discovery.
# We keep it to avoid breaking compatibility with the Arduino Java IDE.
tools.avrdude.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA
tools.avrdude.upload.network_pattern="{network_cmd}" -address {serial.port} -port {upload.network.port} -sketch "{build.path}/{build.project_name}.hex" -upload {upload.network.endpoint_upload} -sync {upload.network.endpoint_sync} -reset {upload.network.endpoint_reset} -sync_exp {upload.network.sync_return}

# arduino ota
tools.arduino_ota.cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA
tools.arduino_ota.upload.pattern="{cmd}" -address {upload.port.address} -port {upload.port.properties.port} -sketch "{build.path}/{build.project_name}.hex" -upload {upload.port.properties.endpoint_upload} -sync {upload.port.properties.endpoint_sync} -reset {upload.port.properties.endpoint_reset} -sync_exp {upload.port.properties.sync_return}

# USB Default Flags
# Default blank usb manufacturer will be filled in at compile time
# - from numeric vendor ID, set to Unknown otherwise
build.usb_manufacturer="Unknown"
build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'

Very strange, I haven't seen this problem before ...
The -mmcu=atmega32u4 is missing from the command line in the verbose output. This results in the MIDIUSB library failing to determine the target architecture.
The pattern in platform.txt does look correct, though. Maybe a bug in the arduino-builder?
I'd recommend uninstalling the entire Arduino IDE, removing (or renaming) the /Users/avi/Library/Arduino15 folder, and reinstalling the IDE.