Compiling Blinky on Mavericks

Status
Not open for further replies.
Hi,

I have just received my Teensy 3.1 in the mail, and I am eager to get started. This is my first time with something like this, so I am following "Getting Started" on the homepage very carefully. However, when I try to compile Blinky, it fails:

Code:
Michael-Knudsens-Mac-Developer:blinky micknudsen$ make

-------- begin --------
avr-gcc (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Compiling C: blinky.c
avr-gcc -c -mmcu=atmega32u4         -I. -gdwarf-2 -DF_CPU=16000000UL -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=./blinky.lst  -std=gnu99 -MMD -MP -MF .dep/blinky.o.d blinky.c -o blinky.o 

Compiling C: usb_debug_only.c
avr-gcc -c -mmcu=atmega32u4         -I. -gdwarf-2 -DF_CPU=16000000UL -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=./usb_debug_only.lst  -std=gnu99 -MMD -MP -MF .dep/usb_debug_only.o.d usb_debug_only.c -o usb_debug_only.o 
usb_debug_only.c:96:24: error: variable 'device_descriptor' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
 static uint8_t PROGMEM device_descriptor[] = {
                        ^
usb_debug_only.c:113:24: error: variable 'hid_report_descriptor' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
 static uint8_t PROGMEM hid_report_descriptor[] = {
                        ^
usb_debug_only.c:128:24: error: variable 'config1_descriptor' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
 static uint8_t PROGMEM config1_descriptor[CONFIG1_DESC_SIZE] = {
                        ^
usb_debug_only.c:175:52: error: variable 'string0' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
 static struct usb_string_descriptor_struct PROGMEM string0 = {
                                                    ^
usb_debug_only.c:180:52: error: variable 'string1' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
 static struct usb_string_descriptor_struct PROGMEM string1 = {
                                                    ^
usb_debug_only.c:185:52: error: variable 'string2' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
 static struct usb_string_descriptor_struct PROGMEM string2 = {
                                                    ^
usb_debug_only.c:198:11: error: variable 'descriptor_list' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
 } PROGMEM descriptor_list[] = {
           ^
make: *** [usb_debug_only.o] Error 1

Any ideas what could possibly be wrong? I am running Mac OS X Mavericks 10.9.1. Any help is greatly appreciated. Thanks!

/Michael Knudsen, Denmark
 
Compiling blinky with what ?
Your output does not look like the output from the Arduino IDE. I'd recomment starting with that!

There are excellent IDE alternaives to the Arduino IDE available that will make developing code a breeze.
E.G the
  • Arduino Eclipse Plugin/Arduino Eclipse IDE
  • embedXcode
 
Thanks for you help. I just tried compiling the code in a Terminal as suggested on the PJRC webpage. Never heard of the Arduino IDE before, but it seems to be capable of doing everything I need. Never got Blinky to work, though, but that doesn't matter. It was just for testing purposes.
 
Ahhh..now I get it. The Teensy 3.x are relatively new boards with an Arm Cortex M4 processor. I believe that the instructions are aimed at the older Teensy 2 and ++2 boards that employ an Atmel processor. Naturally the AVR-GCC complains ;-)

If you want to program closer to bare metal with, or without using Arduino libraries, there are several people here on the board that program Teensy 3.x using makefiles and the Arm Toolchain.
If that does not float your boat, start with the Arduino IDE. If you are used to a real IDE such as XCode then likely you'll soon outgrow the Arduino IDE and you may want to check out embedXcode.

I personally use the Arduino Eclipse IDE and all but abandoned the Arduino IDE by now.
 
Last edited:
Status
Not open for further replies.
Back
Top