-
Notifications
You must be signed in to change notification settings - Fork 189
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
Fix SONOFF chip reset after flashing #173
base: master
Are you sure you want to change the base?
Conversation
There's something strange about the connections, seems it's not as simple as I first thought; this patch breaks entering the bootloader on Mac unless I reorder asserting the bootloader pin to be after exiting reset. |
The chip will return to the bootloader after cmdReset if the bootloader pin is not de-asserted after entering the bootloader. To fix this, this patch de-asserts the bootloader pin after a delay.
Revised patch works reliably on Mac and Linux, even with sleeps between every step. I don't quite undetstand the connections, but this work. |
Note: I've been using @sultanqasim's fork where he has incorporated this change for months now to successfully flash Sonoff dongles, so I just wanted to voice my support for merging this, just because then it'd clean up his documentation to not need to mention this outstanding PR anymore and to just use your main code rather than his fork. |
I tried this, but |
@forkineye Which OS (and which OS version) do you use? What’s the minimum sleep that works reliably for you? |
Windows 11. I didn't try taking it any lower, sorry. Was just trying to get everything migrated over to my new dongle. Thanks for getting me in the right direction though! |
Ah, Windows may be slower for some USB operations than Linux and Mac that I tested on. I'm curious if a 5 or 10 ms sleep would work on Windows. |
The chip will return to the bootloader after cmdReset if the bootloader pin is not de-asserted after entering the bootloader. To fix this, this patch de-asserts the bootloader pin after a delay.