mirror of
https://github.com/MikronMIK32/mik32-uploader.git
synced 2026-01-01 13:37:03 +03:00
WIP writing in spifi
This commit is contained in:
parent
1f90a39a48
commit
a244b042d6
@ -127,6 +127,8 @@ def upload_file(filename: str, is_resume=True) -> int:
|
|||||||
# print(DEFAULT_OPENOCD_EXEC_FILE_PATH)
|
# print(DEFAULT_OPENOCD_EXEC_FILE_PATH)
|
||||||
# print(DEFAULT_OPENOCD_SCRIPTS_PATH)
|
# print(DEFAULT_OPENOCD_SCRIPTS_PATH)
|
||||||
|
|
||||||
|
result = 1
|
||||||
|
|
||||||
if not os.path.exists(filename):
|
if not os.path.exists(filename):
|
||||||
print("ERROR: File %s does not exist" % filename)
|
print("ERROR: File %s does not exist" % filename)
|
||||||
exit(1)
|
exit(1)
|
||||||
@ -149,6 +151,11 @@ def upload_file(filename: str, is_resume=True) -> int:
|
|||||||
|
|
||||||
if segment_section.type == MemoryType.EEPROM:
|
if segment_section.type == MemoryType.EEPROM:
|
||||||
result = write_words(bytes2words(segment.data), is_resume)
|
result = write_words(bytes2words(segment.data), is_resume)
|
||||||
|
elif segment_section.type == MemoryType.SPIFI:
|
||||||
|
result = spifi_write_file(segment.data, is_resume)
|
||||||
|
# elif segment_section.type == MemoryType.RAM:
|
||||||
|
# write_file(filename, is_resume)
|
||||||
|
# result = write_words(bytes2words(segment.data), is_resume)
|
||||||
|
|
||||||
# cmd = shlex.split("%s -s %s -f interface/ftdi/m-link.cfg -f target/mcu32.cfg" % (DEFAULT_OPENOCD_EXEC_FILE_PATH, DEFAULT_OPENOCD_SCRIPTS_PATH), posix=False)
|
# cmd = shlex.split("%s -s %s -f interface/ftdi/m-link.cfg -f target/mcu32.cfg" % (DEFAULT_OPENOCD_EXEC_FILE_PATH, DEFAULT_OPENOCD_SCRIPTS_PATH), posix=False)
|
||||||
# with subprocess.Popen(cmd, shell=True, stdout=subprocess.DEVNULL) as proc:
|
# with subprocess.Popen(cmd, shell=True, stdout=subprocess.DEVNULL) as proc:
|
||||||
@ -176,7 +183,7 @@ def upload_file(filename: str, is_resume=True) -> int:
|
|||||||
# raise Exception("Unsupported boot source, use eeprom or spifi")
|
# raise Exception("Unsupported boot source, use eeprom or spifi")
|
||||||
# result = 1
|
# result = 1
|
||||||
|
|
||||||
return 1
|
return result
|
||||||
|
|
||||||
|
|
||||||
def createParser():
|
def createParser():
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user