Skip to content

Commit

Permalink
Merge pull request #15701 from s-hadinger/sonoff_zbpro_better
Browse files Browse the repository at this point in the history
Zigbee flasher for Sonoff ZB Bridge Pro - dump + firmware
  • Loading branch information
s-hadinger authored May 26, 2022
2 parents 5375ed5 + b3415c9 commit 633aa13
Show file tree
Hide file tree
Showing 2 changed files with 5,263 additions and 18 deletions.
39 changes: 21 additions & 18 deletions tasmota/berry/zigbee/sonoff_zb_pro_flasher.be
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class sonoff_zb_pro_flasher
#################################################################################
# Flash the firmware to the device
#
# Actions:
# 1.
#################################################################################
def flash()
if !self.file_checked
Expand All @@ -76,12 +74,25 @@ class sonoff_zb_pro_flasher
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
#################################################################################
def _flash_pre()
print("FLH: Flashing started")
print("FLH: Flashing started (takes 5 minutes during which Tasmota is unresponsive)")
self.flasher.start()
self.flasher.ping()
# erase flash
Expand Down Expand Up @@ -147,27 +158,19 @@ return sonoff_zb_pro_flasher()


#-
# Flash local firmware
import sonoff_zb_pro_flasher as cc
cc.load("znp_patched.hex")
cc.load("SonoffZBPro_coord_20220219.hex")
cc.check()
cc.flash()
-#

# test with invalid
import sonoff_zb_pro_flasher as cc
cc.load("znp_dont_use.hex")
cc.check()
#-
# Dump local firmware
print("start")
var f = open("znp_patched.hex")
while true
var r = f.readline()
if r == "" break end
end
print("end")
import sonoff_zb_pro_flasher as cc
cc.dump_to_file("SonoffZBPro_dump.bin")
-#
Loading

0 comments on commit 633aa13

Please sign in to comment.