adafruit / Adafruit_DotStar

GNU General Public License v3.0
98 stars 58 forks source link

Versions 1.2.0+ breaks onboard DotStar on Trinket M0 #52

Open nstansby opened 2 years ago

nstansby commented 2 years ago

Please note this seems to be slightly intermittent; see notes at end.

  1. Install 1.1.5 version of Adafruit DotStar
  2. The sketch below (which simply flashes the onboard DotStar in blue) will compile, upload, and work fine.
  3. Install 1.2.0 or 1.2.1 version of DotStar
  4. The same sketch will compile and upload, but after the device reboots it crashes and you get the "USB device not recognized". Resetting or disconnecting/reconnecting the Trinket makes no difference; you have to do a double-reset to get to the bootloader in order to get the device responding again.
  5. Reinstall 1.1.5 and the sketch works again.
#include <Adafruit_DotStar.h>

Adafruit_DotStar strip(1, 7, 8, DOTSTAR_BRG);

void setup() {
  strip.begin();
  strip.setBrightness(25);
  strip.show();
}

void loop() {
  strip.setPixelColor(0, 0, 0, 255);
  strip.show();
  delay(500);
  strip.setPixelColor(0, 0, 0, 0);
  strip.show();
  delay(500);
}

I have 4 Trinket M0s, and the problem can be reproduced reliably on 3 of them. Of those three, two have the 2.0.0 UF2 bootloader, and I upgraded one of them to the latest 3.14.0 to see if that made a difference (it didn't).

On the fourth board, which also has the 2.0.0 UF2 bootloader, the problem is intermittent; immediately after upload it usually works, but resetting the board with the reset button or a power cycle brings it to the same "USB device not recognized".

All four boards work reliably with the 1.1.5 version of the library.

I also have a couple of ItsyBitsy M4s with onboard DotStars; I tried both of them (with the appropriate pin numbers) and didn't see the problem there.

caternuson commented 1 year ago

Not sure how that example sketch ever worked. On the Itsy M0 the onboard DotStar pins are 40 (clock) and 41 (data).

https://learn.adafruit.com/introducing-itsy-bitsy-m0/pinouts#spi-flash-and-dotstar-2989068

EDIT - oops, nevermind. Issue is with a Trinket M0. sorry, working several different board/issues at once right now.

caternuson commented 1 year ago

Just tested this with a Trinket M0 and it works. So can't recreate the issue described.

Make sure all other Arduino libraries and Board Support Packages are up to date as well.

This behavior:

The same sketch will compile and upload, but after the device reboots it crashes and you get the "USB device not recognized". Resetting or disconnecting/reconnecting the Trinket makes no difference; you have to do a double-reset to get to the bootloader in order to get the device responding again.

sounds like something more lower level is not working as expected.