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

Thread: FastLED not compiling on Teensy-LC - SysTick not defined

  1. #1
    Junior Member
    Join Date
    Aug 2019
    Posts
    1

    FastLED not compiling on Teensy-LC - SysTick not defined

    HI,

    I'm trying to compile FastLED for the Teensy-LC board. I'm testing on a Mac OS X and also Ubuntu 16.04. With the latest version of FastLED from the arduino library manager (3.2.10), I get the following compiler errors when trying to compile the OctoWS2812 example file.

    Code:
    /home/henryt/Arduino/libraries/FastLED/platforms/arm/kl26/../common/m0clockless.h: In function 'int showLedData(volatile uint32_t*, uint32_t, const uint8_t*, uint32_t, M0ClocklessData*)':
    /home/henryt/Arduino/libraries/FastLED/platforms/arm/kl26/../common/m0clockless.h:316:40: error: 'SysTick' was not declared in this scope
           uint32_t ticksBeforeInterrupts = SysTick->VAL;
                                            ^
    /home/henryt/Arduino/libraries/FastLED/platforms/arm/kl26/../common/m0clockless.h:326:36: error: 'VARIANT_MCK' was not declared in this scope
           const uint32_t kTicksPerMs = VARIANT_MCK / 1000;
                                        ^
    In file included from /home/henryt/Arduino/libraries/FastLED/examples/Multiple/OctoWS2811Demo/OctoWS2811Demo.ino:3:0:
    /home/henryt/Arduino/libraries/FastLED/FastLED.h: In static member function 'static CLEDController& CFastLED::addLeds(CRGB*, int, int)':
    /home/henryt/Arduino/libraries/FastLED/FastLED.h:365:30: error: 'COctoWS2811Controller' does not name a type
        case OCTOWS2811: { static COctoWS2811Controller<RGB_ORDER,WS2811_800kHz> controller; return addLeds(&controller, data, nLedsOrOffset, nLedsIfOffset); }
                                  ^
    /home/henryt/Arduino/libraries/FastLED/FastLED.h:365:105: error: 'controller' was not declared in this scope
        case OCTOWS2811: { static COctoWS2811Controller<RGB_ORDER,WS2811_800kHz> controller; return addLeds(&controller, data, nLedsOrOffset, nLedsIfOffset); }
                                                                                                             ^
    /home/henryt/Arduino/libraries/FastLED/FastLED.h:366:34: error: 'COctoWS2811Controller' does not name a type
        case OCTOWS2811_400: { static COctoWS2811Controller<RGB_ORDER,WS2811_400kHz> controller; return addLeds(&controller, data, nLedsOrOffset, nLedsIfOffset); }
                                      ^
    /home/henryt/Arduino/libraries/FastLED/FastLED.h:366:109: error: 'controller' was not declared in this scope
        case OCTOWS2811_400: { static COctoWS2811Controller<RGB_ORDER,WS2811_400kHz> controller; return addLeds(&controller, data, nLedsOrOffset, nLedsIfOffset); }
                                                                                                                 ^
    /home/henryt/Arduino/libraries/FastLED/FastLED.h:368:33: error: 'COctoWS2811Controller' does not name a type
           case OCTOWS2813: { static COctoWS2811Controller<RGB_ORDER,WS2813_800kHz> controller; return addLeds(&controller, data, nLedsOrOffset, nLedsIfOffset); }
                                     ^
    /home/henryt/Arduino/libraries/FastLED/FastLED.h:368:108: error: 'controller' was not declared in this scope
           case OCTOWS2813: { static COctoWS2811Controller<RGB_ORDER,WS2813_800kHz> controller; return addLeds(&controller, data, nLedsOrOffset, nLedsIfOffset); }
                                                                                                                ^
    Multiple libraries were found for "FastLED.h"
     Used: /home/henryt/Arduino/libraries/FastLED
     Not used: /home/henryt/arduino-1.8.9/hardware/teensy/avr/libraries/FastLED
    Error compiling for board Teensy LC.
    When I try compiling the blink example, I get the following compile errors:
    Code:
    In file included from /home/henryt/Arduino/libraries/FastLED/examples/Blink/Blink.ino:1:0:
    /home/henryt/Arduino/libraries/FastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.002.010
     #    pragma message "FastLED version 3.002.010"
                         ^
    In file included from /home/henryt/Arduino/libraries/FastLED/platforms/arm/kl26/clockless_arm_kl26.h:4:0,
                     from /home/henryt/Arduino/libraries/FastLED/platforms/arm/kl26/fastled_arm_kl26.h:7,
                     from /home/henryt/Arduino/libraries/FastLED/platforms.h:20,
                     from /home/henryt/Arduino/libraries/FastLED/FastLED.h:52,
                     from /home/henryt/Arduino/libraries/FastLED/examples/Blink/Blink.ino:1:
    /home/henryt/Arduino/libraries/FastLED/platforms/arm/kl26/../common/m0clockless.h: In function 'int showLedData(volatile uint32_t*, uint32_t, const uint8_t*, uint32_t, M0ClocklessData*)':
    /home/henryt/Arduino/libraries/FastLED/platforms/arm/kl26/../common/m0clockless.h:316:40: error: 'SysTick' was not declared in this scope
           uint32_t ticksBeforeInterrupts = SysTick->VAL;
                                            ^
    /home/henryt/Arduino/libraries/FastLED/platforms/arm/kl26/../common/m0clockless.h:326:36: error: 'VARIANT_MCK' was not declared in this scope
           const uint32_t kTicksPerMs = VARIANT_MCK / 1000;
                                        ^
    Multiple libraries were found for "FastLED.h"
     Used: /home/henryt/Arduino/libraries/FastLED
     Not used: /home/henryt/arduino-1.8.9/hardware/teensy/avr/libraries/FastLED
    Error compiling for board Teensy LC.
    With the Teensy 3.5, both examples compile just fine.

    Any help would be appreciated

    Thanks!

  2. #2
    Grist for the mill: Having the same issue with compiling for Teensy LC on Windows 10 running Arduino 1.8.9, Teensyduino 1.47.

    Source code:

    Code:
    #include <FastLED.h>
    #include <Wire.h>
    #include <Adafruit_MCP4725.h>
    
    Adafruit_MCP4725 dac;
    
    #define LED_DATA_PIN      17
    #define LED_TYPE          WS2812B
    #define COLOR_ORDER       GRB
    #define NUM_LEDS          64
    #define BRIGHTNESS        0
    #define FRAMES_PER_SECOND 60
    
    CRGB leds[NUM_LEDS];
    
    int h_val = 128;
    int h_val_tmp = 128;
    int v_val = 128;
    int v_val_tmp = 128;
    
    void setup() {
      pinMode(2, INPUT_PULLUP);
      pinMode(3, INPUT_PULLUP);
      pinMode(4, INPUT_PULLUP);
      pinMode(5, INPUT_PULLUP);
      
      delay(3000); // 3 second delay for initial setup
      
      // tell FastLED about the LED strip configuration
      FastLED.addLeds<LED_TYPE,LED_DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
      //FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
    
      // set master brightness control
      FastLED.setBrightness(BRIGHTNESS);
    
      // start the DAC communication
      dac.begin(0x60);
    
      // Serial for incoming data
      // Serial.begin(57600);
    }
    
    void loop() {
      uint32_t intensity;
      boolean refresh;
      intensity = analogRead(A0);
      refresh = false;
      
      // check for incoming serial information, read if buffer exists
      // Sanity check, set INTENSITY variable accordingly
    
      // Set LED activity related to INTENSITY variable
      v_val_tmp = map(intensity, 0, 4095, 0, 255);
      h_val_tmp = map(analogRead(A1), 0, 4095, 0, 255);
    
      if (h_val_tmp != h_val) {
        h_val = h_val_tmp;
        refresh = true;
      }
      
      if (v_val_tmp != v_val) {
        v_val = v_val_tmp;
        refresh = true;
      }
    
      if (refresh) {
        fill_solid(leds, NUM_LEDS, CHSV(h_val, 255, v_val));
        FastLED.show();
      }
      
      // Set motor control voltage related to INTENSITY variable
      if (refresh) {
        dac.setVoltage(intensity, false);
      }
    }
    And here are the compile errors:

    Code:
    In file included from C:\Users\svc\Documents\Arduino\jrsculpture_led\jrsculpture_led.ino:4:0:
    
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.003.000
    
     #    pragma message "FastLED version 3.003.000"
    
                         ^
    
    In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FastLED/platforms/arm/kl26/clockless_arm_kl26.h:4:0,
    
                     from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FastLED/platforms/arm/kl26/fastled_arm_kl26.h:7,
    
                     from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FastLED/platforms.h:20,
    
                     from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FastLED/FastLED.h:52,
    
                     from C:\Users\svc\Documents\Arduino\jrsculpture_led\jrsculpture_led.ino:4:
    
    c:\program files (x86)\arduino\hardware\teensy\avr\libraries\fastled\platforms\arm\common\m0clockless.h: In function 'int showLedData(volatile uint32_t*, uint32_t, const uint8_t*, uint32_t, M0ClocklessData*)':
    
    c:\program files (x86)\arduino\hardware\teensy\avr\libraries\fastled\platforms\arm\common\m0clockless.h:316:40: error: 'SysTick' was not declared in this scope
    
           uint32_t ticksBeforeInterrupts = SysTick->VAL;
    
                                            ^
    
    c:\program files (x86)\arduino\hardware\teensy\avr\libraries\fastled\platforms\arm\common\m0clockless.h:326:36: error: 'VARIANT_MCK' was not declared in this scope
    
           const uint32_t kTicksPerMs = VARIANT_MCK / 1000;
    
                                        ^
    
    Using library FastLED at version 3.3.0 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FastLED 
    Using library Wire at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire 
    Using library Adafruit_MCP4725 at version 1.0.2 in folder: C:\Users\svc\Documents\Arduino\libraries\Adafruit_MCP4725 
    Error compiling for board Teensy LC.
    The same code compiles for the Teensy 3.2 without error.

    Guidance appreciated!

  3. #3
    Senior Member
    Join Date
    Jan 2013
    Posts
    124
    Yeah - I discovered this the other night - someone made changes to the arm m0 clockless cose thatís breaking this - until I get a fix checked in (thereís one on a branch for other work, need to merge it over) put:

    #define FASTLED_ALLOW_INTERRUPTS 0

    Before the include FastLED.h (their change was a hack to allow it on more platforms - but the teensy LC doesnít work with it - but it defines allow interrupts as 1 even though it never used it before)

  4. #4
    Senior Member
    Join Date
    Jan 2013
    Posts
    124
    Quote Originally Posted by dgarcia42 View Post
    Yeah - I discovered this the other night - someone made changes to the arm m0 clockless cose thatís breaking this - until I get a fix checked in (thereís one on a branch for other work, need to merge it over) put:

    #define FASTLED_ALLOW_INTERRUPTS 0

    Before the include FastLED.h (their change was a hack to allow it on more platforms - but the teensy LC doesnít work with it - but it defines allow interrupts as 1 even though it never used it before)
    Spun up FastLED 3.3.1 w/the fix for this in place.

  5. #5

    Fix worked!

    Quote Originally Posted by dgarcia42 View Post
    Spun up FastLED 3.3.1 w/the fix for this in place.
    Thank you, Daniel! Works like a charm now. Cheers!

  6. #6
    Junior Member
    Join Date
    Jan 2014
    Posts
    5
    I am having this issue trying to compile my code to Teensy LC. I have used FastLED 3.3.0, 3.3.1, and 3.3.2 libraries. I have attempted to add "#define FASTLED_ALLOW_INTERRUPTS 0" to my code with no luck. Is this still an issue or should it have been fixed?

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FastLE D/FastLED.h:14:21: note: #pragma message: FastLED version 3.003.000

    # pragma message "FastLED version 3.003.000"

    ^

    In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FastLE D\platforms/arm/kl26/clockless_arm_kl26.h:4:0,

    from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FastLE D\platforms/arm/kl26/fastled_arm_kl26.h:7,

    from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FastLE D\platforms.h:20,

    from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FastLE D\FastLED.h:52,

    from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FastLE D\lib8tion.cpp:3:

    c:\program files (x86)\arduino\hardware\teensy\avr\libraries\fastle d\platforms\arm\common\m0clockless.h: In function 'int showLedData(volatile uint32_t*, uint32_t, const uint8_t*, uint32_t, M0ClocklessData*)':

    c:\program files (x86)\arduino\hardware\teensy\avr\libraries\fastle d\platforms\arm\common\m0clockless.h:316:40: error: 'SysTick' was not declared in this scope

    uint32_t ticksBeforeInterrupts = SysTick->VAL;

    ^

    c:\program files (x86)\arduino\hardware\teensy\avr\libraries\fastle d\platforms\arm\common\m0clockless.h:326:36: error: 'VARIANT_MCK' was not declared in this scope

    const uint32_t kTicksPerMs = VARIANT_MCK / 1000;

  7. #7
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,229
    if the build is printing FastLED version 3.003.000, then you're still running from old version of FastLED. You probably have multiple copies of FastLED. Remove them, and then install the latest from https://github.com/FastLED/FastLED Then your build should report FastLED version 3.003.002

  8. #8
    Junior Member
    Join Date
    Jan 2014
    Posts
    5
    Quote Originally Posted by manitou View Post
    if the build is printing FastLED version 3.003.000, then you're still running from old version of FastLED. You probably have multiple copies of FastLED. Remove them, and then install the latest from https://github.com/FastLED/FastLED Then your build should report FastLED version 3.003.002
    Ok I think I figured it out. This is a new install on a computer I have not done any FastLED work on. I think the Teensyduino program is installing 3.3.0 as I had the updated library... I unchecked the FastLED library on the Teensyduino install and it took my latest FastLED library.

    Thanks for the help in figuring that out.

Posting Permissions

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