-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[microTVM][Zephyr] Fix flash command for nrfjprog #13723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
guberti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just two nits.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember testing this without "" around the hla_serial option and it was not working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be cleaner to do this? Not sure.
| serial_number = str(int(serial_number)) | |
| serial_number = serial_number.lstrip("0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
gromero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
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