Skip to content

Commit

Permalink
gpio: fix app_path issues
Browse files Browse the repository at this point in the history
  • Loading branch information
charles37 committed Oct 30, 2024
1 parent 21af05a commit 9855984
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 64 deletions.
14 changes: 7 additions & 7 deletions hwci/boards/tockloader_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,28 @@ def __init__(self):
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
)

def flash_app(self, app):
logging.info(f"Flashing app: {app}")
def flash_app(self, app_path):
app_name = os.path.basename(app_path)
logging.info(f"Flashing app: {app_name}")
libtock_c_dir = os.path.join(self.base_dir, "libtock-c")
if not os.path.exists(libtock_c_dir):
logging.error(f"libtock-c directory {libtock_c_dir} not found")
raise FileNotFoundError(f"libtock-c directory {libtock_c_dir} not found")

app_dir = os.path.join(libtock_c_dir, "examples", app)
app_dir = os.path.join(libtock_c_dir, "examples", app_path)
if not os.path.exists(app_dir):
logging.error(f"App directory {app_dir} not found")
raise FileNotFoundError(f"App directory {app_dir} not found")

# Build the app using absolute paths
logging.info(f"Building app: {app}")
logging.info(f"Building app: {app_name}")
subprocess.run(["make", f"TOCK_TARGETS={self.arch}"], cwd=app_dir, check=True)

tab_file = os.path.join(app_dir, "build", f"{app}.tab")
tab_file = os.path.join(app_dir, "build", f"{app_name}.tab")
if not os.path.exists(tab_file):
logging.error(f"Tab file {tab_file} not found")
raise FileNotFoundError(f"Tab file {tab_file} not found")

logging.info(f"Installing app: {app}")
logging.info(f"Installing app: {app_name}")
subprocess.run(
[
"tockloader",
Expand Down
28 changes: 0 additions & 28 deletions hwci/target-spec.yml

This file was deleted.

28 changes: 0 additions & 28 deletions hwci/target_spec.yml

This file was deleted.

5 changes: 4 additions & 1 deletion hwci/tests/mpu_walk_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@


class MpuWalkRegionTest(OneshotTest):
def __init__(self):
super().__init__(apps=["tests/mpu/mpu_walk_region"])

def oneshot_test(self, board):
gpio = board.gpio
serial = board.serial
Expand Down Expand Up @@ -69,4 +72,4 @@ def oneshot_test(self, board):
logging.info("MPU Walk Region Test completed successfully")


test = MpuWalkRegionTest(["mpu_walk_region"])
test = MpuWalkRegionTest()

0 comments on commit 9855984

Please sign in to comment.