Another FastLED doesn't work right topic (Trinket M0)

Like many, I want to get away from the Arduino “IDE”. My first attempt was with VS Code & PlatformIO. No success, so I tried Atom and am having the exact same issue. It’s probably something simple so bear with me.

Environment: Mac OS 10.12.6, Atom: 1.40, PlatformIO: Home 2.2.0, Core 4.0.1b3.
FastLED version: I have tried several, 3.3.0 is latest, same results with all versions.
platformio.ini:

[env:adafruit_trinket_m0]
platform = atmelsam
board = adafruit_trinket_m0
framework = arduino

Code: cylon example, modified to 76 LEDs and DataPin 0.
Code compiles and runs perfectly under Arduino IDE.
Code compiles under Atom/PlatformIO.
Uploading often errors out:

Looking for upload port…
Auto-detected: /dev/cu.usbmodem1411
Forcing reset using 1200bps open/close on port /dev/cu.usbmodem1411
Waiting for the new upload port…
Uploading .pio/build/adafruit_trinket_m0/firmware.bin
No device found on cu.usbmodem1411
*** [upload] Error 1

I can frequently only upload successfully by double-clicking the reset button on the Trinket M0 when I see

Waiting for the new upload port…

Then it works. But then sometimes it works fine, so that’s the minor issue.

When it does upload, it doesn’t run correctly. Cylon is a back and forth rainbow with fade and the binary produced by PlatformIO only lights up the first 30 LEDs and the timing is clearly off because the LEDs do a sort of a jittery color cycle but not the cylon pattern. Reducing the declared NUM_LEDS to 20 does nothing, still the first 30 LEDs light up in the same jittery color wipe.

Suggestions?

Thanks.

Which version of FastLED do you have installed in the Arduino IDE? Also what board package version do you have installed in the Arduino IDE for the Adafruit SAMD boards?

1 Like

Thanks for responding.
FastLED version? 3.3.0. I’ve never had an issue with FastLED libraries in the Arduino IDE or see what I am seeing when using FastLED with PlatformIO.
As for the board package version, I can’t find that info. Where do I look?
However, I compiled/downloaded a Neopixel demo of similar complexity to the same hardware and it runs perfectly. I suspect it’s not a board definition issue.

Also: The number of times I have upload issues with the Arduino IDE and the Trinket M0 is very small. The upload issues are with PlatformIO (in combination with this board, admittedly one data point), are far more pronounced. That having been said, it could be as simple as a USB cable issue.

I’m using FastLED (probably 3.2.10 as the code was last updated about two weeks ago) for a ESP8266 project controlling 507 WS2812s and it’s working just fine for me.

To find the platform/board package version version…

In the Arduino IDE, Tools->Boards → Board manager, filter for “SAMD” and tell me the installed versions for “Adafruit SAMD boards” and “Arduino SAMD boards”.

Sorry, I was unclear that the question was about the boards in the Arduino IDE: I was working with 1.3 and have just updated to 1.5.3.

I’m curious about your question @maxgerhardt, PlatformIO board definitions are separate from the PlatformIO definitions… But you led me to poke around in the PlatformIO boards and discovered that I probably did not have the latest Atmel SAM definitions installed, so I updated to 3.8.0 and voilà! success!
This is what the update looked like, so I obviously had nothing approaching the right stuff installed.

Platform has been successfully installed
PlatformManager: Installing atmelsam
atmelsam @ 3.8.0 is already installed
PackageManager: Installing toolchain-gccarmnoneeabi @ ~1.70201.0
toolchain-gccarmnoneeabi @ 1.70201.0 is already installed
Uninstalling tool-bossac @ 1.10900.0: [OK]
The platform ‘atmelsam’ has been successfully installed!
The rest of packages will be installed automatically depending on your build environment.
Updating tool-pioplus @ 2.5.2 [2.5.3]
Uninstalling tool-pioplus @ 2.5.2: [OK]
CorePackageManager: Installing tool-pioplus @ 2.5.3
Downloading…
Unpacking…
tool-pioplus @ 2.5.3 has been successfully installed!

Thanks for helping my thinking process!

1 Like