8000 utime.sleep() in main.py can "brick" · Issue #45 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

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

Closed
ladyada opened this issue Oct 30, 2016 · 8 comments
Closed

utime.sleep() in main.py can "brick" #45

ladyada opened this issue Oct 30, 2016 · 8 comments

Comments

@ladyada
Copy link
Member
ladyada commented Oct 30, 2016

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.

@tannewt
Copy link
Member
tannewt commented Oct 30, 2016

Yup I have a todo to check that.
On Sat, Oct 29, 2016 at 9:33 PM ladyada notifications@github.com wrote:

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 #40)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#45, or mute the thread
https://github.com/notifications/unsubscribe-auth/AADNqdRU4nVpnLMcRcuRiFFQ4EtPkNK5ks5q5B4QgaJpZM4KkSck
.

@microbuilder
Copy link
microbuilder commented Oct 30, 2016

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

@ladyada
Copy link
Member Author
ladyada commented Oct 30, 2016

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

@tannewt
Copy link
Member
tannewt commented Oct 31, 2016

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.

@ladyada
Copy link
Member Author
ladyada commented Oct 31, 2016

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)

@tannewt
Copy link
Member
tannewt commented Oct 31, 2016

What version are you running? It should have been fixed on Friday or so.
86a1d1d

On Mon, Oct 31, 2016 at 10:42 AM ladyada notifications@github.com wrote:

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)


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#45 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADNqU-T6pds7pPxnoh5U89-ZsbTR7inks5q5ih8gaJpZM4KkSck
.

@ladyada
Copy link
Member Author
ladyada commented Oct 31, 2016

cant recall (its at home) but will try again with fresh version!

@tannewt
Copy link
Member
tannewt commented Oct 31, 2016

cool cool!

On Mon, Oct 31, 2016 at 11:46 AM ladyada notifications@github.com wrote:

cant recall (its at home) but will try again with fresh version!


You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub
#45 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADNqfvXXDLkDejDv5zUoVAVFuaYHLHqks5q5jeEgaJpZM4KkSck
.

gamblor21 pushed a commit that referenced this issue Apr 24, 2021
update from adafruit main
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
0