-
Notifications
You must be signed in to change notification settings - Fork 1.3k
utime.sleep() in main.py can "brick" #45
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
Comments
Yup I have a todo to check that.
|
We have a factory reset pin on the Bluefruit modules and we check the pin state in the bootloader to see if we should clear all the config settings, etc., to factory defaults. That's saved our butts more than a few times and might be worth thinking about here? We also implemented a feature where holding the DFU button down for 5s causes a factory reset on release (with a distinct blinky pattern to let you know when you can release). Maybe neither of those are relevant here, but figured I'd toss them out. A factory reset solder jumper/pad on the bottom might be a good idea just as a backup plan though, so you can still just connect a wire by hand to that and GND when you start the module up with no soldering. https://learn.adafruit.com/introducing-the-adafruit-bluefruit-le-uart-friend/factory-reset |
hmm, on feather m0 we don't have a userland button, and not sure the metro m0 will have one either (but it could be added!) one option, maybe shorting SWDIO to ground while powering up does a factory reset? as long as the firmware set a pullup on, waited a few ms for the voltage to stabilize, before checking? SWDIO is available as a pad but not a true 'pin' so its unlikely a user will connect to it |
I don't think we actually need a pin. I can have the delay loops check for ctrl-c when the USB is plugged in. Right now its just the python interpreter doing it so if you get stuck in C code you can't ctrl-c until it finishes. |
if you utime.delay() it also seems to kill mass storage, does being stuck in C code also halt mass storage handling? (cuz oetherwise i could have just deleted main.py) |
What version are you running? It should have been fixed on Friday or so. On Mon, Oct 31, 2016 at 10:42 AM ladyada notifications@github.com wrote:
|
cant recall (its at home) but will try again with fresh version! |
cool cool! On Mon, Oct 31, 2016 at 11:46 AM ladyada notifications@github.com wrote:
|
Uh oh!
There was an error while loading. Please reload this page.
i momentarily forgot that utime.sleep() takes seconds instead of milliseconds and called utime.sleep(5000) in main.py and now i can't ^C to the REPL (COM port does appear tho), ^D, or get the mass storage to appear. yay!
probably some bug? who knows :) imma reflash this feather m0 to clear out the storage - but if this were a metro m0 you wouldn't be able to, so having some sort of external tool to clear out the SPI flash could be handy (e.g. #40). probably just a .hex that does the erasing so you can bossac it.
The text was updated successfully, but these errors were encountered: