diff --git a/avatar2/protocols/jlink.py b/avatar2/protocols/jlink.py index 80187c235b..99abc7eca2 100644 --- a/avatar2/protocols/jlink.py +++ b/avatar2/protocols/jlink.py @@ -26,12 +26,12 @@ class JLinkProtocol(Thread): :ivar origin: the target utilizing this protocol """ - def __init__(self, serial="12345678", device="ARM7", interface="swd", avatar=None, origin=None): + def __init__(self, serial=None, device="ARM7", interface="swd", avatar=None, origin=None): self._shutdown = Event() self.avatar = avatar self._origin = origin self.jlink = pylink.JLink() - self.jlink.open(serial) + self.jlink.open(serial_no=serial) if interface == "swd": # swd is more generic than jtag self.jlink.set_tif(pylink.enums.JLinkInterfaces.SWD) self.log = logging.getLogger('%s.%s' % diff --git a/avatar2/targets/jlink_target.py b/avatar2/targets/jlink_target.py index 5f29d0d0b5..d41f390b17 100644 --- a/avatar2/targets/jlink_target.py +++ b/avatar2/targets/jlink_target.py @@ -10,7 +10,7 @@ class JLinkTarget(Target): - def __init__(self, avatar, serial, interface, device, **kwargs): + def __init__(self, avatar, serial=None, device="ARM7", interface="swd", **kwargs): """ Create a JLink target instance :param avatar: The avatar instance @@ -39,4 +39,4 @@ def reset(self, halt=True): if halt: self.state = TargetStates.STOPPED else: - self.state = TargetStates.RUNNING \ No newline at end of file + self.state = TargetStates.RUNNING diff --git a/handbook/0x02_targets.md b/handbook/0x02_targets.md index 89e4facace..e4d3fe38bb 100644 --- a/handbook/0x02_targets.md +++ b/handbook/0x02_targets.md @@ -106,7 +106,7 @@ Easy to use. For example, with Segger JLink hardware devices, developers do not | name | type | default | purpose | |---------------------|-------|---------|-------------------------------------------------------------------------------------------------| -| serial | str |"123456" | JLink emulator serial number. JLink Onboard provides default number "123456" | +| serial | str | None | JLink emulator serial number. Default None, which leaves JLink the choice where to connect to. | | device | str | "ARM7" | Device name which should be avaliable for used JLink emulator | | interface | str | "swd" | "swd" or "jtag" interface |