mirror of
https://github.com/MikronMIK32/mik32-uploader.git
synced 2026-01-01 13:37:03 +03:00
debug lockup
This commit is contained in:
parent
a09c3a0af4
commit
5091d411c5
@ -11,6 +11,7 @@ import mik32_spifi
|
|||||||
import mik32_ram
|
import mik32_ram
|
||||||
import mik32_pm
|
import mik32_pm
|
||||||
from mik32_parsers import *
|
from mik32_parsers import *
|
||||||
|
import logging, sys
|
||||||
|
|
||||||
|
|
||||||
# class bcolors(Enum):
|
# class bcolors(Enum):
|
||||||
@ -309,19 +310,31 @@ def upload_file(
|
|||||||
proc: Union[subprocess.Popen, None] = None
|
proc: Union[subprocess.Popen, None] = None
|
||||||
if is_run_openocd:
|
if is_run_openocd:
|
||||||
try:
|
try:
|
||||||
|
logging.debug("OpenOCD try start!")
|
||||||
|
|
||||||
proc = run_openocd(openocd_exec, openocd_scripts,
|
proc = run_openocd(openocd_exec, openocd_scripts,
|
||||||
openocd_interface, openocd_target, is_open_console)
|
openocd_interface, openocd_target, is_open_console)
|
||||||
|
|
||||||
|
logging.debug("OpenOCD started!")
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise OpenOCDStartupException(e)
|
raise OpenOCDStartupException(e)
|
||||||
try:
|
try:
|
||||||
with OpenOcdTclRpc(host, port) as openocd:
|
with OpenOcdTclRpc(host, port) as openocd:
|
||||||
|
test_connection()
|
||||||
|
|
||||||
|
logging.debug("OpenOCD connection tested!")
|
||||||
|
|
||||||
if (all(openocd_interface.find(i) == -1 for i in adapter_speed_not_supported)):
|
if (all(openocd_interface.find(i) == -1 for i in adapter_speed_not_supported)):
|
||||||
openocd.run(f"adapter speed {adapter_speed}")
|
openocd.run(f"adapter speed {adapter_speed}")
|
||||||
openocd.run(f"log_output \"{log_path}\"")
|
openocd.run(f"log_output \"{log_path}\"")
|
||||||
openocd.run(f"debug_level 1")
|
openocd.run(f"debug_level 1")
|
||||||
|
|
||||||
|
logging.debug("OpenOCD configured!")
|
||||||
|
|
||||||
mik32_pm.pm_init(openocd)
|
mik32_pm.pm_init(openocd)
|
||||||
|
|
||||||
|
logging.debug("PM configured!")
|
||||||
|
|
||||||
if (pages.pages_eeprom.__len__() > 0):
|
if (pages.pages_eeprom.__len__() > 0):
|
||||||
start_time = time.perf_counter()
|
start_time = time.perf_counter()
|
||||||
|
|
||||||
@ -477,6 +490,8 @@ def createParser():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
|
||||||
|
|
||||||
parser = createParser()
|
parser = createParser()
|
||||||
namespace = parser.parse_args()
|
namespace = parser.parse_args()
|
||||||
|
|
||||||
|
|||||||
@ -51,6 +51,7 @@ class OpenOcdTclRpc:
|
|||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
|
self.sock.settimeout(10.0)
|
||||||
self.sock.connect((self.host, self.port))
|
self.sock.connect((self.host, self.port))
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user