Skip to content

USBCON not definied with a different boards.txt #18

Closed
@NicoHood

Description

@NicoHood

Using the board definitions for another board does not define USBCON and you get a compile error for the HID-Project:
https://github.com/NicoHood/HID/tree/dev_2_4
https://github.com/NicoHood/HoodLoader2

This also applies for 32u4 (mostly a copy of leonardo, just different upload speed).

This was tested without and with .a linkage!

Note:
This also applies to the MCU type:
Arduino/sketchbook/libraries/PinChangeInterrupt/src/PinChangeInterruptBoards.h:97:2: error: #error PinChangeInterrupt library does not support this MCU. #error PinChangeInterrupt library does not support this MCU.

Comparison:






Build options changed, rebuilding all
"/Arduino/Arduino/build/linux/work/hardware/tools/avr/bin/avr-g++" -w -x c++ -M -MG -MP -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_HOODLOADER2 -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Nico Hood"' '-DUSB_PRODUCT="HoodLoader2 32u4"' -DMAGIC_KEY_POS=(RAMEND-1) -DIO_MCU_RESET_PIN=4  "/tmp/buildb84c392175987be7c846c2e342599d63.tmp/sketch/Remote_USB_MCU_2.ino.cpp"
"/Arduino/Arduino/build/linux/work/hardware/tools/avr/bin/avr-g++" -w -x c++ -M -MG -MP -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_HOODLOADER2 -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Nico Hood"' '-DUSB_PRODUCT="HoodLoader2 32u4"' -DMAGIC_KEY_POS=(RAMEND-1) -DIO_MCU_RESET_PIN=4 "-I/Arduino/Arduino/build/linux/work/hardware/arduino/avr/cores/arduino" "-I/Arduino/Arduino/build/linux/work/hardware/arduino/avr/variants/leonardo" "-I/Arduino/sketchbook/libraries/HID-Project/src" "-I/Arduino/sketchbook/libraries/PinChangeInterrupt/src" "-I/Arduino/sketchbook/libraries/IRLremote/src" "-I/Arduino/sketchbook/libraries/FastLED" "/tmp/buildb84c392175987be7c846c2e342599d63.tmp/sketch/Remote_USB_MCU_2.ino.cpp"
In file included from Remote_USB_MCU_2.ino:25:0:
/Arduino/sketchbook/libraries/HID-Project/src/HID-Project.h:33:2: error: #error "This is not an USB AVR or you use an old version of the IDE."
 #error "This is not an USB AVR or you use an old version of the IDE."
  ^


Build options changed, rebuilding all
"/Arduino/Arduino/build/linux/work/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -M -MG -MP -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"'  "/tmp/buildb84c392175987be7c846c2e342599d63.tmp/sketch/Remote_USB_MCU_2.ino.cpp"
"/Arduino/Arduino/build/linux/work/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -M -MG -MP -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-I/Arduino/Arduino/build/linux/work/hardware/arduino/avr/cores/arduino" "-I/Arduino/Arduino/build/linux/work/hardware/arduino/avr/variants/leonardo" "-I/Arduino/sketchbook/libraries/FastLED" "-I/Arduino/sketchbook/libraries/HID-Project/src" "-I/Arduino/sketchbook/libraries/PinChangeInterrupt/src" "-I/Arduino/sketchbook/libraries/IRLremote/src" "/tmp/buildb84c392175987be7c846c2e342599d63.tmp/sketch/Remote_USB_MCU_2.ino.cpp"
"/Arduino/Arduino/build/linux/work/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -M -MG -MP -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-I/Arduino/Arduino/build/linux/work/hardware/arduino/avr/cores/arduino" "-I/Arduino/Arduino/build/linux/work/hardware/arduino/avr/variants/leonardo" "-I/Arduino/sketchbook/libraries/FastLED" "-I/Arduino/sketchbook/libraries/HID-Project/src" "-I/Arduino/sketchbook/libraries/PinChangeInterrupt/src" "-I/Arduino/sketchbook/libraries/IRLremote/src" "/tmp/buildb84c392175987be7c846c2e342599d63.tmp/sketch/Remote_USB_MCU_2.ino.cpp"
"/Arduino/Arduino/build/linux/work/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -M -MG -MP -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-I/Arduino/Arduino/build/linux/work/hardware/arduino/avr/cores/arduino" "-I/Arduino/Arduino/build/linux/work/hardware/arduino/avr/variants/leonardo" "-I/Arduino/sketchbook/libraries/HID-Project/src" "-I/Arduino/sketchbook/libraries/FastLED" "-I/Arduino/sketchbook/libraries/PinChangeInterrupt/src" "-I/Arduino/sketchbook/libraries/IRLremote/src" "/tmp/buildb84c392175987be7c846c2e342599d63.tmp/sketch/Remote_USB_MCU_2.ino.cpp"

[...]

Sketch uses 14,458 bytes (50%) of program storage space. Maximum is 28,672 bytes.
Global variables use 656 bytes (25%) of dynamic memory, leaving 1,904 bytes for local variables. Maximum is 2,560 bytes.

This line is totally missed:
-c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions