Anyone want to add HoodLoader2 support?

If you dont know what hoodloader2 is, then i recommend you check out the github: GitHub - NicoHood/HoodLoader2: 16u2 Bootloader to reprogram 16u2 + 328/2560 with Arduino IDE

From the github page:
HoodLoader2 gives you the option to reprogram the 16u2 of a normal Arduino Uno/Mega R3 with custom sketches. This means you can use the 16u2 as a normal USB AVR like a Leonardo. You have a full compatible USB-HID core, CDC Serial and you can also use the 7 i/o pins of the 16u2. The extended HID devices of the HID Project also apply for the HoodLoader2.

The creator of hoodloader2 has custom boards for the arduino ide. I dont know how to convert them over to PlatformIO, so that is why i have come here for help. I would have done it myself, but i dont have the knowledge to do it. The creator of hoodloader2 has said on github that he won’t do it, but is open for anyone else to make it, then make a pull request and such to the repository

  1. Download and unpack https://github.com/NicoHood/HoodLoader2/releases/download/2.0.5/2.0.5-boards_manager.zip
  2. Copy 2.0.5-boards_manager/variants/HoodLoader2folder to~/.platformio/packages/framework-arduinoavr/variants`
  3. In your project create folder named boards and place here file named HoodLoader2atmega16u2.json
{
  "build": {
    "core": "arduino", 
    "extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_HOODLOADER2 -DMAGIC_KEY_POS=(RAMEND-1) -DUSB_EP_SIZE=16", 
    "f_cpu": "16000000L", 
    "hwids": [
      [
        "0x2341", 
        "0x484C"
      ]
    ], 
    "mcu": "atmega16u2", 
    "variant": "HoodLoader2"
  }, 
  "frameworks": [
    "arduino", 
    "simba"
  ], 
  "fuses": {
    "efuse": "0x05", 
    "hfuse": "0xDE", 
    "lfuse": "0xFF", 
    "lock": "0x3F"
  }, 
  "name": "HoodLoader2 16u2 Uno", 
  "upload": {
    "maximum_ram_size": 512, 
    "maximum_size": 12288, 
    "protocol": "avr109", 
    "disable_flushing": true, 
    "require_upload_port": true, 
    "wait_for_upload_port": true, 
    "speed": 57600
  }, 
  "url": "http://www.arduino.org/products/boards/4-arduino-boards/arduino-uno", 
  "vendor": "Arduino"
}

In platformio.ini please use

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

P.S: Don’t forget to write HoodLoader2 bootloader using Arduino IDE. PIO IDE doesn’t provide target to write bootloader by default. You can create custom target but that is another story…

P.S.S: You can modify board config. See boards.txt file in that archive.