Restore Arduino Leonardo Firmware

Using latest version of Arduino IDE

Earlier today I installed a library to let my arduino leonardo act as an xbox controller from this tutorial:

It isnt working at all and I would like to restore my firmware to its original state. I can still upload the blink example so I know the board is still working but I cant get the firmware updater example to work

Here are the errors:

Arduino: 1.8.10 (Windows 10), Board: "Arduino Leonardo w/ XInput"

ESP32BootROM.cpp:335:32: error: 'SerialNina' was not declared in this scope

ESP32BootROMClass ESP32BootROM(SerialNina, NINA_GPIO0, NINA_RESETN);

^~~~~~~~~~

sketch\ESP32BootROM.cpp:335:32: note: suggested alternative: 'Serial'

ESP32BootROMClass ESP32BootROM(SerialNina, NINA_GPIO0, NINA_RESETN);

^~~~~~~~~~

Serial

ESP32BootROM.cpp:335:44: error: 'NINA_GPIO0' was not declared in this scope

ESP32BootROMClass ESP32BootROM(SerialNina, NINA_GPIO0, NINA_RESETN);

^~~~~~~~~~

ESP32BootROM.cpp:335:56: error: 'NINA_RESETN' was not declared in this scope

ESP32BootROMClass ESP32BootROM(SerialNina, NINA_GPIO0, NINA_RESETN);

^~~~~~~~~~~

exit status 1
'SerialNina' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

What do I do to restore the firmware and remove the xinput stuff?

The errors are compiler errors. Not sure why you think fixing the firmware (please explain what you think it is) will solve that.

Have you tried to compile blink?
Have you tried to upload blink?

Have you tried compiling blink for a normal Leonardo?
Have you tried uploading blink to a normal Leonardo?

Where does the ESP fit in? All errors seem to be ESP related errors. A normal Leonardo does not have ESP on-board. Do you have a special board?

I have uploaded blink but I have to reset the board during the upload in order to do it. I don't have a special board its just a regular leonardo. The main problem is that I can't communicate over the comm ports anymore.

I am also getting an error when trying to upload old sketches. Here is an example with the HID Master library:

Arduino: 1.8.10 (Windows 10), Board: "Arduino Yún w/ XInput"

In file included from C:\Users\vinmr\Documents\Arduino\libraries\HID-master\src/HID-Project.h:39:0,

Multiple libraries were found for "HID-Project.h"
from C:\Users\vinmr\Desktop\AU3\sketch_jan15a\sketch_jan15a.ino:1:

Used: C:\Users\vinmr\Documents\Arduino\libraries\HID-master
C:\Users\vinmr\Documents\Arduino\libraries\HID-master\src/SingleReport/SingleAbsoluteMouse.h:28:10: fatal error: HID.h: No such file or directory

#include "HID.h"

Not used: C:\Program
^~~~~~~

Not used: C:\Program
compilation terminated.

exit status 1
Error compiling for board Arduino Yún w/ XInput.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


It gives this error when using the xinput board and the regular board.

I think what I need to do is remove the bootloader for avrdude any ideas how to do this for a leonardo?

I fixed it, I had to go into appdata and remove the arduino15 folder

Compiler errors don't involve boot loaders.

Why are you now compiling for a Yun?

Anyway, you can remove the boot loader by loading a sketch via ICSP (programmer) or fix the boot loader by burning it via ICSP.

PS
great that you fixed it, I was just typing the above.

If you have a need to re-flash the ATmega16U2 chip with the stock firmware to restore the Arduino UNO back to normal, this is often done on the command line using avrdude or dfu-programmer, or with the Windows program Flip. The easier way for me is to just use the Arduino IDE