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

Thread: Teensy 4 Compilation Problems

  1. #1
    Junior Member
    Join Date
    Aug 2019
    Location
    California
    Posts
    2

    Teensy 4 Compilation Problems

    I just got my new Teensy 4 (yay!), installed Teensyduino v1.47-beta7 onto a fresh copy of Arduino 1.8.9 (MacOS X), and then went to compile in Arduino one of my sketches that previously compile for the Teensy 3.2 with no changes. Unfortunately I go a number of compilations problems, and they all look to be in the libraries, See error output below.

    A few notes/questions:
    • Most of the compilation problems are in the TimerThree header. My code does use TimerThree
    • My have a branch of Adafruit_GFX that I have installed in my Arduino libraries folder. For sum reason when I did this it didn't conflict with the Teensy version of Adafruit_GFX, but now it apparently does. How do I fix that?
    • I also seem to be getting errors in imxrt.h
    • Everything compiles fine when Teensy 3.6 or 3.2 is the target.


    Any thoughts on how to address these issues?

    Thanks!

    Michael

    Code:
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h: In member function 'void TimerThree::setPeriod(long unsigned int)':
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:186:32: error: 'F_TIMER' was not declared in this scope
      const unsigned long cycles = (F_TIMER / 2000000) * microseconds;
                                    ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:265:16: error: 'FTM2_SC' was not declared in this scope
      uint32_t sc = FTM2_SC;
                    ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:267:2: error: 'FTM2_MOD' was not declared in this scope
      FTM2_MOD = pwmPeriod;
      ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:268:25: error: 'FTM_SC_CLKS' was not declared in this scope
      FTM2_SC = FTM_SC_CLKS(1) | FTM_SC_CPWMS | clockSelectBits | (sc & FTM_SC_TOIE);
                             ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:268:29: error: 'FTM_SC_CPWMS' was not declared in this scope
      FTM2_SC = FTM_SC_CLKS(1) | FTM_SC_CPWMS | clockSelectBits | (sc & FTM_SC_TOIE);
                                 ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:268:68: error: 'FTM_SC_TOIE' was not declared in this scope
      FTM2_SC = FTM_SC_CLKS(1) | FTM_SC_CPWMS | clockSelectBits | (sc & FTM_SC_TOIE);
                                                                        ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h: In member function 'void TimerThree::start()':
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:276:2: error: 'FTM2_CNT' was not declared in this scope
      FTM2_CNT = 0;
      ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h: In member function 'void TimerThree::stop()':
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:280:2: error: 'FTM2_SC' was not declared in this scope
      FTM2_SC = FTM2_SC & (FTM_SC_TOIE | FTM_SC_CPWMS | FTM_SC_PS(7));
      ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:280:23: error: 'FTM_SC_TOIE' was not declared in this scope
      FTM2_SC = FTM2_SC & (FTM_SC_TOIE | FTM_SC_CPWMS | FTM_SC_PS(7));
                           ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:280:37: error: 'FTM_SC_CPWMS' was not declared in this scope
      FTM2_SC = FTM2_SC & (FTM_SC_TOIE | FTM_SC_CPWMS | FTM_SC_PS(7));
                                         ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:280:63: error: 'FTM_SC_PS' was not declared in this scope
      FTM2_SC = FTM2_SC & (FTM_SC_TOIE | FTM_SC_CPWMS | FTM_SC_PS(7));
                                                                   ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h: In member function 'void TimerThree::resume()':
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:286:2: error: 'FTM2_SC' was not declared in this scope
      FTM2_SC = (FTM2_SC & (FTM_SC_TOIE | FTM_SC_PS(7))) | FTM_SC_CPWMS | FTM_SC_CLKS(1);
      ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:286:24: error: 'FTM_SC_TOIE' was not declared in this scope
      FTM2_SC = (FTM2_SC & (FTM_SC_TOIE | FTM_SC_PS(7))) | FTM_SC_CPWMS | FTM_SC_CLKS(1);
                            ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:286:49: error: 'FTM_SC_PS' was not declared in this scope
      FTM2_SC = (FTM2_SC & (FTM_SC_TOIE | FTM_SC_PS(7))) | FTM_SC_CPWMS | FTM_SC_CLKS(1);
                                                     ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:286:55: error: 'FTM_SC_CPWMS' was not declared in this scope
      FTM2_SC = (FTM2_SC & (FTM_SC_TOIE | FTM_SC_PS(7))) | FTM_SC_CPWMS | FTM_SC_CLKS(1);
                                                           ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:286:83: error: 'FTM_SC_CLKS' was not declared in this scope
      FTM2_SC = (FTM2_SC & (FTM_SC_TOIE | FTM_SC_PS(7))) | FTM_SC_CPWMS | FTM_SC_CLKS(1);
                                                                                       ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h: In member function 'void TimerThree::setPwmDuty(char, unsigned int)':
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:296:13: error: 'TIMER3_A_PIN' was not declared in this scope
      if (pin == TIMER3_A_PIN) {
                 ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:297:3: error: 'FTM2_C0V' was not declared in this scope
       FTM2_C0V = dutyCycle;
       ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:298:20: error: 'TIMER3_B_PIN' was not declared in this scope
      } else if (pin == TIMER3_B_PIN) {
                        ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:299:3: error: 'FTM2_C1V' was not declared in this scope
       FTM2_C1V = dutyCycle;
       ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h: In member function 'void TimerThree::pwm(char, unsigned int)':
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:304:13: error: 'TIMER3_A_PIN' was not declared in this scope
      if (pin == TIMER3_A_PIN) {
                 ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:305:53: error: 'PORT_PCR_MUX' was not declared in this scope
       *portConfigRegister(TIMER3_A_PIN) = PORT_PCR_MUX(3) | PORT_PCR_DSE | PORT_PCR_SRE;
                                                         ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:305:57: error: 'PORT_PCR_DSE' was not declared in this scope
       *portConfigRegister(TIMER3_A_PIN) = PORT_PCR_MUX(3) | PORT_PCR_DSE | PORT_PCR_SRE;
                                                             ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:305:72: error: 'PORT_PCR_SRE' was not declared in this scope
       *portConfigRegister(TIMER3_A_PIN) = PORT_PCR_MUX(3) | PORT_PCR_DSE | PORT_PCR_SRE;
                                                                            ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:306:20: error: 'TIMER3_B_PIN' was not declared in this scope
      } else if (pin == TIMER3_B_PIN) {
                        ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:307:53: error: 'PORT_PCR_MUX' was not declared in this scope
       *portConfigRegister(TIMER3_B_PIN) = PORT_PCR_MUX(3) | PORT_PCR_DSE | PORT_PCR_SRE;
                                                         ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:307:57: error: 'PORT_PCR_DSE' was not declared in this scope
       *portConfigRegister(TIMER3_B_PIN) = PORT_PCR_MUX(3) | PORT_PCR_DSE | PORT_PCR_SRE;
                                                             ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:307:72: error: 'PORT_PCR_SRE' was not declared in this scope
       *portConfigRegister(TIMER3_B_PIN) = PORT_PCR_MUX(3) | PORT_PCR_DSE | PORT_PCR_SRE;
                                                                            ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h: In member function 'void TimerThree::disablePwm(char)':
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:315:13: error: 'TIMER3_A_PIN' was not declared in this scope
      if (pin == TIMER3_A_PIN) {
                 ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:317:20: error: 'TIMER3_B_PIN' was not declared in this scope
      } else if (pin == TIMER3_B_PIN) {
                        ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h: In member function 'void TimerThree::attachInterrupt(void (*)())':
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:327:2: error: 'FTM2_SC' was not declared in this scope
      FTM2_SC |= FTM_SC_TOIE;
      ^
    Multiple libraries were found for "Adafruit_GFX.h"
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:327:13: error: 'FTM_SC_TOIE' was not declared in this scope
     Used: /Users/michael/Documents/Arduino/libraries/Adafruit_GFX
      FTM2_SC |= FTM_SC_TOIE;
     Not used: /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/Adafruit_GFX
                 ^
    In file included from /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4/core_pins.h:32:0,
                     from /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4/wiring.h:38,
                     from /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4/WProgram.h:45,
                     from /var/folders/jf/2f6rf7pd15l89639dl1ddl_80000gn/T/arduino_build_519018/pch/Arduino.h:6,
                     from /Users/michael/Documents/Arduino/libraries/ShiftRegisterLEDMatrixLib/src/BaseLEDMatrix.h:21,
                     from /Users/michael/Documents/Arduino/libraries/ShiftRegisterLEDMatrixLib/src/BaseLEDMatrix.cpp:19:
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:328:18: error: 'IRQ_FTM2' was not declared in this scope
      NVIC_ENABLE_IRQ(IRQ_FTM2);
                      ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4/imxrt.h:8292:52: note: in definition of macro 'NVIC_ENABLE_IRQ'
     #define NVIC_ENABLE_IRQ(n)      (*(&NVIC_ISER0 + ((n) >> 5)) = (1 << ((n) & 31)))
                                                        ^
    In file included from /Users/michael/Documents/Arduino/libraries/ShiftRegisterLEDMatrixLib/src/BaseLEDMatrix.cpp:247:0:
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h: In member function 'void TimerThree::detachInterrupt()':
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:335:2: error: 'FTM2_SC' was not declared in this scope
      FTM2_SC &= ~FTM_SC_TOIE;
      ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:335:14: error: 'FTM_SC_TOIE' was not declared in this scope
      FTM2_SC &= ~FTM_SC_TOIE;
                  ^
    In file included from /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4/core_pins.h:32:0,
                     from /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4/wiring.h:38,
                     from /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4/WProgram.h:45,
                     from /var/folders/jf/2f6rf7pd15l89639dl1ddl_80000gn/T/arduino_build_519018/pch/Arduino.h:6,
                     from /Users/michael/Documents/Arduino/libraries/ShiftRegisterLEDMatrixLib/src/BaseLEDMatrix.h:21,
                     from /Users/michael/Documents/Arduino/libraries/ShiftRegisterLEDMatrixLib/src/BaseLEDMatrix.cpp:19:
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/TimerThree/TimerThree.h:336:19: error: 'IRQ_FTM2' was not declared in this scope
      NVIC_DISABLE_IRQ(IRQ_FTM2);
                       ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy4/imxrt.h:8293:52: note: in definition of macro 'NVIC_DISABLE_IRQ'
     #define NVIC_DISABLE_IRQ(n)     (*(&NVIC_ICER0 + ((n) >> 5)) = (1 << ((n) & 31)))
                                                        ^
    Error compiling for board Teensy 4.0.
    Last edited by coolio; 08-18-2019 at 12:23 AM.

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,278
    Looking at the Teensy Beta thread: There are two main summary postings #4 and #6 on what things that have been tested/fixed...
    https://forum.pjrc.com/threads/54711...l=1#post193717

    I don't see any comments on TimerThree and it is only mentioned in those two posts (do search Thread).. So my guess is that it has not been tested (and updated).

    As for Adafruit_GFX - I believe on the release, Paul updated it to the current latest version from Adafruit. There were issues before that the version that was part of Teensyduino, that was way behind, and fixes needed for T4 went into the latest stuff.

    The T4 is a completely new family of processors, so all of the core files are different than the ones used to support T3.x or TLC

  3. #3
    Junior Member
    Join Date
    Aug 2019
    Location
    California
    Posts
    2
    Ah, thanks. I missed that. May I assume this is where TimerThree development is done: https://github.com/PaulStoffregen/TimerThree ?

Posting Permissions

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