Skip to content

Commit

Permalink
armv7a9: provide jtag reset for target
Browse files Browse the repository at this point in the history
Utilize new way of rebooting target using available debugger (Jtag/SMT2)

JIRA: CI-515
  • Loading branch information
maska989 committed Nov 25, 2024
1 parent 7d293cb commit 15cb146
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions trunner/target/armv7a9.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,46 @@
)
from trunner.harness import TerminalHarness
from trunner.host import Host
from trunner.tools import Phoenixd, OpenocdGdbServer, wait_for_vid_pid
from trunner.tools import Phoenixd, OpenocdGdbServer, Openocd, wait_for_vid_pid
from trunner.types import TestResult, TestOptions
from .base import TargetBase, find_port


class ARMv7A9TargetRebooter(Rebooter):
# TODO add text mode reboot

def _reboot_by_debugger(self):
# after flashing device is necessary to wait bit of time to free all resources
time.sleep(2)
Openocd(
self,
board="digilent_zedboard",
extra_args=[
"-c adapter srst pulse_width 250",
"-c adapter srst delay 250",
"-c adapter speed 10000",
"-c init; reset; continue",
],
)
time.sleep(0.5)

def _reboot_soft(self):
self._reboot_hard()

def _reboot_hard(self):

self.host.set_power(False)
# optimal power off time to prevent sustaining chips, e.g. flash memory, related to #540 issue
time.sleep(0.75)
self.dut.clear_buffer()
self.host.set_power(True)
time.sleep(0.05)
# optimal timeout after cuting off power lines for bring up all devices in chain
time.sleep(0.5)
# after reboot we need to wait for start smt2 device
wait_for_vid_pid(vid=0x0403, pid=0x6014, device="smt2", timeout=5)

def _set_flash_mode(self, flash):

self.host.set_flash_mode(not flash)


Expand All @@ -53,9 +73,6 @@ def __init__(self, dut: Dut, script: str, cwd: Optional[str] = None):
def __call__(self):
"""Loads plo image to RAM using gdb."""

# after reboot we need to wait for smt2 device
wait_for_vid_pid(vid=0x0403, pid=0x6014, device="smt2", timeout=5)

with self.gdbserver.run():
try:
subprocess.run(
Expand Down

0 comments on commit 15cb146

Please sign in to comment.