USBAPI.h Error Wall

Hi everyone, I have never used an arduino before. I am just becoming familiar with it as I wanted to make a n64 controller adapter. However, even when trying to upload a blank sketch, I get a wall of errors, which I have no idea what it is. I know this is probably a very stupid question, but any help is really appreciated!

Here is the entire wall of text:

Arduino: 1.8.13 (Windows 10), Board: “Arduino Leonardo”

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:365:2: error: #error Unsupported value for USB_EP_SIZE

#error Unsupported value for USB_EP_SIZE

^~~~~

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:21:0:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\PluggableUSB.h:35:22: error: ‘USBSetup’ has not been declared

virtual bool setup(USBSetup& setup) = 0;

^~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\PluggableUSB.h:37:29: error: ‘USBSetup’ has not been declared

virtual int getDescriptor(USBSetup& setup) = 0;

^~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\PluggableUSB.h:57:21: error: ‘USBSetup’ has not been declared

int getDescriptor(USBSetup& setup);

^~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\PluggableUSB.h:58:14: error: ‘USBSetup’ has not been declared

bool setup(USBSetup& setup);

^~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp: In function ‘u8 USB_SendSpace(u8)’:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:254:9: error: ‘USB_EP_SIZE’ was not declared in this scope

return USB_EP_SIZE - FifoByteCount();

^~~~~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:254:9: note: suggested alternative: ‘USB_PID’

return USB_EP_SIZE - FifoByteCount();

^~~~~~~~~~~

USB_PID

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp: At global scope:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:332:2: error: ‘EP_TYPE_INTERRUPT_IN’ was not declared in this scope

EP_TYPE_INTERRUPT_IN, // CDC_ENDPOINT_ACM

^~~~~~~~~~~~~~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:332:2: note: suggested alternative: ‘EMPTY_INTERRUPT’

EP_TYPE_INTERRUPT_IN, // CDC_ENDPOINT_ACM

^~~~~~~~~~~~~~~~~~~~

EMPTY_INTERRUPT

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:333:2: error: ‘EP_TYPE_BULK_OUT’ was not declared in this scope

EP_TYPE_BULK_OUT, // CDC_ENDPOINT_OUT

^~~~~~~~~~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:334:2: error: ‘EP_TYPE_BULK_IN’ was not declared in this scope

EP_TYPE_BULK_IN, // CDC_ENDPOINT_IN

^~~~~~~~~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:374:28: error: ‘USBSetup’ was not declared in this scope

bool ClassInterfaceRequest(USBSetup& setup)

^~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:374:28: note: suggested alternative: ‘MSC_Setup’

bool ClassInterfaceRequest(USBSetup& setup)

^~~~~~~~

MSC_Setup

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:497:21: error: ‘USBSetup’ was not declared in this scope

bool SendDescriptor(USBSetup& setup)

^~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:497:21: note: suggested alternative: ‘MSC_Setup’

bool SendDescriptor(USBSetup& setup)

^~~~~~~~

MSC_Setup

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp: In function ‘void __vector_11()’:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:553:2: error: ‘USBSetup’ was not declared in this scope

USBSetup setup;

^~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:553:2: note: suggested alternative: ‘MSC_Setup’

USBSetup setup;

^~~~~~~~

MSC_Setup

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:557:25: error: request for member ‘bmRequestType’ in ‘setup’, which is of non-class type ‘void()’

u8 requestType = setup.bmRequestType;

^~~~~~~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:567:16: error: request for member ‘bRequest’ in ‘setup’, which is of non-class type ‘void()’

u8 r = setup.bRequest;

^~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:568:22: error: request for member ‘wValueL’ in ‘setup’, which is of non-class type ‘void()’

u16 wValue = setup.wValueL | (setup.wValueH << 8);

^~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:568:39: error: request for member ‘wValueH’ in ‘setup’, which is of non-class type ‘void()’

u16 wValue = setup.wValueL | (setup.wValueH << 8);

^~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:603:19: error: request for member ‘wValueL’ in ‘setup’, which is of non-class type ‘void()’

UDADDR = setup.wValueL | (1<<ADDEN);

^~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:607:29: error: ‘SendDescriptor’ cannot be used as a function

ok = SendDescriptor(setup);

^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:622:31: error: request for member ‘wValueL’ in ‘setup’, which is of non-class type ‘void()’

_usbConfiguration = setup.wValueL;

^~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:635:21: error: request for member ‘wLength’ in ‘setup’, which is of non-class type ‘void()’

InitControl(setup.wLength); // Max length of transfer

^~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:636:35: error: ‘ClassInterfaceRequest’ cannot be used as a function

ok = ClassInterfaceRequest(setup);

^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp: In function ‘void __vector_10()’:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:749:12: error: ‘EP_TYPE_CONTROL’ was not declared in this scope

InitEP(0,EP_TYPE_CONTROL,EP_SINGLE_64); // init ep0

^~~~~~~~~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp: At global scope:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:837:29: error: no ‘bool USBDevice_::wakeupHost()’ member function declared in class ‘USBDevice_’

bool USBDevice_::wakeupHost()

^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:857:30: error: no ‘bool USBDevice_::isSuspended()’ member function declared in class ‘USBDevice_’

bool USBDevice_::isSuspended()

^

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\PluggableUSB.cpp:21:0:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\PluggableUSB.h:35:22: error: ‘USBSetup’ has not been declared

virtual bool setup(USBSetup& setup) = 0;

^~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\PluggableUSB.h:37:29: error: ‘USBSetup’ has not been declared

virtual int getDescriptor(USBSetup& setup) = 0;

^~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\PluggableUSB.h:57:21: error: ‘USBSetup’ has not been declared

int getDescriptor(USBSetup& setup);

^~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\PluggableUSB.h:58:14: error: ‘USBSetup’ has not been declared

bool setup(USBSetup& setup);

^~~~~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\PluggableUSB.cpp:41:34: error: ‘int PluggableUSB_::getDescriptor’ is not a static data member of ‘class PluggableUSB_’

int PluggableUSB_::getDescriptor(USBSetup& setup)

^~~~~~~~

exit status 1
Error compiling for board Arduino Leonardo.

Welcome to the forum. Please read the sticky post at the top of the forum to learn how to post your questions and how to attach your text if it is too large. If it is less than 9k, you can use code tags and put it inline.

It helps people help you. Few people are going to copy the text of the link and paste it into a browser.

Maybe edit your post and attach the error file?

Thanks, Ill update the post now.

Start with the first error:

Arduino: 1.8.13 (Windows 10), Board: "Arduino Leonardo"

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:365:2: error: #error Unsupported value for USB_EP_SIZE

 #error Unsupported value for USB_EP_SIZE

  ^~~~~

This may be related to an error further down:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp: In function 'u8 USB_SendSpace(u8)':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\USBCore.cpp:254:9: error: 'USB_EP_SIZE' was not declared in this scope

  return USB_EP_SIZE - FifoByteCount();

         ^~~~~~~~~~~

Looks like a problem in the Arduino avr core. I'd try Tools->Board:->Board Manager... and (after the index is downloaded) select Type "Updatable" to see if there is an update for any of the cores you have installed.

Yes, there is something wrong with your installation of 1.8.13 and the associated cores. I recently upgraded to 1.8.13 and the Leonardo sketches compile correctly.

Reinstall 1.8.13. The latest boards package for Arduino AVR boards which includes the Leonardo is 1.8.3.

cattledog:
Yes, there is something wrong with your installation of 1.8.13 and the associated cores. I recently upgraded to 1.8.13 and the Leonardo sketches compile correctly.

Reinstall 1.8.13. The latest boards package for Arduino AVR boards which includes the Leonardo is 1.8.3.

Thank you, I'll try that as soon as possible