Skip to content

Commit

Permalink
Revert "[microTVM] Update nrfjprog on reference virtual machine (apac…
Browse files Browse the repository at this point in the history
…he#7723)"

This reverts commit da1d015.
  • Loading branch information
mehrdadh committed Mar 23, 2021
1 parent 5124ed4 commit 2442100
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 44 deletions.
28 changes: 5 additions & 23 deletions apps/microtvm/reference-vm/base-box-tool.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@
"vmware_desktop",
)

# List of microTVM platforms for testing.
ALL_MICROTVM_PLATFORMS = (
"stm32f746xx",
"nrf5340dk",
)


def parse_virtualbox_devices():
output = subprocess.check_output(["VBoxManage", "list", "usbhost"], encoding="utf-8")
Expand Down Expand Up @@ -115,7 +109,6 @@ def attach_virtualbox(uuid, vid_hex=None, pid_hex=None, serial=None):
if serial is not None:
rule_args.extend(["--serialnumber", serial])
subprocess.check_call(rule_args)
# TODO(mehrdadh): skip usb attach if it's already attached
subprocess.check_call(["VBoxManage", "controlvm", uuid, "usbattach", dev["UUID"]])
return

Expand Down Expand Up @@ -315,17 +308,13 @@ def test_command(args):
test_config_file = os.path.join(base_box_dir, "test-config.json")
with open(test_config_file) as f:
test_config = json.load(f)

# select microTVM test platform
microtvm_test_platform = test_config[args.microtvm_platform]

for key, expected_type in REQUIRED_TEST_CONFIG_KEYS.items():
assert key in microtvm_test_platform and isinstance(
microtvm_test_platform[key], expected_type
assert key in test_config and isinstance(
test_config[key], expected_type
), f"Expected key {key} of type {expected_type} in {test_config_file}: {test_config!r}"

microtvm_test_platform["vid_hex"] = microtvm_test_platform["vid_hex"].lower()
microtvm_test_platform["pid_hex"] = microtvm_test_platform["pid_hex"].lower()
test_config["vid_hex"] = test_config["vid_hex"].lower()
test_config["pid_hex"] = test_config["pid_hex"].lower()

providers = args.provider
provider_passed = {p: False for p in providers}
Expand All @@ -342,7 +331,7 @@ def test_command(args):
release_test_dir, user_box_dir, base_box_dir, provider_name
)
do_run_release_test(
release_test_dir, provider_name, microtvm_test_platform, args.test_device_serial
release_test_dir, provider_name, test_config, args.test_device_serial
)
provider_passed[provider_name] = True

Expand Down Expand Up @@ -455,13 +444,6 @@ def parse_args():
),
)

parser.add_argument(
"--microtvm-platform",
default="stm32f746xx",
choices=ALL_MICROTVM_PLATFORMS,
help="For use with 'test' command. MicroTVM platfrom that are used for testing.",
)

return parser.parse_args()


Expand Down
15 changes: 5 additions & 10 deletions apps/microtvm/reference-vm/zephyr/base-box/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,17 @@ sudo apt install -y llvm
sudo apt install -y protobuf-compiler libprotoc-dev

# nrfjprog
NRF_COMMANDLINE_TOOLS_FILE=nRFCommandLineToolsLinuxamd64.tar.gz
NRF_COMMANDLINE_TOOLS_URL=https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF-command-line-tools/sw/Versions-10-x-x/10-12-1/nRFCommandLineTools10121Linuxamd64.tar.gz
NRF_COMMANDLINE_TOOLS_INSTALLER=nRF-Command-Line-Tools_10_12_1_Linux-amd64.deb
JLINK_LINUX_INSTALLER=JLink_Linux_V688a_x86_64.deb

cd ~
mkdir -p nrfjprog
wget --no-verbose -O $NRF_COMMANDLINE_TOOLS_FILE $NRF_COMMANDLINE_TOOLS_URL
wget --no-verbose -O nRFCommandLineTools1090Linuxamd64.tar.gz https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF-command-line-tools/sw/Versions-10-x-x/10-9-0/nRFCommandLineTools1090Linuxamd64tar.gz
cd nrfjprog
tar -xzvf "../${NRF_COMMANDLINE_TOOLS_FILE}"
sudo apt install -y "./${JLINK_LINUX_INSTALLER}"
sudo apt install -y "./${NRF_COMMANDLINE_TOOLS_INSTALLER}"
tar -xzvf ../nRFCommandLineTools1090Linuxamd64.tar.gz
sudo apt install -y ./JLink_Linux_V680a_x86_64.deb
sudo apt install -y ./nRF-Command-Line-Tools_10_9_0_Linux-amd64.deb
source ~/.profile
nrfjprog --help
cd ..
rm -rf nrfjprog "${NRF_COMMANDLINE_TOOLS_FILE}"
rm -rf nrfjprog nRFCommandLineTools1090Linuxamd64.tar.gz

# Zephyr
pip3 install --user -U west
Expand Down
14 changes: 3 additions & 11 deletions apps/microtvm/reference-vm/zephyr/base-box/test-config.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
{
"stm32f746xx": {
"vid_hex": "0483",
"pid_hex": "374b",
"test_cmd": ["pytest", "tests/micro/qemu/test_zephyr.py", "--microtvm-platforms=stm32f746xx"]
},
"nrf5340dk": {
"vid_hex": "1366",
"pid_hex": "1055",
"test_cmd": ["pytest", "tests/micro/qemu/test_zephyr.py", "--microtvm-platforms=nrf5340dk"]
}
{"vid_hex": "0483",
"pid_hex": "374b",
"test_cmd": ["pytest", "tests/micro/qemu/test_zephyr.py", "--microtvm-platforms=stm32f746xx"]
}

0 comments on commit 2442100

Please sign in to comment.