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

Thread: Problem compiling ILI9341 for Teensy4.0

  1. #1
    Junior Member
    Join Date
    Sep 2021
    Posts
    2

    Problem compiling ILI9341 for Teensy4.0

    Hello.

    I had a project made for Arduino Uno. Due to performance limitations, I decided to change the board to Teensy4.0

    I installed the Teensyduino, and then I am trying to follow these instructions:

    https://www.pjrc.com/store/display_ili9341.html

    I also installed the optimized library from here:

    https://github.com/PaulStoffregen/IL...leases/tag/1.0

    And then I updated the constructor as required by the documentation:

    #include "SPI.h"
    #include "ILI9341_t3.h"

    /*// For the Adafruit shield, these are the default.
    #define TFT_DC 9
    #define TFT_CS 10

    // Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
    ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC);
    */

    #define TFT_DC 20
    #define TFT_CS 21
    #define TFT_RST 255 // 255 = unused, connect to 3.3V
    #define TFT_MOSI 7
    #define TFT_SCLK 14
    #define TFT_MISO 12
    ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC, TFT_RST, TFT_MOSI, TFT_SCLK, TFT_MISO);


    Now, as I am trying to compile, I get these errors:

    *******************

    Arduino: 1.8.16 (Windows 7), TD: 1.55, Board: "Teensy 4.0, Serial, 600 MHz, Faster, US English"

    In file included from E:\Radu\Documents\ays\v2\ILI9341_t3-1.0\examples\graphicstest\graphicstest.ino:18:0:

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h: In member function 'void ILI9341_t3::waitFifoNotFull()':

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:178:9: error: 'KINETISK_SPI0' was not declared in this scope

    sr = KINETISK_SPI0.SR;

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h: In member function 'void ILI9341_t3::waitFifoEmpty()':

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:187:9: error: 'KINETISK_SPI0' was not declared in this scope

    sr = KINETISK_SPI0.SR;

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h: In member function 'void ILI9341_t3::waitTransmitComplete()':

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:193:12: error: 'KINETISK_SPI0' was not declared in this scope

    while (!(KINETISK_SPI0.SR & SPI_SR_TCF)) ; // wait until final output done

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:193:31: error: 'SPI_SR_TCF' was not declared in this scope

    while (!(KINETISK_SPI0.SR & SPI_SR_TCF)) ; // wait until final output done

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:194:9: error: 'KINETISK_SPI0' was not declared in this scope

    tmp = KINETISK_SPI0.POPR; // drain the final RX FIFO word

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h: In member function 'void ILI9341_t3::writecommand_cont(uint8_t)':

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:197:3: error: 'KINETISK_SPI0' was not declared in this scope

    KINETISK_SPI0.PUSHR = c | (pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:197:67: error: 'SPI_PUSHR_CTAS' was not declared in this scope

    KINETISK_SPI0.PUSHR = c | (pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:197:71: error: 'SPI_PUSHR_CONT' was not declared in this scope

    KINETISK_SPI0.PUSHR = c | (pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h: In member function 'void ILI9341_t3::writedata8_cont(uint8_t)':

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:201:3: error: 'KINETISK_SPI0' was not declared in this scope

    KINETISK_SPI0.PUSHR = c | (pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:201:64: error: 'SPI_PUSHR_CTAS' was not declared in this scope

    KINETISK_SPI0.PUSHR = c | (pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:201:68: error: 'SPI_PUSHR_CONT' was not declared in this scope

    KINETISK_SPI0.PUSHR = c | (pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h: In member function 'void ILI9341_t3::writedata16_cont(uint16_t)':

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:205:3: error: 'KINETISK_SPI0' was not declared in this scope

    KINETISK_SPI0.PUSHR = d | (pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:205:64: error: 'SPI_PUSHR_CTAS' was not declared in this scope

    KINETISK_SPI0.PUSHR = d | (pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:205:68: error: 'SPI_PUSHR_CONT' was not declared in this scope

    KINETISK_SPI0.PUSHR = d | (pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h: In member function 'void ILI9341_t3::writecommand_last(uint8_t)':

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:210:3: error: 'KINETISK_SPI0' was not declared in this scope

    KINETISK_SPI0.SR = SPI_SR_TCF;

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:210:22: error: 'SPI_SR_TCF' was not declared in this scope

    KINETISK_SPI0.SR = SPI_SR_TCF;

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:211:67: error: 'SPI_PUSHR_CTAS' was not declared in this scope

    KINETISK_SPI0.PUSHR = c | (pcs_command << 16) | SPI_PUSHR_CTAS(0);

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h: In member function 'void ILI9341_t3::writedata8_last(uint8_t)':

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:216:3: error: 'KINETISK_SPI0' was not declared in this scope

    KINETISK_SPI0.SR = SPI_SR_TCF;

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:216:22: error: 'SPI_SR_TCF' was not declared in this scope

    KINETISK_SPI0.SR = SPI_SR_TCF;

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:217:64: error: 'SPI_PUSHR_CTAS' was not declared in this scope

    KINETISK_SPI0.PUSHR = c | (pcs_data << 16) | SPI_PUSHR_CTAS(0);

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h: In member function 'void ILI9341_t3::writedata16_last(uint16_t)':

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:222:3: error: 'KINETISK_SPI0' was not declared in this scope

    KINETISK_SPI0.SR = SPI_SR_TCF;

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:222:22: error: 'SPI_SR_TCF' was not declared in this scope

    KINETISK_SPI0.SR = SPI_SR_TCF;

    ^

    C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3/ILI9341_t3.h:223:64: error: 'SPI_PUSHR_CTAS' was not declared in this scope

    KINETISK_SPI0.PUSHR = d | (pcs_data << 16) | SPI_PUSHR_CTAS(1);

    ^

    Multiple libraries were found for "ILI9341_t3.h"

    Used: C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3

    Not used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\ILI934 1_t3

    Not used: C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3-1.0

    Error compiling for board Teensy 4.0.



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


    **************************************


    Any ideas what's going on? Did I mess up something?

    Thanks

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,556
    Try deleting the ILI9341_t3 library from your documents folder and the like and use the current one that ships with each version of Teensuduino:
    That is the last things shown in your output:
    Code:
    Used: C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3
    
    Not used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\ILI934 1_t3
    
    Not used: C:\Users\radu\Documents\Arduino\libraries\ILI9341_ t3-1.0
    Try removing both of those I show in RED

  3. #3
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,543
    Also make sure you have Teensy 4.0 select from the Boards menu drop down.

  4. #4
    Junior Member
    Join Date
    Sep 2021
    Posts
    2
    you guys are awesome! Thanks! problem solved . today I learned something new.

Posting Permissions

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