From a9f78898b3972f1719f3cfaf772d23b8f60fe87c Mon Sep 17 00:00:00 2001 From: Bjoern Kerler Date: Fri, 10 Jan 2020 12:59:01 +0100 Subject: [PATCH] MSM8916 fixes --- Library/firehose.py | 10 ++++++++++ Library/usblib.py | 5 ++++- requirements.txt | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Library/firehose.py b/Library/firehose.py index 6ba6280..c30ad3f 100755 --- a/Library/firehose.py +++ b/Library/firehose.py @@ -526,6 +526,16 @@ class qualcomm_firehose: if rsp[0] == True: self.cdc.read() + if not "MemoryName" in rsp[1]: + #print(rsp[1]) + rsp[1]["MemoryName"]="eMMC" + if not "MaxXMLSizeInBytes" in rsp[1]: + rsp[1]["MaxXMLSizeInBytes"]="4096" + logging.warning("Couldn't detect MaxPayloadSizeFromTargetinBytes") + if not "MaxPayloadSizeToTargetInBytes" in rsp[1]: + rsp[1]["MaxPayloadSizeToTargetInBytes"] = "1038576" + if not "MaxPayloadSizeToTargetInBytesSupported" in rsp[1]: + rsp[1]["MaxPayloadSizeToTargetInBytesSupported"] = "1038576" self.cfg.MemoryName = rsp[1]["MemoryName"] self.cfg.MaxPayloadSizeToTargetInBytes = int(rsp[1]["MaxPayloadSizeToTargetInBytes"]) self.cfg.MaxPayloadSizeToTargetInBytesSupported = int(rsp[1]["MaxPayloadSizeToTargetInBytesSupported"]) diff --git a/Library/usblib.py b/Library/usblib.py index ceb7610..bf2a874 100755 --- a/Library/usblib.py +++ b/Library/usblib.py @@ -156,7 +156,10 @@ class usb_class(): try: logger.debug("TX: "+command.decode('utf-8')) except: - logger.debug("TX: "+hexlify(command).decode('utf-8')) + try: + logger.debug("TX: "+hexlify(command).decode('utf-8')) + except: + logger.debug("TX: "+command) return True def read(self,length=0x80000, timeout=None): diff --git a/requirements.txt b/requirements.txt index 34a5a8c..9e6f8e4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ pyusb pyserial docopt -pylzma \ No newline at end of file +pylzma +pycryptodome \ No newline at end of file