diff --git a/apps/microtvm/zephyr/template_project/microtvm_api_server.py b/apps/microtvm/zephyr/template_project/microtvm_api_server.py index 8ab6381e73c5..30a61bb4f89f 100644 --- a/apps/microtvm/zephyr/template_project/microtvm_api_server.py +++ b/apps/microtvm/zephyr/template_project/microtvm_api_server.py @@ -275,7 +275,7 @@ def server_info_query(self, tvm_version): "qemu_cortex_r5", "qemu_riscv64", ), - "CONFIG_ENTROPY_GENERATOR_BOARDS=y": ( + "CONFIG_ENTROPY_GENERATOR=y": ( "mps2_an521", "nrf5340dk_nrf5340_cpuapp", "nucleo_f746zg", @@ -313,7 +313,7 @@ def _create_prj_conf(self, project_dir, options): f.write("# For random number generation.\n" "CONFIG_TEST_RANDOM_GENERATOR=y\n") - f.write("\n# Extra prj.conf directives") + f.write("\n# Extra prj.conf directives\n") for line, board_list in self.EXTRA_PRJ_CONF_DIRECTIVES.items(): if options["zephyr_board"] in board_list: f.write(f"{line}\n") diff --git a/tests/micro/zephyr/test_zephyr_aot.py b/tests/micro/zephyr/test_zephyr_aot.py index 1602a4185462..4f1f646e8b1e 100644 --- a/tests/micro/zephyr/test_zephyr_aot.py +++ b/tests/micro/zephyr/test_zephyr_aot.py @@ -15,8 +15,6 @@ # specific language governing permissions and limitations # under the License. -import datetime -from hashlib import new import io import logging import os @@ -113,13 +111,13 @@ def _create_header_file(tensor_name, npy_data, output_path, tar_file): tar_file.addfile(ti, io.BytesIO(header_file_bytes)) -def _read_line(fd): +def _read_line(fd, timeout_sec: int): data = "" new_line = False while True: if new_line: break - new_data = fd.read(1, timeout_sec=10) + new_data = fd.read(1, timeout_sec=timeout_sec) logging.debug(f"read data: {new_data}") for item in new_data: new_c = chr(item) @@ -130,9 +128,9 @@ def _read_line(fd): return data -def _get_message(fd, expr: str): +def _get_message(fd, expr: str, timeout_sec: int): while True: - data = _read_line(fd) + data = _read_line(fd, timeout_sec) logging.debug(f"new line: {data}") if expr in data: return data @@ -213,10 +211,10 @@ def test_tflite(temp_dir, platform, west_cmd, skip_build, tvm_debug): project.flash() with project.transport() as transport: - _get_message(transport, "#wakeup") + timeout_read = 60 + _get_message(transport, "#wakeup", timeout_sec=timeout_read) transport.write(b"start\n", timeout_sec=5) - - result_line = _get_message(transport, "#result") + result_line = _get_message(transport, "#result", timeout_sec=timeout_read) result_line = result_line.strip("\n") result_line = result_line.split(":")