Uncanny Eyes with Teensy LC

Experimentalist

Well-known member
Hi All

It's been a while. I am trying to compile Uncanny Eyes for Teensy LC from:

origin https://github.com/adafruit/Uncanny_Eyes.git (fetch)origin https://github.com/adafruit/Uncanny_Eyes.git (push)

I am getting the following:

[Starting] Uploading sketch 'uncannyEyes.ino'
Please see the build logs in output path: u:\Git\Uncanny_Eyes\uncannyEyes\build
U:\Git\Uncanny_Eyes\uncannyEyes\uncannyEyes.ino: In function 'void drawEye(uint8_t, uint16_t, uint8_t, uint8_t, uint8_t, uint8_t)':
U:\Git\Uncanny_Eyes\uncannyEyes\uncannyEyes.ino:466:13: error: 'KINETISK_SPI0' was not declared in this scope
466 | while(KINETISK_SPI0.SR & 0xC000); // Wait for space in FIFO
| ^~~~~~~~~~~~~
U:\Git\Uncanny_Eyes\uncannyEyes\uncannyEyes.ino:467:7: error: 'KINETISK_SPI0' was not declared in this scope
467 | KINETISK_SPI0.PUSHR = p | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;
| ^~~~~~~~~~~~~
U:\Git\Uncanny_Eyes\uncannyEyes\uncannyEyes.ino:467:33: error: 'SPI_PUSHR_CTAS' was not declared in this scope
467 | KINETISK_SPI0.PUSHR = p | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;
| ^~~~~~~~~~~~~~
U:\Git\Uncanny_Eyes\uncannyEyes\uncannyEyes.ino:467:53: error: 'SPI_PUSHR_CONT' was not declared in this scope
467 | KINETISK_SPI0.PUSHR = p | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;
| ^~~~~~~~~~~~~~
U:\Git\Uncanny_Eyes\uncannyEyes\uncannyEyes.ino:504:3: error: 'KINETISK_SPI0' was not declared in this scope
504 | KINETISK_SPI0.SR |= SPI_SR_TCF; // Clear transfer flag
| ^~~~~~~~~~~~~
U:\Git\Uncanny_Eyes\uncannyEyes\uncannyEyes.ino:504:23: error: 'SPI_SR_TCF' was not declared in this scope; did you mean 'LPSPI_SR_TCF'?
504 | KINETISK_SPI0.SR |= SPI_SR_TCF; // Clear transfer flag
| ^~~~~~~~~~
| LPSPI_SR_TCF
Error during build: exit status 1
IntelliSense configuration already up to date. To manually rebuild your IntelliSense configuration run "Ctrl+Alt+I"
[Error] Uploading sketch 'uncannyEyes.ino': Exit with code=1






Any ideas greatly appreciated
 
Any ideas greatly appreciated
Looking at the errors and then confirming my suspicions. The adafruit library that you point to does not support the Teensy LC only the T3.x series. It specifically calls out the Teensy 3.1 or 3.2.

If you look in the ST7789 library that comes with teensyduino there is an uncanny eyes sketch but don't remember if it supports the LC but maybe.
 
Quick update:

Our ST7734_t3 github version of uncanneyEyes7735 does not currently compile on my machine.

Need to doublecheck - that is not just my install. But all of the graphic files appear to be at the root diretory of the sketch and not in a subdirectory graphics.
The config.h file still looks for these files in the subdirectory...

Edited config.h locally and it does built for T3.6...

As for the LC, the ST7735_t3, compiles without errors on the LC.

however, the current version of the program does not fit on the LC.
Code:
"C:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-gcc" -Os --specs=nano.specs -Wl,--gc-sections,--relax,--defsym=__rtc_localtime=1691142156 "-TC:\\Users\\kurte\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\0.59.2\\cores\\teensy3/mkl26z64.ld" -mthumb -mcpu=cortex-m0plus -fsingle-precision-constant -o "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\AAF0B5C94323C52366775CB53E940649/uncannyEyes7735.ino.elf" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\AAF0B5C94323C52366775CB53E940649\\sketch\\uncannyEyes7735.ino.cpp.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\AAF0B5C94323C52366775CB53E940649\\libraries\\SPI\\SPI.cpp.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\AAF0B5C94323C52366775CB53E940649\\libraries\\Adafruit_GFX_Library\\Adafruit_GFX.cpp.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\AAF0B5C94323C52366775CB53E940649\\libraries\\Adafruit_GFX_Library\\Adafruit_GrayOLED.cpp.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\AAF0B5C94323C52366775CB53E940649\\libraries\\Adafruit_GFX_Library\\Adafruit_SPITFT.cpp.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\AAF0B5C94323C52366775CB53E940649\\libraries\\Adafruit_GFX_Library\\glcdfont.c.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\AAF0B5C94323C52366775CB53E940649\\libraries\\Adafruit_BusIO\\Adafruit_BusIO_Register.cpp.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\AAF0B5C94323C52366775CB53E940649\\libraries\\Adafruit_BusIO\\Adafruit_I2CDevice.cpp.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\AAF0B5C94323C52366775CB53E940649\\libraries\\Adafruit_BusIO\\Adafruit_SPIDevice.cpp.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\AAF0B5C94323C52366775CB53E940649\\libraries\\Wire\\Wire.cpp.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\AAF0B5C94323C52366775CB53E940649\\libraries\\Wire\\WireIMXRT.cpp.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\AAF0B5C94323C52366775CB53E940649\\libraries\\Wire\\WireKinetis.cpp.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\AAF0B5C94323C52366775CB53E940649\\libraries\\Wire\\utility\\twi.c.o" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\AAF0B5C94323C52366775CB53E940649\\libraries\\ST7735_t3\\ST7735_t3.a" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\AAF0B5C94323C52366775CB53E940649/core\\core.a" "-LC:\\Users\\kurte\\AppData\\Local\\Temp\\arduino\\sketches\\AAF0B5C94323C52366775CB53E940649" -larm_cortexM0l_math -lm -lstdc++
c:/users/kurte/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\kurte\AppData\Local\Temp\arduino\sketches\AAF0B5C94323C52366775CB53E940649/uncannyEyes7735.ino.elf section `.text' will not fit in region `FLASH'
c:/users/kurte/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: region `FLASH' overflowed by 122660 bytes
collect2.exe: error: ld returned 1 exit status
Multiple libraries were found for "ST7735_t3.h"
  Used: D:\github\ST7735_t3
  Not used: C:\Users\kurte\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.2\libraries\ST7735_t3

Edit: looks like it was just a version I had mucked up earlier... The checked in version appears to build without error for T4...
And still fails for LC.
 
Last edited:
And even if it fits in the LC, IIRC, the graphics optimization that the original Uncanny Eyes does for Teensy 3.2, 3.5, and 3.6 is not available on the LC.
 
The main one is: github.com/PaulStoffregen/ST7735_t3
Which covers both the 35 and the 89

And it is contained in the TeensyDuino releases
 
I think I've tried it in the past with the T4.x, but I'll check back later when I have more time. In my various configurations, I see I have to reduce the SPI frequency because the OLED displays I have from Adafruit glitch if you run it at faster SPI speeds:
Code:
#define SPI_FREQ 11000000U
 
I have several uncanny Eyes setups;
  • Teensy 3.5 using the original uncanny Eyes with SSD1351 (OLED 128x128);
  • Teensy 3.2 using the original uncanny Eyes with ST7735 (TFT 128x128);
  • I think I've tried Teensy 4.0 or 4.1 using the ST7735_t3/examples/uncannyEyes7735: with the ST7735 display (TFT 128x128);
  • Teensy 4.0 or 4.1 using the ST7735_t3/examples/uncannyEyes_async_st7789_240x240: with the ST7789 display (square 240x240);
  • Teensy 4.0 or 4.1 using Chris.nz's rewrite with the ST7789 display (square 240x240); (and)
  • Teensy 4.0 or 4.1 using Chris.nz's rewrite with the GC9A01A display (round 240x2400.

I wanted to remove the Teensy 3.5 from the breadboard and replace it with a Teensy 4.0 or 4.1. But first I made a test case with the ST7735_t3/examples/uncannyEyes7735 uncanny Eyes, configuring it for OLED and my pin defaults. It builds fine with source, but it doesn't display anything on the screen. I looked at the source for uncannyEyes7735.ino, and I discovered that it had been hardwired to using the 7735 displays with the following before config.h:
Code:
#define _ADAFRUIT_ST7735H_

So I removed this, so it would work with the SSD1531. I then get the following error:

Code:
uncannyEyes7735: In function 'void drawEye(uint8_t, uint16_t, uint8_t, uint8_t, uint8_t, uint8_t)':
uncannyEyes7735:390: error: 'displayType' {aka 'class Adafruit_SSD1351'} has no member named 'writeRect'; did you mean 'writeFillRect'?
  390 |     eye[e].display->writeRect(0, screenY, SCREEN_WIDTH, 1, colors);
      |                     ^~~~~~~~~
      |                     writeFillRect
'displayType' {aka 'class Adafruit_SSD1351'} has no member named 'writeRect'; did you mean 'writeFillRect'?

So if you wanted to use the OLED displays, you either need to fix this, or try to find a Teensy 3.2, 3.5, or 3.6.

Or alternatively with the Teensy 4.0/4.1:
  • Get one or two ST7735 128x128 TFT displays using the ST7735_t3/examples/uncannyEyes7735 source as base; (or)
  • Get one or two ST7789 240x240 square displays and use the ST7735_t3/examples/uncannyEyes_async_st7789_240x240: source as a base. The 240x240 display support normally requires using 1 SPI bus per display. On the Teensy 4.0, you have to solder wires underneath the Teensy to get to the second SPI bus. I believe you could use both displays on the same SPi bus, provided the displays have CS pins (some of the cheaper 240x240 displays don't have a CS pin), but I always use 2 SPI buses;
  • Get one or two ST7789 240x240 square displays or one or two GC9A01A round displays. Go over to using Chris.nz rewrite of the newer uncanny eye code meant for the Monster M4SK and Hallowing M4 along with my tweaking of his/her/their port. You can find the details in this thread https://forum.pjrc.com/threads/71068-Uncanny-Eyes-is-getting-expensive. Unfortunately I haven't done anything with uncanny Eyes since January 2023 or so, and Chris.nz hasn't posted since December 2022. The git repository for Chris's sources also has not been updated.
 
Last edited:
Thanks MichaelMeissner for taking your time to write a comprehensive response, much appreciated. I will try to resolve the error I think. If I have no luck I will have to find another use for those screens and buy some with the supported display drivers.
 
Sorry, the only SSD1351 I have is a waveshare one I purchased from Amazon about 4 years ago, and it is setup to run using I2C.
 
Back
Top