Seasons Greeting,
I'm using KW45B41Z with VID:PID=1FC9:0143 and SER=E2KIV02VWSX53.
My intent is to Flash and/or Erase, Set parameters, etc... using
spsdk.mboot.mcuboot.py and other pieces of code from the spsdk integrated within python 3.12 GUI.
But when running the GUI Erase function calling mcuboot flash_erase_all() for example, I get this kind of errors:
Exception in Tkinter callback
Traceback (most recent call last):
File "c:\Python312\Lib\tkinter\__init__.py", line 1948, in __call__
return self.func(*args)
^^^^^^^^^^^^^^^^
File "C:\_dev\spsdk\examples\bmw-poc-gui.py", line 1133, in <lambda>
erase_board_button = tb.Button(blhost_frame, text='Erase Board', command= lambda: self.board.erase_board(self.vid_pid) , bootstyle = INFO)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\_dev\spsdk\examples\bmw-poc-gui.py", line 404, in erase_board
mb.reset(reopen=False)
File "C:\_dev\spsdk\spsdk\mboot\mcuboot.py", line 730, in reset
status = self._process_cmd(cmd_packet).status
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\_dev\spsdk\spsdk\mboot\mcuboot.py", line 129, in _process_cmd
assert isinstance(response, CmdResponse)
AssertionError
the piece of code I use :
def erase_board(self, vid_pid
interfaces = MbootUSBInterface.scan()
if not interfaces:
print("Not founded MCU-BOOT device")
sys.exit()
with McuBoot(interfaces[1], True) as mb:
try:
mb.flash_erase_all()
except McuBootCommandError as e:
if e.error_value != StatusCode.ROMLDR_UNEXPECTED_COMMAND:
raise
except subprocess.CalledProcessError as e:
print(f"Command failed with return code {e.returncode}")
except Exception as err:
print(f"Command failed with return code {err}")
print(err.args) # arguments stored in .args
x = err.args
print(x)
except McuBootError as e:
print(str(e))
sys.exit()
mb.reset(reopen=False)
Thank for the help and for the work of the great team behind the great SPSDK library
Kateb