Merge pull request #15701 from s-hadinger/sonoff_zbpro_better

Zigbee flasher for Sonoff ZB Bridge Pro - dump + firmware
This commit is contained in:
s-hadinger 2022-05-26 19:25:58 +02:00 committed by GitHub
commit 633aa13080
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5263 additions and 18 deletions

View File

@ -48,8 +48,6 @@ class sonoff_zb_pro_flasher
################################################################################# #################################################################################
# Flash the firmware to the device # Flash the firmware to the device
# #
# Actions:
# 1.
################################################################################# #################################################################################
def flash() def flash()
if !self.file_checked if !self.file_checked
@ -76,12 +74,25 @@ class sonoff_zb_pro_flasher
end end
end end
#################################################################################
# Dump firmware to local file
#
#################################################################################
def dump_to_file(filename)
import cc2652_flasher # this stops zigbee and configures serial
self.flasher = cc2652_flasher
print("FLH: Dump started (takes 3 minutes during which Tasmota is unresponsive)")
self.flasher.start()
self.flasher.ping()
self.flasher.flash_dump_to_file(filename, 0x000000, 0x58000)
print("FLH: Dump completed")
end
################################################################################# #################################################################################
# low-level # low-level
################################################################################# #################################################################################
def _flash_pre() def _flash_pre()
print("FLH: Flashing started") print("FLH: Flashing started (takes 5 minutes during which Tasmota is unresponsive)")
self.flasher.start() self.flasher.start()
self.flasher.ping() self.flasher.ping()
# erase flash # erase flash
@ -147,27 +158,19 @@ return sonoff_zb_pro_flasher()
#- #-
# Flash local firmware
import sonoff_zb_pro_flasher as cc import sonoff_zb_pro_flasher as cc
cc.load("znp_patched.hex") cc.load("SonoffZBPro_coord_20220219.hex")
cc.check() cc.check()
cc.flash() cc.flash()
-#
#-
# Dump local firmware
# test with invalid
import sonoff_zb_pro_flasher as cc import sonoff_zb_pro_flasher as cc
cc.load("znp_dont_use.hex") cc.dump_to_file("SonoffZBPro_dump.bin")
cc.check()
print("start")
var f = open("znp_patched.hex")
while true
var r = f.readline()
if r == "" break end
end
print("end")
-# -#

File diff suppressed because it is too large Load Diff