mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
px_uploader: print chip version
This commit is contained in:
committed by
Lorenz Meier
parent
d9b4f5b170
commit
332d42b105
@@ -160,6 +160,7 @@ class uploader(object):
|
|||||||
GET_CRC = b'\x29' # rev3+
|
GET_CRC = b'\x29' # rev3+
|
||||||
GET_OTP = b'\x2a' # rev4+ , get a word from OTP area
|
GET_OTP = b'\x2a' # rev4+ , get a word from OTP area
|
||||||
GET_SN = b'\x2b' # rev4+ , get a word from SN area
|
GET_SN = b'\x2b' # rev4+ , get a word from SN area
|
||||||
|
GET_CHIP = b'\x2c' # rev5+ , get chip version
|
||||||
REBOOT = b'\x30'
|
REBOOT = b'\x30'
|
||||||
|
|
||||||
INFO_BL_REV = b'\x01' # bootloader protocol revision
|
INFO_BL_REV = b'\x01' # bootloader protocol revision
|
||||||
@@ -258,7 +259,7 @@ class uploader(object):
|
|||||||
self.__getSync()
|
self.__getSync()
|
||||||
return value
|
return value
|
||||||
|
|
||||||
# send the GET_OTP command and wait for an info parameter
|
# send the GET_SN command and wait for an info parameter
|
||||||
def __getSN(self, param):
|
def __getSN(self, param):
|
||||||
t = struct.pack("I", param) # int param as 32bit ( 4 byte ) char array.
|
t = struct.pack("I", param) # int param as 32bit ( 4 byte ) char array.
|
||||||
self.__send(uploader.GET_SN + t + uploader.EOC)
|
self.__send(uploader.GET_SN + t + uploader.EOC)
|
||||||
@@ -266,6 +267,13 @@ class uploader(object):
|
|||||||
self.__getSync()
|
self.__getSync()
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
# send the GET_CHIP command
|
||||||
|
def __getCHIP(self):
|
||||||
|
self.__send(uploader.GET_CHIP + uploader.EOC)
|
||||||
|
value = self.__recv_int()
|
||||||
|
self.__getSync()
|
||||||
|
return value
|
||||||
|
|
||||||
def __drawProgressBar(self, label, progress, maxVal):
|
def __drawProgressBar(self, label, progress, maxVal):
|
||||||
if maxVal < progress:
|
if maxVal < progress:
|
||||||
progress = maxVal
|
progress = maxVal
|
||||||
@@ -451,6 +459,7 @@ class uploader(object):
|
|||||||
self.sn = self.sn + x
|
self.sn = self.sn + x
|
||||||
print(binascii.hexlify(x).decode('Latin-1'), end='') # show user
|
print(binascii.hexlify(x).decode('Latin-1'), end='') # show user
|
||||||
print('')
|
print('')
|
||||||
|
print("chip: %08x" % self.__getCHIP())
|
||||||
except Exception:
|
except Exception:
|
||||||
# ignore bad character encodings
|
# ignore bad character encodings
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user