From a094a8ddcfe172af716b8521ec9ef28783afdb21 Mon Sep 17 00:00:00 2001 From: Sultan Qasim Khan Date: Tue, 23 Apr 2024 13:50:12 -0400 Subject: [PATCH] Fix SONOFF chip reset after flashing 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. --- cc2538-bsl.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cc2538-bsl.py b/cc2538-bsl.py index 2f0370e..b41754a 100755 --- a/cc2538-bsl.py +++ b/cc2538-bsl.py @@ -241,6 +241,10 @@ def invoke_bootloader(self, dtr_active_high=False, inverted=False, sonoff_usb=Fa set_bootloader_pin(1) set_reset_pin(0) + + # wait to enter bootloader, then deassert bootloader pin + time.sleep(0.002) + set_reset_pin(1) else: set_bootloader_pin(1 if not dtr_active_high else 0) set_reset_pin(0)