forked from auto-pts/auto-pts
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# | ||
# auto-pts - The Bluetooth PTS Automation Framework | ||
# | ||
# Copyright (c) 2024, Nordic Semiconductor ASA. | ||
# Copyright (c) 2024, Codecoup. | ||
# | ||
# This program is free software; you can redistribute it and/or modify it | ||
# under the terms and conditions of the GNU General Public License, | ||
# version 2, as published by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
# more details. | ||
# | ||
import logging | ||
import os | ||
|
||
from autopts.bot.common import check_call | ||
|
||
supported_projects = ['zephyr'] | ||
|
||
board_type = 'nrf54h20dk/nrf54h20/cpuapp' | ||
|
||
|
||
def reset_cmd(iutctl): | ||
"""Return reset command for nRF54H DUT | ||
Dependency: nRF54H command line tools | ||
""" | ||
return f'nrfutil device reset --reset-kind RESET_PIN --serial-number {iutctl.debugger_snr}' | ||
|
||
|
||
def build_and_flash(zephyr_wd, board, debugger_snr, conf_file=None, *args): | ||
"""Build and flash Zephyr binary | ||
:param zephyr_wd: Zephyr source path | ||
:param board: IUT | ||
:param debugger_snr serial number | ||
:param conf_file: configuration file to be used | ||
""" | ||
logging.debug("%s: %s %s %s", build_and_flash.__name__, zephyr_wd, | ||
board, conf_file) | ||
tester_dir = os.path.join(zephyr_wd, "tests", "bluetooth", "tester") | ||
|
||
check_call('rm -rf build/'.split(), cwd=tester_dir) | ||
|
||
cmd = ['west', 'build', '-p', 'auto', '-b', board] | ||
if conf_file and conf_file not in ['default', 'prj.conf']: | ||
if 'audio' in conf_file: | ||
conf_file += ';overlay-le-audio-ctlr.conf' | ||
cmd.extend(('--', f'-DOVERLAY_CONFIG=\'{conf_file}\'')) | ||
|
||
check_call(cmd, cwd=tester_dir) | ||
check_call(['west', 'flash', '--skip-rebuild', | ||
'-i', debugger_snr], cwd=tester_dir) |