You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My Teensy 3.1 stops running after a couple minutes of running a single APA102 strip. This always happens after a couple minutes after calling FastLED.show(), but not at exactly the same time on each run. This smells of a memory leak.
In case it matters, I am using data pin 7 and clock pin 14. I have the lastest version of FastLED (4c32e65) downloaded via PlatformIO.
Let me know if you there is other information that would be helpful.
It doesn't matter what code is running, as long as it calls FastLED.show() lots of times. I think it crashes sooner the higher NUM_LEDS is, but I didn't measure it it enough times to be sure it wasn't just coincidental.
I have got similar problems with my teensy 3.2. I have found a workaround by disabling USB. ( Setting usb Type to " no USB" in the Menu. )
Disconnecting USB seems to help too, but eventually the Program stoops as well.
I did some tests experimenting with how often FastLED.show() is called and it seemed like things would "lock up" sooner when it was called very often. But it's not consistent for me as to how quickly it locks up. For example if I call show() every 15 milliseconds it might lockup after 20 seconds, or it might run for several minutes. If there wasn't any delay at all though, and show() was called every single loop, then things would usually just stop running immediately right after sketch upload. I could watch the Teensy's onboard led blink from the update, then maybe the first few pixels might light up, and then it would be locked up.
After I upload a sketch and it locks up, if I unplug the MCU from the computer and just power it with a battery it seems to run fine without ever "locking up". I also tried reloc4's suggestion of setting USB type to "no USB" and that seemed to work fine (but I didn't let it run for a really long time).
I don't think I ever experienced this "locking up" in the past with Arduino IDE 1.6.8, but I think this was happening with 1.6.9. Can't remember if I ever tried out 1.6.10. Currently I have the new 1.6.11 installed and am testing out Teensyduino 1.30 beta2.
Hmmm - I wonder if there's some conflict happening between the USB peripheral and the SPI peripheral? Out of curiosity - what happens if you put #define FASTLED_FORCE_SOFTWARE_SPI 1 before the #include <FastLED.h>?
If the USB peripheral is leaving one of the status registers that are being checked by the SPI code in a weird state (or, if I'm checking the SPI status register incorrectly) that could cause things to lock up.
Adding #define FASTLED_FORCE_SOFTWARE_SPI 1 above the FastLED.h include does seem to fix the locking up, but (unexpectedly!) it also made all the pixels display as nearly white (as if saturation was set to a very low value).
Huh - that's a particularly strange reaction - what types of LEDs are you driving? (If they're something like WS2801's, the software SPI on the teensy 3.x may be driving things too fast!)
My setups use Data on pin 11, and Clock on 13. Haven't changed anything there.
With Teensy 3.0 and LPD8806 all pixels went nearly white with FASTLED_FORCE_SOFTWARE_SPI 1. Without force software spi colors are correct, but then getting the lockup.
Just tried that same Teensy 3.0 with an APA102 strip and that is running fine color wise and not locking up when using FASTLED_FORCE_SOFTWARE_SPI 1 (and powered via the USB from computer).
And now I tested with a different Teensy 3.0 and a different LPD8806 strip (32 pixels) on a different USB plug (thus a different COM port) and it locks up without the FASTLED_FORCE_SOFTWARE_SPI 1. If I add force software spi it's not locking up, but I do see odd flickering, even more so in the first few pixels. I just tried unplugged the USB and powering it with wall power supply and still seeing some odd flickering in some pixels. So that doesn't seem like it's USB related then. Meh, this is totally confusing me.
I'm going to uninstall arduino IDE and go back to 1.6.8 again. Thank you for your help and suggestions Daniel.
I'm using Teensy 3.2 and APA102 and have freezing issues too, both with Teensyduino and Github latest version. It seems to be USB related because it runs well on separate 5V font.
It takes almost the same number of FastLED.show() calls to freeze, I suppose it is about 2200 calls.
Seems like you don't need to change the colour at all and the number of calls till the freeze is different every time. I have measured 176 to up to 5700 calls with is code:
Just to follow up, I reverted back to using Arduino IDE 1.6.8 and Teensyduino 1.28 (which I don't believe I ever had any troubles with in the past) but I'm still getting the locking up.
Since the locking up only happens when the controller is plugged into USB, I wondered if something had gone wacky with my USB drivers, so I uninstalled all USB drivers, but still no luck solving this. I'm not sure how to continue to try to figure this out, or what to test?
I'm preparing to post Teensyduino 1.30-beta4, and (hopefully very soon) turn this into a stable 1.30 release.
I've pulled in the 339 branch for 1.30-beta4. Please let me know if this is ok for a final 1.30 release? Would be nice to have a good, updated FastLED with the installer.
I'm having to run the teensy at 16mhz to eliminate flickering but I'm
guessing that's an unrelated issue(?).
On Mon, Sep 5, 2016 at 1:28 PM, Paul Stoffregen [email protected]
wrote:
I'm preparing to post Teensyduino 1.30-beta4, and (hopefully very soon)
turn this into a stable 1.30 release.
I've pulled in the 339 branch for 1.30-beta4. Please let me know if this
is ok for a final 1.30 release. Would be nice to have a good, updated
FastLED with the installer.
More or less undoing fe32cf1 "attempt a fix for #339 - guard waitfully against a race condition ..." seems to fix it for me. I do not know what the theory of that commit was, or how to test the problem it addressed.
No real help here, just confirming removing the fix solved the hanging problem for me. Raspberry Pi 3 pushing tpm2 to the Teensy 3.2 over usb serial (Using Pixelcontroller : 720 x apa102's)
I'm definitely having this issue with master driving APA102s via SPI with a Teensy 3.2. b01f941 corrects it for me, but none of the other attempts at fixes do.
My USB is still in serial mode, and has no effect on the issue either way.
I am also read a lot of data over I2C as well. Other commits seem to destabilize the I2C hardware (sometimes I2C locks up, sometimes SPI locks up).
fixes the problems described in this bug, so I think this bug can be closed.
Before trying the current master of FastLED, I also tried your 339 fix-branch and it did not fix my hangs.
But the current master, which includes the fix for 419 fixes the hangs.
Activity
focalintent commentedon Aug 18, 2016
Seeing the code you're trying to run would be helpful for attempting to recreate the problem here.
bryanculbertson commentedon Aug 18, 2016
It doesn't matter what code is running, as long as it calls FastLED.show() lots of times. I think it crashes sooner the higher NUM_LEDS is, but I didn't measure it it enough times to be sure it wasn't just coincidental.
reloc4 commentedon Aug 19, 2016
I have got similar problems with my teensy 3.2. I have found a workaround by disabling USB. ( Setting usb Type to " no USB" in the Menu. )
Disconnecting USB seems to help too, but eventually the Program stoops as well.
marmilicious commentedon Aug 23, 2016
I'm experiencing something similar with things "locking up" so I thought I'd share what I'm seeing here too. I'm using a Teensy 3.0 and LPD8806 strip (32 pixels). This was also happening for me with an APA102 strip (38 pixels). This evening was testing with a slightly modified version of the FastLED cylon example, http://pastebin.com/wRX2U00B but this "locking up" happens to me with other sketches also.
I did some tests experimenting with how often FastLED.show() is called and it seemed like things would "lock up" sooner when it was called very often. But it's not consistent for me as to how quickly it locks up. For example if I call show() every 15 milliseconds it might lockup after 20 seconds, or it might run for several minutes. If there wasn't any delay at all though, and show() was called every single loop, then things would usually just stop running immediately right after sketch upload. I could watch the Teensy's onboard led blink from the update, then maybe the first few pixels might light up, and then it would be locked up.
After I upload a sketch and it locks up, if I unplug the MCU from the computer and just power it with a battery it seems to run fine without ever "locking up". I also tried reloc4's suggestion of setting USB type to "no USB" and that seemed to work fine (but I didn't let it run for a really long time).
I don't think I ever experienced this "locking up" in the past with Arduino IDE 1.6.8, but I think this was happening with 1.6.9. Can't remember if I ever tried out 1.6.10. Currently I have the new 1.6.11 installed and am testing out Teensyduino 1.30 beta2.
focalintent commentedon Aug 23, 2016
Hmmm - I wonder if there's some conflict happening between the USB peripheral and the SPI peripheral? Out of curiosity - what happens if you put
#define FASTLED_FORCE_SOFTWARE_SPI 1before the#include <FastLED.h>?If the USB peripheral is leaving one of the status registers that are being checked by the SPI code in a weird state (or, if I'm checking the SPI status register incorrectly) that could cause things to lock up.
marmilicious commentedon Aug 23, 2016
Adding
#define FASTLED_FORCE_SOFTWARE_SPI 1above the FastLED.h include does seem to fix the locking up, but (unexpectedly!) it also made all the pixels display as nearly white (as if saturation was set to a very low value).focalintent commentedon Aug 23, 2016
Huh - that's a particularly strange reaction - what types of LEDs are you driving? (If they're something like WS2801's, the software SPI on the teensy 3.x may be driving things too fast!)
focalintent commentedon Aug 23, 2016
(Also, it feels like a thing that happens when clock/data pins are backwards)
marmilicious commentedon Aug 23, 2016
My setups use Data on pin 11, and Clock on 13. Haven't changed anything there.
With Teensy 3.0 and LPD8806 all pixels went nearly white with FASTLED_FORCE_SOFTWARE_SPI 1. Without force software spi colors are correct, but then getting the lockup.
Just tried that same Teensy 3.0 with an APA102 strip and that is running fine color wise and not locking up when using FASTLED_FORCE_SOFTWARE_SPI 1 (and powered via the USB from computer).
And now I tested with a different Teensy 3.0 and a different LPD8806 strip (32 pixels) on a different USB plug (thus a different COM port) and it locks up without the FASTLED_FORCE_SOFTWARE_SPI 1. If I add force software spi it's not locking up, but I do see odd flickering, even more so in the first few pixels. I just tried unplugged the USB and powering it with wall power supply and still seeing some odd flickering in some pixels. So that doesn't seem like it's USB related then. Meh, this is totally confusing me.
I'm going to uninstall arduino IDE and go back to 1.6.8 again. Thank you for your help and suggestions Daniel.
focalintent commentedon Aug 23, 2016
(Also - make sure that you are not using the FastLED version that comes w/teensyduino - I've done a bunch of fixes since then)
marmilicious commentedon Aug 23, 2016
Yes, I never install FastLED that way, always grab the the latest here at github. :)
dimitre commentedon Aug 28, 2016
I'm using Teensy 3.2 and APA102 and have freezing issues too, both with Teensyduino and Github latest version. It seems to be USB related because it runs well on separate 5V font.
It takes almost the same number of FastLED.show() calls to freeze, I suppose it is about 2200 calls.
this is the minimal code to reproduce here:
Thanks
reloc4 commentedon Aug 28, 2016
Seems like you don't need to change the colour at all and the number of calls till the freeze is different every time. I have measured 176 to up to 5700 calls with is code:
marmilicious commentedon Aug 28, 2016
Just to follow up, I reverted back to using Arduino IDE 1.6.8 and Teensyduino 1.28 (which I don't believe I ever had any troubles with in the past) but I'm still getting the locking up.
Since the locking up only happens when the controller is plugged into USB, I wondered if something had gone wacky with my USB drivers, so I uninstalled all USB drivers, but still no luck solving this. I'm not sure how to continue to try to figure this out, or what to test?
reloc4 commentedon Aug 28, 2016
I just reverted back to fast LED Version "12 Apr " now I have got no freeze.
I'm have narrowed it down :
21 Apr no frezze
22 May no frezze
8 Jun frezze
4 Jun no frezze
7 Jun frezze
seems to be commit 4a71eea from 7 Jun
guess we are stuck in this loop:
Yes I just confirmed this by undoing the commit 4a71eea in the current master. Issue resolved.
( I don't actually understand what's happening there)
9 remaining items
reloc4 commentedon Aug 30, 2016
I was using using IDE 1.6.8 and Teenysduino 1.29 if there is anything else to try I can give it a shot.
hydronics2 commentedon Aug 31, 2016
I uploaded using the 339 branch above. I'm using Arduino 1.69, Teensyduino 1.29 and Teensy3.2 and working fine for a couple of hours now.
I'm running 4 strips of about 600 APA102 pixels in SPI mode using an assortment of hardware SPI pins (7,11,13,14) without freezing. thanks!
PaulStoffregen commentedon Sep 5, 2016
I'm preparing to post Teensyduino 1.30-beta4, and (hopefully very soon) turn this into a stable 1.30 release.
I've pulled in the 339 branch for 1.30-beta4. Please let me know if this is ok for a final 1.30 release? Would be nice to have a good, updated FastLED with the installer.
hydronics2 commentedon Sep 6, 2016
still working well for me.
I'm having to run the teensy at 16mhz to eliminate flickering but I'm
guessing that's an unrelated issue(?).
On Mon, Sep 5, 2016 at 1:28 PM, Paul Stoffregen [email protected]
wrote:
dimitre commentedon Sep 7, 2016
I can confirm APA102, Teensy 3.2 running OK with Teensyduino 1.30 final (339 branch)
Merge pull request #343 from FastLED/bugs/339
jhps commentedon Nov 30, 2016
Also having this problem on a APA102s on Teensy 3.1, with Teensyduino 1.31 and also with FastLED d99001d, but not with b01f941 as per https://forum.pjrc.com/threads/35684-FastLED-freezing-with-prop-shield.
jhps commentedon Dec 4, 2016
More or less undoing fe32cf1 "attempt a fix for #339 - guard waitfully against a race condition ..." seems to fix it for me. I do not know what the theory of that commit was, or how to test the problem it addressed.
Karniv4 commentedon Dec 5, 2016
No real help here, just confirming removing the fix solved the hanging problem for me. Raspberry Pi 3 pushing tpm2 to the Teensy 3.2 over usb serial (Using Pixelcontroller : 720 x apa102's)
Plasmarobo commentedon Jan 27, 2017
I'm definitely having this issue with master driving APA102s via SPI with a Teensy 3.2.
b01f941 corrects it for me, but none of the other attempts at fixes do.
My USB is still in serial mode, and has no effect on the issue either way.
I am also read a lot of data over I2C as well. Other commits seem to destabilize the I2C hardware (sometimes I2C locks up, sometimes SPI locks up).
florianlink commentedon May 14, 2017
The current master branch fixes my hangs that I experienced with FastLED + FFT + Serial1 on Teensy 3.2, see the bug mentioned above!
PaulStoffregen commentedon May 15, 2017
Could you please be more specific. I do not see any code above using Serial1. Did I miss it?
In fact, when I text search this page, your message is the only occurrence of "Serial1" my browser can find.
Just so you know, I ignore any bug report which does not have a complete program I can copy into Arduino and run on a board.
florianlink commentedon May 15, 2017
It was not a bug report, I just said, that
#419
fixes the problems described in this bug, so I think this bug can be closed.
Before trying the current master of FastLED, I also tried your 339 fix-branch and it did not fix my hangs.
But the current master, which includes the fix for 419 fixes the hangs.
hydronics2 commentedon Jun 23, 2017
The current version of Teensyduino 1.37 that includes a newer version of FastLed works for me..! No locking up.
I have 600+ APA102 LEDs and I still have to run the LEDs at DATA_RATE_MHZ(12) and run the teensy at 16MHZ to completely remove the flickering.
FastLED.addLeds<LED_TYPE,DATA_PIN1,CLOCK_PIN1,COLOR_ORDER, DATA_RATE_MHZ(12)>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);