mirror of
https://github.com/MikronMIK32/mik32-uploader.git
synced 2026-01-01 13:37:03 +03:00
wip
This commit is contained in:
parent
46c72768e0
commit
9c184971ca
@ -3,6 +3,7 @@ from typing import Dict, List
|
||||
import time
|
||||
from tclrpc import TclException
|
||||
from tclrpc import OpenOcdTclRpc
|
||||
import config
|
||||
|
||||
# --------------------------
|
||||
# PM register offset
|
||||
@ -319,13 +320,13 @@ def spifi_read_data(openocd: OpenOcdTclRpc, address: int, byte_count: int, bin_d
|
||||
for i in range(byte_count):
|
||||
data8 = openocd.read_memory(SPIFI_CONFIG_DATA32, 8, 1)[0]
|
||||
read_data.append(data8)
|
||||
if is_verbose:
|
||||
if config.is_verbose:
|
||||
print(f"DATA[{i+address}] = {read_data[i]:#0x}")
|
||||
|
||||
for i in range(byte_count):
|
||||
if read_data[i] != bin_data[i]:
|
||||
print(f"DATA[{i+address}] = {read_data[i]:#0x} - ошибка")
|
||||
return 1
|
||||
print(f"DATA[{(i+address):#0x}] = {read_data[i]:#0x}, expected {bin_data[i]:#0x}")
|
||||
# return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@ import mik32_eeprom
|
||||
import mik32_spifi
|
||||
import mik32_ram
|
||||
from mik32_parsers import *
|
||||
import config
|
||||
|
||||
|
||||
# class bcolors(Enum):
|
||||
@ -245,7 +246,7 @@ def createParser():
|
||||
default=OpenOcdTclRpc.DEFAULT_PORT)
|
||||
parser.add_argument('--keep-halt', dest='keep_halt',
|
||||
action='store_true', default=False)
|
||||
parser.add_argument('--verbose', dest='is_verbose',
|
||||
parser.add_argument('-v', '--verbose', dest='is_verbose',
|
||||
action='store_true', default=False)
|
||||
# parser.add_argument('-b', '--boot-mode', default='undefined')
|
||||
|
||||
@ -255,7 +256,7 @@ def createParser():
|
||||
if __name__ == '__main__':
|
||||
parser = createParser()
|
||||
namespace = parser.parse_args()
|
||||
is_verbose = namespace.is_verbose
|
||||
config.is_verbose = namespace.is_verbose
|
||||
|
||||
if namespace.filepath:
|
||||
upload_file(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user