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

Metro M0 double-click difficult with v1.26.0-adafruit.0 and later #16

Closed
dhalbert opened this issue Mar 22, 2018 · 5 comments
Closed

Metro M0 double-click difficult with v1.26.0-adafruit.0 and later #16

dhalbert opened this issue Mar 22, 2018 · 5 comments

Comments

@dhalbert
Copy link

Doing a double-click reset to get to UF2 (pulsing LED) on a Metro M0 with v1.23.1 is easy. But with 1.26.0-adafruit.0 and 2.0.0-adafruit.0, it has become much more difficult for me. I have to try multiple times. I verified by loading the older bootloader and it became easier again. I tried with various different user programs, including just a blinky.

I tried 2.0.0-adafruit.0 on Gemma M0, CPX, and Feather M0 Express, and did not have difficulty doing double-click. I thought it might be CRYSTALLESS vs crystal-controlled clock, but the Feather M0 has a crystal and it's fine.

Speculation: Doing a double-click reset on the Metro M0 with the reset jumper still seems easy. So maybe it's some bounce characteristic of the larger switch vs a timing change since 1.23.1.

@dhalbert
Copy link
Author

@ladyada This double-click difficulty appears to be due to this code to make SWD programming more reliable:
https://github.com/adafruit/uf2-samd21/blob/c91ce29a4826f3e247a31bd193c0b2c8b6be9eea/src/main.c#L165-L168

#if (USB_VID == 0x239a) && (USB_PID == 0x0013)  // Adafruit Metro M0
    // Delay a bit so SWD programmer can have time to attach.
        delay(100);
#endif

This is right at the top of main(). If I comment out the delay(100);, double-click is much easier. How do you think we could satisfy both requirements? Maybe shorten the delay?

The Feather M0, etc. don't have this delay but seem to be programmable OK (I guess). Is there a difference between how those are factory-programmed and the Metro M0?

@tannewt
Copy link
Member

tannewt commented Mar 27, 2018 via email

@tannewt
Copy link
Member

tannewt commented Mar 27, 2018

@ladyada
Copy link
Member

ladyada commented Apr 7, 2018

tried re-enabling PINMUX and mux G, but that didnt actually work - there's Magic in the SWD manager, perhaps once you disable it, it doesnt let you get back to the SWD listener state?

@dhalbert
Copy link
Author

dhalbert commented Apr 7, 2018

Fixed by #18.

@dhalbert dhalbert closed this as completed Apr 7, 2018
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

3 participants