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
|
import time
|
||||||
from tclrpc import TclException
|
from tclrpc import TclException
|
||||||
from tclrpc import OpenOcdTclRpc
|
from tclrpc import OpenOcdTclRpc
|
||||||
|
import config
|
||||||
|
|
||||||
# --------------------------
|
# --------------------------
|
||||||
# PM register offset
|
# 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):
|
for i in range(byte_count):
|
||||||
data8 = openocd.read_memory(SPIFI_CONFIG_DATA32, 8, 1)[0]
|
data8 = openocd.read_memory(SPIFI_CONFIG_DATA32, 8, 1)[0]
|
||||||
read_data.append(data8)
|
read_data.append(data8)
|
||||||
if is_verbose:
|
if config.is_verbose:
|
||||||
print(f"DATA[{i+address}] = {read_data[i]:#0x}")
|
print(f"DATA[{i+address}] = {read_data[i]:#0x}")
|
||||||
|
|
||||||
for i in range(byte_count):
|
for i in range(byte_count):
|
||||||
if read_data[i] != bin_data[i]:
|
if read_data[i] != bin_data[i]:
|
||||||
print(f"DATA[{i+address}] = {read_data[i]:#0x} - ошибка")
|
print(f"DATA[{(i+address):#0x}] = {read_data[i]:#0x}, expected {bin_data[i]:#0x}")
|
||||||
return 1
|
# return 1
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import mik32_eeprom
|
|||||||
import mik32_spifi
|
import mik32_spifi
|
||||||
import mik32_ram
|
import mik32_ram
|
||||||
from mik32_parsers import *
|
from mik32_parsers import *
|
||||||
|
import config
|
||||||
|
|
||||||
|
|
||||||
# class bcolors(Enum):
|
# class bcolors(Enum):
|
||||||
@ -245,7 +246,7 @@ def createParser():
|
|||||||
default=OpenOcdTclRpc.DEFAULT_PORT)
|
default=OpenOcdTclRpc.DEFAULT_PORT)
|
||||||
parser.add_argument('--keep-halt', dest='keep_halt',
|
parser.add_argument('--keep-halt', dest='keep_halt',
|
||||||
action='store_true', default=False)
|
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)
|
action='store_true', default=False)
|
||||||
# parser.add_argument('-b', '--boot-mode', default='undefined')
|
# parser.add_argument('-b', '--boot-mode', default='undefined')
|
||||||
|
|
||||||
@ -255,7 +256,7 @@ def createParser():
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = createParser()
|
parser = createParser()
|
||||||
namespace = parser.parse_args()
|
namespace = parser.parse_args()
|
||||||
is_verbose = namespace.is_verbose
|
config.is_verbose = namespace.is_verbose
|
||||||
|
|
||||||
if namespace.filepath:
|
if namespace.filepath:
|
||||||
upload_file(
|
upload_file(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user