Skip to content
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

JLink: Add serial number argument to specify flashing target #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tyler-potyondy
Copy link

@tyler-potyondy tyler-potyondy commented Nov 7, 2024

Overview

Treadmill / CI tests that evaluate networking attach multiple boards to one machine. This PR adds a Tockloader flag (jlink-serial-no) to specify the JLink serial number of the device that should be flashed.

This utilizes JLink's command to specify the serial number of the target.

tockloader/jlinkexe.py Outdated Show resolved Hide resolved
tockloader/jlinkexe.py Outdated Show resolved Hide resolved
).split(),
)
jtag_p = subprocess.Popen(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't entirely remember why this is here... I made these changes ~6 months ago but forgot to create the PR. I think this may have been an artifact of testing / debugging and shouldn't be here.

README.md Outdated Show resolved Hide resolved
tockloader/main.py Outdated Show resolved Hide resolved
tockloader/jlinkexe.py Outdated Show resolved Hide resolved
@tyler-potyondy tyler-potyondy force-pushed the jlink-selector branch 3 times, most recently from f3c1d87 to cdd75b4 Compare November 7, 2024 20:24
@tyler-potyondy
Copy link
Author

Alright, should be good to go. @bradjc I think I fixed all the todos.

flag.

tockloader [command] --jlink-serial-number [serial_number]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a separate paragraph?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was following the formatting above for this as a code block. Should I alter this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's right / necessary for the markdown to render correctly.

Without space before 203:
image

Without space before 207:
image

As-is:
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No sorry I meant this is a jlink option (and only jlink) and should go with the --jlink example above.

Copy link
Member

@ppannuto ppannuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small typo-level things; otherwise lgtm √

tockloader/jlinkexe.py Outdated Show resolved Hide resolved
tockloader/main.py Outdated Show resolved Hide resolved
-adds flag `--jlink-serial-number XXXX` to specify target board
@@ -196,6 +199,10 @@ def _run_jtag_commands(self, commands, binary, write=True):
jlink_file.name,
)

# Append target selector if serial number provided.
if self.jlink_serial_number:
jlink_command += " -USB {}".format(self.jlink_serial_number)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, I guess this could lead to weird errors if you happen to supply a "serial number" with spaces or other weird characters in there. On the other hand, I don't think we should sanitize these inputs, so this seems good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants