mirror of
https://github.com/MikronMIK32/mik32-uploader.git
synced 2026-01-01 13:37:03 +03:00
fix spi, fix uart stuff
This commit is contained in:
parent
06f6bd03cc
commit
0399d3110c
@ -73,7 +73,7 @@ def parse_hex(file: str) -> dict:
|
|||||||
elif rectype == 4: # Extended Linear Address Record
|
elif rectype == 4: # Extended Linear Address Record
|
||||||
print("Extended Linear Address Record")
|
print("Extended Linear Address Record")
|
||||||
print("ERROR: unimplemented record type 4 on line %i" % (i+1))
|
print("ERROR: unimplemented record type 4 on line %i" % (i+1))
|
||||||
is_error = True
|
# is_error = True
|
||||||
elif rectype == 5: # Start Linear Address Record
|
elif rectype == 5: # Start Linear Address Record
|
||||||
print("Start Linear Address is 0x%s (line %i)" %
|
print("Start Linear Address is 0x%s (line %i)" %
|
||||||
(data_bytes_line, (i+1)))
|
(data_bytes_line, (i+1)))
|
||||||
|
|||||||
@ -5,7 +5,7 @@ from pathlib import Path
|
|||||||
def write_file(filename):
|
def write_file(filename):
|
||||||
|
|
||||||
with OpenOcdTclRpc() as openocd:
|
with OpenOcdTclRpc() as openocd:
|
||||||
openocd.halt()
|
openocd.reset_halt()
|
||||||
print(openocd.run("load_image {%s} 0x0" % Path(filename)))
|
print(openocd.run("load_image {%s} 0x0" % Path(filename)))
|
||||||
openocd.resume(0)
|
openocd.resume(0)
|
||||||
print("RAM write file maybe done")
|
print("RAM write file maybe done")
|
||||||
|
|||||||
@ -91,6 +91,10 @@ class OpenOcdTclRpc:
|
|||||||
else:
|
else:
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
|
def reset_halt(self):
|
||||||
|
"""Halt MCU and raise an error if it returns an error"""
|
||||||
|
return self.run("capture \"reset halt\"")
|
||||||
|
|
||||||
def halt(self):
|
def halt(self):
|
||||||
"""Halt MCU and raise an error if it returns an error"""
|
"""Halt MCU and raise an error if it returns an error"""
|
||||||
return self.run("capture \"halt\"")
|
return self.run("capture \"halt\"")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user