[microTVM][Zephyr] Fix flash command for nrfjprog#13723
Conversation
|
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
| if _get_flash_runner() == "openocd" and serial_number: | ||
| flash_extra_args = ["--cmd-pre-init", f"""hla_serial {serial_number}"""] | ||
| if flash_runner == "openocd" and serial_number: | ||
| flash_extra_args += ["--cmd-pre-init", f"""hla_serial {serial_number}"""] |
There was a problem hiding this comment.
nit:
| flash_extra_args += ["--cmd-pre-init", f"""hla_serial {serial_number}"""] | |
| flash_extra_args += ["--cmd-pre-init", f"hla_serial {serial_number}"] |
There was a problem hiding this comment.
I remember testing this without "" around the hla_serial option and it was not working
There was a problem hiding this comment.
@mehrdadh I wonder if it would be f'"hla_serial {serial_number}"', because afaics the triple double-quote in f-string won't expand to an additional double quote -- as I think @guberti pointed out, but I also think it's necessary one double-quite in the final string for the command as you said / experimented.
There was a problem hiding this comment.
I will test this again and fix it in a follow up PR if that was the case
| def _get_nrf_device_args(serial_number: str = None) -> list: | ||
| # iSerial has string type which could mistmatch with | ||
| # the output of `nrfjprog --ids`. Example: 001050007848 vs 1050007848 | ||
| serial_number = str(int(serial_number)) |
There was a problem hiding this comment.
Would it be cleaner to do this? Not sure.
| serial_number = str(int(serial_number)) | |
| serial_number = serial_number.lstrip("0") |
This PR adds serial number to flash command (nrfjprog) to fix cases where multiple devices are available.
This PR adds serial number to flash command (nrfjprog) to fix cases where multiple devices are available.
cc @gromero