Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teensy 3 / FastLED linker error #655

Open
Genoil opened this issue Mar 8, 2021 · 1 comment
Open

Teensy 3 / FastLED linker error #655

Genoil opened this issue Mar 8, 2021 · 1 comment

Comments

@Genoil
Copy link

Genoil commented Mar 8, 2021

#include <FastLED.h>

void setup() { 
    Serial.begin(2000000);
    //Serial.println("fix");

    CRGBArray<10> leds;
    FastLED.addLeds<NEOPIXEL, 3>(leds, 10); 
}

void loop() { 
}

Produces:

/Applications/Teensyduino.app/Contents/Java/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/fpu/libc.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text._write_r+0x12): undefined reference to `_write'

The problem is triggered by FastLED.addLeds.

Removing the line comment before the Serial.println("fix") fixes this. Strange...

@Genoil
Copy link
Author

Genoil commented Mar 11, 2021

This is a much better fix:
Teensy.mk, instead of defining these as OTHER_LIBS, just add them to LD_FLAGS. Now FastLED builds without the println required, AND the binary size is about 60K smaller. Another issue, where I had to remove new.cpp in teensy3/cores from the build process, is also fixed with this change:

LDFLAGS+= $(call PARSE_BOARD,$(BOARD_TAG),build.flags.libs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant