PDA

View Full Version : Compile-Error when wanting to use Adadruits SSD1331 with Teensy 3.0



local_dani_21
01-04-2013, 02:57 PM
Hi all

Since adafruits 0.96"-OLED-Module http://learn.adafruit.com/096-mini-color-oledworks with 3.3V I thought to give the new teensy 3.0 a try. When trying to compile her test-application that comes with the library (File->Examples->Adafruit_SSD1331->test) on http://learn.adafruit.com/096-mini-color-oled/downloads:,
the beta10 of Paul's Arduino 1.0.3 port (Mac, 10.6.8) stops with the following errors (I can't post all of the code because of forum-restrictions):

.
.
.

/Users/toddd/Downloads/Arduino-1.0.3-teensy3beta10.app/Contents/Resources/Java/hardware/tools/arm-none-eabi/bin/arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=103 -mthumb -nostdlib -D__MK20DX128__ -fno-rtti -felide-constructors -std=gnu++0x -DUSB_SERIAL -DLAYOUT_GERMAN_SWISS -I/Users/toddd/Downloads/Arduino-1.0.3-teensy3beta10.app/Contents/Resources/Java/hardware/teensy/cores/teensy3 /Users/toddd/Downloads/Arduino-1.0.3-teensy3beta10.app/Contents/Resources/Java/hardware/teensy/cores/teensy3/Print.cpp -o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/Print.cpp.o
/Users/toddd/Downloads/Arduino-1.0.3-teensy3beta10.app/Contents/Resources/Java/hardware/tools/arm-none-eabi/bin/arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=103 -mthumb -nostdlib -D__MK20DX128__ -fno-rtti -felide-constructors -std=gnu++0x -DUSB_SERIAL -DLAYOUT_GERMAN_SWISS -I/Users/toddd/Downloads/Arduino-1.0.3-teensy3beta10.app/Contents/Resources/Java/hardware/teensy/cores/teensy3 /Users/toddd/Downloads/Arduino-1.0.3-teensy3beta10.app/Contents/Resources/Java/hardware/teensy/cores/teensy3/Stream.cpp -o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/Stream.cpp.o
/Users/toddd/Downloads/Arduino-1.0.3-teensy3beta10.app/Contents/Resources/Java/hardware/tools/arm-none-eabi/bin/arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=103 -mthumb -nostdlib -D__MK20DX128__ -fno-rtti -felide-constructors -std=gnu++0x -DUSB_SERIAL -DLAYOUT_GERMAN_SWISS -I/Users/toddd/Downloads/Arduino-1.0.3-teensy3beta10.app/Contents/Resources/Java/hardware/teensy/cores/teensy3 /Users/toddd/Downloads/Arduino-1.0.3-teensy3beta10.app/Contents/Resources/Java/hardware/teensy/cores/teensy3/usb_inst.cpp -o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/usb_inst.cpp.o
/Users/toddd/Downloads/Arduino-1.0.3-teensy3beta10.app/Contents/Resources/Java/hardware/tools/arm-none-eabi/bin/arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=103 -mthumb -nostdlib -D__MK20DX128__ -fno-rtti -felide-constructors -std=gnu++0x -DUSB_SERIAL -DLAYOUT_GERMAN_SWISS -I/Users/toddd/Downloads/Arduino-1.0.3-teensy3beta10.app/Contents/Resources/Java/hardware/teensy/cores/teensy3 /Users/toddd/Downloads/Arduino-1.0.3-teensy3beta10.app/Contents/Resources/Java/hardware/teensy/cores/teensy3/WMath.cpp -o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/WMath.cpp.o
/Users/toddd/Downloads/Arduino-1.0.3-teensy3beta10.app/Contents/Resources/Java/hardware/tools/arm-none-eabi/bin/arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=103 -mthumb -nostdlib -D__MK20DX128__ -fno-rtti -felide-constructors -std=gnu++0x -DUSB_SERIAL -DLAYOUT_GERMAN_SWISS -I/Users/toddd/Downloads/Arduino-1.0.3-teensy3beta10.app/Contents/Resources/Java/hardware/teensy/cores/teensy3 /Users/toddd/Downloads/Arduino-1.0.3-teensy3beta10.app/Contents/Resources/Java/hardware/teensy/cores/teensy3/WString.cpp -o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/WString.cpp.o
/Users/toddd/Downloads/Arduino-1.0.3-teensy3beta10.app/Contents/Resources/Java/hardware/tools/arm-none-eabi/bin/arm-none-eabi-gcc -Os -Wl,--gc-sections -mcpu=cortex-m4 -mthumb -T/Users/toddd/Downloads/Arduino-1.0.3-teensy3beta10.app/Contents/Resources/Java/hardware/teensy/cores/teensy3/mk20dx128.ld -o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/test.cpp.elf /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/test.cpp.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/Adafruit_GFX/glcdfont.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/Adafruit_GFX/Adafruit_GFX.cpp.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/Adafruit_SSD1131/Adafruit_SSD1331.cpp.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/SPI/SPI.cpp.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/analog.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/eeprom.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/keylayouts.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/mk20dx128.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/nonstd.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/pins_teensy.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/serial1.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/serial2.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/serial3.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/touch.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/usb_desc.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/usb_dev.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/usb_joystick.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/usb_keyboard.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/usb_mem.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/usb_midi.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/usb_mouse.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/usb_seremu.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/usb_serial.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/yield.c.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/HardwareSerial1.cpp.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/HardwareSerial2.cpp.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/HardwareSerial3.cpp.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/IPAddress.cpp.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/main.cpp.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/Print.cpp.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/Stream.cpp.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/usb_inst.cpp.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/WMath.cpp.o /var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp/WString.cpp.o -L/var/folders/SY/SYq1F2y22RWFOU+1YsXSWU+++TQ/-Tmp-/build7534551861965232338.tmp -lm
Adafruit_SSD1131/Adafruit_SSD1331.cpp.o: In function `Adafruit_GFX':
/Users/toddd/Documents/Arduino/libraries/Adafruit_GFX/Adafruit_GFX.h:28: undefined reference to `vtable for Adafruit_GFX'
collect2: ld returned 1 exit status


Do you have any idea what I would have to change to get it to run? Thanks!

Dani

PaulStoffregen
01-04-2013, 03:10 PM
Maybe this?

http://forum.pjrc.com/threads/10-Adafruit-PCD8544-LCD-library?p=87&viewfull=1#post87

Please confirm if this works? At some point, we really need to get Adafruit to update this library.

local_dani_21
01-04-2013, 04:43 PM
Thanks, Paul.

I tried to insert the posted edits but don't know what to do with the mentioned

In Makefile add
Code:
-DARDUINO=100

since I don't know what file is meant by that when using the Arduino IDE.

Doing everything except the above, the errors change to:

In file included from test.pde:39:
/Users/toddd/Documents/Arduino/libraries/Adafruit_SSD1131/Adafruit_SSD1331.h:17: warning: "swap" redefined
/Users/toddd/Documents/Arduino/libraries/Adafruit_GFX/Adafruit_GFX.h:26: note: this is the location of the previous definition
In file included from test.pde:38:
/Users/toddd/Documents/Arduino/libraries/Adafruit_GFX/Adafruit_GFX.h:27: error: expected class-name before '(' token
test:49: error: cannot allocate an object of abstract type 'Adafruit_SSD1331'
/Users/toddd/Documents/Arduino/libraries/Adafruit_SSD1131/Adafruit_SSD1331.h:67: note: because the following virtual functions are pure within 'Adafruit_SSD1331':
/Users/toddd/Documents/Arduino/libraries/Adafruit_GFX/Adafruit_GFX.h:37: note: virtual void Adafruit_GFX::drawPixel(int16_t, int16_t, uint16_t)
test:49: error: cannot declare variable 'display' to be of abstract type 'Adafruit_SSD1331'
/Users/toddd/Documents/Arduino/libraries/Adafruit_SSD1131/Adafruit_SSD1331.h:67: note: since type 'Adafruit_SSD1331' has pure virtual functions
test.pde: In function 'void lcdTestPattern()':
test.pde:310: warning: large integer implicitly truncated to unsigned type
test.pde:312: warning: large integer implicitly truncated to unsigned type
test.pde:313: warning: large integer implicitly truncated to unsigned type
test.pde:314: warning: large integer implicitly truncated to unsigned type
test.pde:315: warning: large integer implicitly truncated to unsigned type
test.pde:316: warning: large integer implicitly truncated to unsigned type


Thanks for interpreting,

Dani

PS: The meantioned line 27 in the header file is where it has

virtual ~Adafruit_GFX() {} // force inclusion of vtable.

PaulStoffregen
01-04-2013, 04:55 PM
Could you post the edited Adafruit_SSD1331.h file?

Maybe it's a simple syntax error?

local_dani_21
01-04-2013, 08:46 PM
I changed the position of the line (see attached header-file)
virtual ~Adafruit_GFX() {} // force inclusion of vtable. to pack into the class Adafruit_GFX. Nevertheless, I still get compile-errors:

Cannot allocate an object of abstract type 'Adafruit_SSD1331'

In file included from test.pde:39:
/Users/toddd/Documents/Arduino/libraries/Adafruit_SSD1131/Adafruit_SSD1331.h:17: warning: "swap" redefined
/Users/toddd/Documents/Arduino/libraries/Adafruit_GFX/Adafruit_GFX.h:26: note: this is the location of the previous definition
test:49: error: cannot allocate an object of abstract type 'Adafruit_SSD1331'
/Users/toddd/Documents/Arduino/libraries/Adafruit_SSD1131/Adafruit_SSD1331.h:67: note: because the following virtual functions are pure within 'Adafruit_SSD1331':
/Users/toddd/Documents/Arduino/libraries/Adafruit_GFX/Adafruit_GFX.h:37: note: virtual void Adafruit_GFX::drawPixel(int16_t, int16_t, uint16_t)
test:49: error: cannot declare variable 'display' to be of abstract type 'Adafruit_SSD1331'
/Users/toddd/Documents/Arduino/libraries/Adafruit_SSD1131/Adafruit_SSD1331.h:67: note: since type 'Adafruit_SSD1331' has pure virtual functions

Thanks for going over it.
Dani

PS: This is the line 49 in test.ino that causes the error:
Adafruit_SSD1331 display = Adafruit_SSD1331(cs, dc, rst);

cmason
01-10-2013, 03:23 AM
So, this library (https://github.com/adafruit/Adafruit-SSD1331-OLED-Driver-Library-for-Arduino) and the given code:


Adafruit_SSD1331 display = Adafruit_SSD1331(1, 2, 3);

compiles fine for me with the modifications described in the previous thread (http://forum.pjrc.com/threads/10-Adafruit-PCD8544-LCD-library?p=87&viewfull=1#post87). I *think* the -DARDUINO=100 should already be done by the Arduino IDE; I don't use it so someone else will have to comment.

I've made a fork of their repo here (https://github.com/cmason1978/Adafruit-GFX-Library) which contains the fix.

-c

local_dani_21
01-10-2013, 02:26 PM
Great and many thanks especially for the repository!
I seem to have messed up something while trying to follow the instructions in the previous thread.

So in conclusion: Teensy 3.0 works perfectly with Adafruits 96x64 Pixel RGB OLED Display SSD1331 and can be used without any additional hardware components.
Dani

local_dani_21
01-10-2013, 03:05 PM
134Does anyone have an idea, why drawing images to SSD1331 takes a lot more time than when working with an arduino?
I set my teensy 3.0 to 96Mhz (with 24Mhz it's even slower). Is there anything that has to be done to get the full speed SPI? Does it matter which CS of the five available are used to read from the SD card?
Thanks, Dani

PaulStoffregen
01-10-2013, 09:00 PM
Has anyone submitted the fix as a pull request back to Adafruit?

cmason
01-11-2013, 08:43 AM
yes (https://github.com/adafruit/Adafruit-GFX-Library/pull/7), i have.

local_dani_21
01-11-2013, 11:00 PM
And I opened a forum thread (http://www.forums.adafruit.com/viewtopic.php?f=47&t=35996).

local_dani_21
01-12-2013, 09:47 PM
I measured that reading from the SD card is the process that takes so long (80%). Is there anything special about choosing the CS? Are CS0 to CS4 equivalent? According to the datasheet, it seems as if in master mode they behave all the same... Are there any known issues about reading from an SD card?

Thanks for pointing out.

Dani

local_dani_21
02-17-2013, 10:00 AM
Paul, you mentioned that you bought a few of adafruits displays. Have you ever gotten around to check their speed-issue with teensy 3.0? I would be very interested in your results. Thanks, Dani

PaulStoffregen
02-17-2013, 12:24 PM
Paul, you mentioned that you bought a few of adafruits displays. Have you ever gotten around to check their speed-issue with teensy 3.0?

I got 2 displays, but they're still unopened.

local_dani_21
10-15-2013, 10:27 AM
Hi Paul

I just realized that with the newest drivers from adafruit, the display shows the images very fast!

Sorry to bother you, Dani

PaulStoffregen
10-15-2013, 08:47 PM
Thanks for the followup. Glad it's working well. :)