Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: Teensy 4.0 Compile Problem not seen with Teensy 3.2

  1. #1
    Junior Member
    Join Date
    Oct 2019
    Posts
    3

    Teensy 4.0 Compile Problem not seen with Teensy 3.2

    I am having an issue compiling the "Uncanny Eyes" sketch by Adafruit (https://github.com/adafruit/Uncanny_...ive/master.zip). If I select Teensy 3.2, the sketch compiles without an issue.
    I downloaded and installed Teensyduino on 9/7/2019. I think the other setup information and the error is detailed below:

    Arduino: 1.8.10 (Windows 10), TD: 1.48, Board: "Teensy 4.0, Serial, 600 MHz, Faster, US English"

    uncannyEyes: In function 'void drawEye(uint8_t, uint16_t, uint8_t, uint8_t, uint8_t, uint8_t)':
    uncannyEyes:409: error: 'KINETISK_SPI0' was not declared in this scope
    while(KINETISK_SPI0.SR & 0xC000); // Wait for space in FIFO

    ^

    uncannyEyes:410: error: 'KINETISK_SPI0' was not declared in this scope
    KINETISK_SPI0.PUSHR = p | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;

    ^

    uncannyEyes:410: error: 'SPI_PUSHR_CTAS' was not declared in this scope
    KINETISK_SPI0.PUSHR = p | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;

    ^

    uncannyEyes:410: error: 'SPI_PUSHR_CONT' was not declared in this scope
    KINETISK_SPI0.PUSHR = p | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;

    ^

    uncannyEyes:425: error: 'KINETISK_SPI0' was not declared in this scope
    KINETISK_SPI0.SR |= SPI_SR_TCF; // Clear transfer flag

    ^

    uncannyEyes:425: error: 'SPI_SR_TCF' was not declared in this scope
    KINETISK_SPI0.SR |= SPI_SR_TCF; // Clear transfer flag

    ^

    Multiple libraries were found for "SPI.h"
    Used: C:\Program
    Multiple libraries were found for "Adafruit_GFX.h"
    Used: C:\Users\jrobi\Documents\Arduino\libraries\Adafrui t_GFX_Library
    Multiple libraries were found for "Adafruit_SSD1351.h"
    Used: C:\Users\jrobi\Documents\Arduino\libraries\Adafrui t_SSD1351_library
    'KINETISK_SPI0' was not declared in this scope

    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,359
    The uncanny eyes program used a lot of Teensy 3.x specific optimizations for display that are completely different for Teensy 4.0.

    Some time ago, mjs513 improved that program to support the 240x240 displays that have since come out:


    I use the first one on the T4 with two 240x240 displays, with each display on a separate SPI bus (you have to solder wires to the pads underneath the Teensy to get access to the 2nd and 3rd SPI buses).

    I have not built the T4 to use the older 128x128 displays. That might be interesting to try (the second link is probably more appropriate for the 128x128 displays).

  3. #3
    Junior Member
    Join Date
    Oct 2019
    Posts
    3
    Thanks for this. If nothing else, I see that there are some new eyes for me to try.

  4. #4
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,284
    Thanks for the compliment but @KurtE did the work on the libraries to be able to use multiple SPI busses.

  5. #5
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,359
    Quote Originally Posted by mjs513 View Post
    Thanks for the compliment but @KurtE did the work on the libraries to be able to use multiple SPI busses.
    Sorry about that. It was your site that I picked it up from. So I assumed you had done the work, but yeah, now that I think on it, KurtE did do most of the work. After awhile it gets hard to track which person did the work.....

    It still would be nice if we could get the example files put into 1.49.

  6. #6
    Junior Member
    Join Date
    Oct 2019
    Posts
    3
    Two things:

    1) Adafruit's ItsyBitsy Express M4 compiled and ran the original sketch just fine (fine enough for me at any rate) modulo some pin reassignments. Perhaps it incorporates some of Teensy 3.2's optimizations as well.

    2) Whoever did the code, I tip my hat to. Very clear and very resilient to butchery , err, I mean, modification to adapt to what I wanted to do.

  7. #7
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,701
    @mjs513 @MichaelMeissner, ... - Actually we all did a lot of stuff and helped figure things out... With lots of hair pulling...

    One of these days I will get back to playing with it... Maybe for next Halloween

  8. #8
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,359
    Quote Originally Posted by jbrob View Post
    Two things:

    1) Adafruit's ItsyBitsy Express M4 compiled and ran the original sketch just fine (fine enough for me at any rate) modulo some pin reassignments. Perhaps it incorporates some of Teensy 3.2's optimizations as well.
    Phillip Burgess is the main author of it.

    In July 2018, he started adding support for the Adafruit M0 and M4 systems at the time for the two 128x128 displays (OLED and TFT). According to the comments in the source, the Adafruit boards use DMA, while Teensy 3.x uses SPI FIFO support. The Teensy optimizations originally came from Paul Stoffregen's optimizations for the ILI9341 display, and similar optimizations were then ported to other displays, including the TFT displays using the ST7735 controller and the OLED displays using the SSD1351 controller (and other controllers since then).

    Quote Originally Posted by jbrob View Post
    2) Whoever did the code, I tip my hat to. Very clear and very resilient to butchery , err, I mean, modification to adapt to what I wanted to do.
    There are 4 main strains of uncanny eyes at this time:
    • Teensy 3.2/3.5/3.6 and Adafruit M0/M4 boards (M0/M4 Express, Hallowing M0, etc.) with the original code supporting the 128x128 displays;
    • A version that runs on Raspberry Pi-2/Pi-3 boards (the Pi-zero isn't really fast enough to run it, and the Pi-4 appears to have changed things about, so it doesn't run out of the box);
    • The new code for the 240x240 display that only runs on the Adafruit M4 boards (M4 Express, Hallowing M4);
    • The version for the Teensy 4, based on the original code.


    The new M4 version uses a completely different way to draw the eyes. It is more configurable (due in part to the Adafruit M4 boards having flash memory that acts as a removable disk drive so you can change parameters without rebuilding), but due to having 4x the data for the new displays, it can't do everything in memory. Instead it reads part of the image and displays that, and goes back for the next part to process. Each eye is handled separately. And it is currently tied to the DMA subsystem on the Adafruit M4 boards.

    The Teensy 4 version instead of using one SPI bus, and switching back and forth between the eyes, uses two separate buses. I believe unlike the Teensy 3 version, you can't use other SPI devices in the dead time between doing the displays.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •