Closed KirAsh4 closed 11 years ago
Let me check on it, and see what's up - I just made a ton of changes over the past week, focusing primarily on 1.5.x, and may have accidentally replaced that file in 1.0.x.
Issue fixed by a079d7056191a9d2a155644e98e5d14e1f3c6a89
Using 1.5.2, with a fresh downloaded archive from github, and attempting to compile the Blink sketch on the 1287 board, I get this:
C:\Program Files (x86)\arduino-1.5.2\hardware\tools\avr\bin\avr-g++ -c -g -Os -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=at90usb1287 -DF_CPU=16000000L -DARDUINO=152 -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARCH=ARCH_AVR8 -DUSE_FLASH_DESCRIPTORS -DF_USB=16000000L -IC:\Program Files (x86)\arduino-1.5.2\hardware\DynamicPerception\avr\cores\AT90USB -IC:\Program Files (x86)\arduino-1.5.2\hardware\DynamicPerception\avr\variants\at90usb128X C:\Users\ASHLEY~1.KIR\AppData\Local\Temp\build1191385476510116606.tmp\Blink.cpp -o C:\Users\ASHLEY~1.KIR\AppData\Local\Temp\build1191385476510116606.tmp\Blink.cpp.o
<command-line>: warning: missing whitespace after the macro name
<command-line>: warning: missing whitespace after the macro name
C:\Program Files (x86)\arduino-1.5.2\hardware\tools\avr\bin\avr-gcc -c -g -assembler-with-cpp -mmcu=at90usb1287 -DF_CPU=16000000L -DARDUINO=152 -DARDUINO_{build.board} -D{build.board} -DARDUINO_ARCH_{build.arch} -DARCH=ARCH_AVR8 -DUSE_FLASH_DESCRIPTORS -DF_USB=16000000L -IC:\Program Files (x86)\arduino-1.5.2\hardware\DynamicPerception\avr\cores\AT90USB -IC:\Program Files (x86)\arduino-1.5.2\hardware\DynamicPerception\avr\variants\at90usb128X C:\Program Files (x86)\arduino-1.5.2\hardware\DynamicPerception\avr\cores\AT90USB\LUFA\Platform\UC3\Exception.S -o C:\Users\ASHLEY~1.KIR\AppData\Local\Temp\build1191385476510116606.tmp\Exception.S.o
<command-line>: warning: missing whitespace after the macro name
<command-line>: error: macro names must be identifiers
<command-line>: warning: missing whitespace after the macro name
If I do the same thing under 1.0.5 it compiles successfully. However what I'm noticing is that the exact same Blink sketch compiles into 7,234 bytes on the 1,087, when it's 1,084 bytes when compiled for an Uno. That's a rather large growth in size there.
I suggest using the nightly build, not 1.5.2 - as indicated here: https://github.com/DynamicPerception/ArduinoAT90USB/blob/master/README.md 1.5.2 does not fully implement the 3rd party hardware, and has numerous issues with it. Notice how several variables are not expanded - this has been fixed in later 1.5.x versions. As for whitespace in arguments on windows, only the Arduino IDE team can fix that, the build is process is behaving properly on OSX.
The Uno does not support USB. Therefore, sketches will be smaller for the Unos than the 1287 on 1.0.x - as the 1287 has a lot of USB code built in. (More on that below.) I'm finding that our 1.5.x build produces smaller complex sketches than 1.0.x builds on the 1287. For example, a complex sketch that is 38,370 bytes in 1.0.2 is 32,600 bytes in the latest 1.5.x nightly build on an AT90USB1287. Blink in 1.0.1 is 7,234 and 1,1334 bytes for the 1287 in 1.5 nightly. The reason is that we don't (yet) provide an option to bring in the USB Serial, Mouse, and Keyboard device classes in 1.5.x.
1.0.x automatically creates a USB Serial interface (Serial object, Serial1 is the first non-USB serial) and Mouse, and Keyboard device classes. 1.5.x does not yet do that - we are working on it now, but it will be a build-selectable option (Based on board type - you will be able to select one with these objects, and one without).
Ok, fair 'nuf. As my project that will be using a 1286 is still a ways away, I'm not too pressed to get everything working right away. But it's nice to occasionally see if my code, which is currently running on an Uno, will also compile for the 1286 ... and I'm sad to say, it does not. But I suspect because 1.5.x is still beta, that some of the errors I'm seeing aren't related to your code, but more with the IDE's. Things like the SS pin being undefined. :)
Well, SS pin undefined would be our bug - I'm opening a separate ticket, so that we have individual solutions trackable. I'm going to open one for several pins undefined (like i2c pins =)
FYI - this also allows me to close individual issues as they are resolved.
I posted this on the Arduino forum as well. I grabbed the source from about 3 days ago and installed it. Made the necessary changes to the various files and all (this isn't my first rodeo with cores that don't come with the IDE.) I opened the IDE, selected the 'AT90USB1287 16MHz' board, opened the blink sketch and tried compiling it and was presented with a lovely error instead:
In file included from C:\Program Files (x86)\arduino-1.0.5\hardware\arduino\cores\AT90USB/LUFA/usb_cdc_hid.h:40, from C:\Program Files (x86)\arduino-1.0.5\hardware\arduino\cores\AT90USB/usb_api.h:37, from C:\Program Files (x86)\arduino-1.0.5\hardware\arduino\cores\AT90USB/Arduino.h:184, from sketch_jun09b.ino:1: C:\Program Files (x86)\arduino-1.0.5\hardware\arduino\cores\AT90USB/LUFA/Board.h:143:2: error: #error unsupported board
Selecting the '1287 USBKey 16MHz' board gave the same error, but selecting the 646, it compiles without as much as a burp. Something's up ...