Exemple #1
0
def run(instance, mcu, toolchain, connection, connection_lock, platform_lock,
        misc_locks, clean, defines, ubxlib_dir, working_dir, printer, reporter,
        test_report_handle):
    '''Build/run on nRF5'''
    return_value = -1
    hex_file_path = None
    instance_text = u_utils.get_instance_text(instance)
    swo_port = u_utils.JLINK_SWO_PORT
    downloaded = False

    # Don't need the platform lock
    del platform_lock

    prompt = PROMPT + instance_text + ": "

    # Print out what we've been told to do
    text = "running nRF5 for " + mcu + " under " + toolchain
    if connection and "debugger" in connection and connection["debugger"]:
        text += ", on JLink debugger serial number " + connection["debugger"]
    if clean:
        text += ", clean build"
    if defines:
        text += ", with #define(s)"
        for idx, define in enumerate(defines):
            if idx == 0:
                text += " \"" + define + "\""
            else:
                text += ", \"" + define + "\""
    if ubxlib_dir:
        text += ", ubxlib directory \"" + ubxlib_dir + "\""
    if working_dir:
        text += ", working directory \"" + working_dir + "\""
    printer.string("{}{}.".format(prompt, text))

    reporter.event(u_report.EVENT_TYPE_BUILD, u_report.EVENT_START,
                   "nRF5SDK/" + toolchain)
    # Switch to the working directory
    with u_utils.ChangeDir(working_dir):
        # Check that everything we need is installed
        if check_installation(toolchain, TOOLS_LIST, printer, prompt):
            # Fetch Unity
            if u_utils.fetch_repo(u_utils.UNITY_URL, u_utils.UNITY_SUBDIR,
                                  None, printer, prompt):
                # Do the build
                build_start_time = time()
                if toolchain.lower() == "gcc":
                    build_subdir_gcc = BUILD_SUBDIR_PREFIX_GCC + instance_text.replace(
                        ".", "_")
                    hex_file_path = build_gcc(clean, build_subdir_gcc,
                                              ubxlib_dir, defines, printer,
                                              prompt, reporter)
                elif toolchain.lower() == "ses":
                    hex_file_path = build_ses(clean, ubxlib_dir, defines,
                                              printer, prompt, reporter)
                if hex_file_path:
                    # Build succeeded, need to lock a connection to do the download
                    reporter.event(
                        u_report.EVENT_TYPE_BUILD, u_report.EVENT_PASSED,
                        "build took {:.0f} second(s)".format(time() -
                                                             build_start_time))
                    # Do the download
                    # On nRF5 doing a download or starting RTT logging
                    # on more than one platform at a time seems to cause
                    # problems, even though it should be tied to the
                    # serial number of the given debugger on that board,
                    # so lock JLink for this.
                    jlink_lock = None
                    if "jlink_lock" in misc_locks:
                        jlink_lock = misc_locks["jlink_lock"]
                    with u_utils.Lock(jlink_lock, INSTALL_LOCK_WAIT_SECONDS,
                                      "JLink", printer,
                                      prompt) as locked_jlink:
                        if locked_jlink:
                            with u_connection.Lock(
                                    connection, connection_lock,
                                    CONNECTION_LOCK_GUARD_TIME_SECONDS,
                                    printer, prompt) as locked_connection:
                                if locked_connection:
                                    reporter.event(
                                        u_report.EVENT_TYPE_DOWNLOAD,
                                        u_report.EVENT_START)
                                    # I have seen the download fail on occasion
                                    # so give this two bites of the cherry
                                    retries = 2
                                    while not downloaded and (retries > 0):
                                        downloaded = download(
                                            connection,
                                            DOWNLOAD_GUARD_TIME_SECONDS,
                                            hex_file_path, printer, prompt)
                                        retries -= 1
                                        if not downloaded and (retries > 0):
                                            reporter.event(
                                                u_report.EVENT_TYPE_DOWNLOAD,
                                                u_report.EVENT_WARNING,
                                                "unable to download, will retry..."
                                            )
                                            sleep(5)
                                    if downloaded:
                                        reporter.event(
                                            u_report.EVENT_TYPE_DOWNLOAD,
                                            u_report.EVENT_COMPLETE)

                                        # Now the target can be reset
                                        u_utils.reset_nrf_target(
                                            connection, printer, prompt)
                                        reporter.event(
                                            u_report.EVENT_TYPE_TEST,
                                            u_report.EVENT_START)
                                        if connection and "swo_port" in connection:
                                            swo_port = connection["swo_port"]

                                        # With JLink started
                                        RUN_JLINK.append("-RTTTelnetPort")
                                        RUN_JLINK.append(str(swo_port))
                                        if connection and "debugger" in connection and \
                                           connection["debugger"]:
                                            RUN_JLINK.append("-USB")
                                            RUN_JLINK.append(
                                                connection["debugger"])
                                        with u_utils.ExeRun(RUN_JLINK,
                                                            printer,
                                                            prompt,
                                                            with_stdin=True
                                                            ) as process_jlink:
                                            # Open the Telnet port to JLink
                                            # to get the debug output
                                            telnet_handle = u_utils.open_telnet(
                                                swo_port, printer, prompt)
                                            if telnet_handle is not None:
                                                # Monitor progress
                                                return_value = u_monitor.    \
                                                               main(telnet_handle,
                                                                    u_monitor.CONNECTION_TELNET,
                                                                    RUN_GUARD_TIME_SECONDS,
                                                                    RUN_INACTIVITY_TIME_SECONDS,
                                                                    instance, printer, reporter,
                                                                    test_report_handle)
                                                telnet_handle.close()
                                            else:
                                                reporter.event(u_report.EVENT_TYPE_INFRASTRUCTURE,
                                                               u_report.EVENT_FAILED,
                                                               "unable to open RTT port " +  \
                                                               str(swo_port))
                                            # JLink is VERY touchy as to how it exits,
                                            # need to send it "exit\n" over stdin
                                            # for it to exit cleanly
                                            process_jlink.stdin.write(
                                                "exit\n".encode())
                                            sleep(5)
                                        if return_value == 0:
                                            reporter.event(
                                                u_report.EVENT_TYPE_TEST,
                                                u_report.EVENT_COMPLETE)
                                        else:
                                            reporter.event(
                                                u_report.EVENT_TYPE_TEST,
                                                u_report.EVENT_FAILED)
                                    else:
                                        reporter.event(
                                            u_report.EVENT_TYPE_DOWNLOAD,
                                            u_report.EVENT_FAILED,
                                            "check debug log for details")
                                    # Wait for a short while before giving
                                    # the connection lock away to make sure
                                    # that everything really has shut down
                                    # in the debugger
                                    sleep(5)
                                else:
                                    reporter.event(
                                        u_report.EVENT_TYPE_INFRASTRUCTURE,
                                        u_report.EVENT_FAILED,
                                        "unable to lock a connection")
                        else:
                            reporter.event(u_report.EVENT_TYPE_INFRASTRUCTURE,
                                           u_report.EVENT_FAILED,
                                           "unable to lock JLink")
                else:
                    return_value = 1
                    reporter.event(u_report.EVENT_TYPE_BUILD,
                                   u_report.EVENT_FAILED,
                                   "check debug log for details")
            else:
                reporter.event(u_report.EVENT_TYPE_INFRASTRUCTURE,
                               u_report.EVENT_FAILED, "unable to fetch Unity")
        else:
            reporter.event(
                u_report.EVENT_TYPE_INFRASTRUCTURE, u_report.EVENT_FAILED,
                "there is a problem with the tools installation for nRF5 SDK")

    return return_value
Exemple #2
0
def run(instance, mcu, toolchain, connection, connection_lock, platform_lock,
        misc_locks, clean, defines, ubxlib_dir, working_dir, printer, reporter,
        test_report_handle):
    '''Build/run on STM32Cube'''
    return_value = -1
    mcu_dir = ubxlib_dir + os.sep + SDK_DIR + os.sep + "mcu" + os.sep + mcu
    instance_text = u_utils.get_instance_text(instance)
    # Create a unique project name prefix in case more than
    # one process is running this
    updated_project_name_prefix = UPDATED_PROJECT_NAME_PREFIX + str(
        os.getpid()) + "_"
    workspace_subdir = STM32CUBE_IDE_WORKSPACE_SUBDIR + "_" + str(os.getpid())
    elf_path = None
    downloaded = False
    running = False
    download_list = None

    # Only one toolchain for STM32Cube
    del toolchain

    prompt = PROMPT + instance_text + ": "

    # Print out what we've been told to do
    text = "running STM32Cube for " + mcu
    if connection and "debugger" in connection and connection["debugger"]:
        text += ", on STLink debugger serial number " + connection["debugger"]
    if clean:
        text += ", clean build"
    if defines:
        text += ", with #define(s)"
        for idx, define in enumerate(defines):
            if idx == 0:
                text += " \"" + define + "\""
            else:
                text += ", \"" + define + "\""
    if ubxlib_dir:
        text += ", ubxlib directory \"" + ubxlib_dir + "\""
    if working_dir:
        text += ", working directory \"" + working_dir + "\""
    printer.string("{}{}.".format(prompt, text))

    # On STM32F4 we can get USB errors if we try to do a download
    # on one platform while another is performing SWO logging.
    # Since each board only runs a single instance of stuff we
    # can work around this be ensuring that all downloads are
    # completed before SWO logging begins.
    # Add us to the list of pending downloads
    if misc_locks and ("stm32f4_downloads_list" in misc_locks):
        download_list = misc_locks["stm32f4_downloads_list"]
        download_list.append(instance_text)

    reporter.event(u_report.EVENT_TYPE_BUILD, u_report.EVENT_START,
                   "STM32Cube")
    # Switch to the working directory
    with u_utils.ChangeDir(working_dir):
        # Check that everything we need is installed
        if check_installation(PATHS_LIST, printer, prompt):
            # Fetch Unity
            if u_utils.fetch_repo(u_utils.UNITY_URL, u_utils.UNITY_SUBDIR,
                                  None, printer, prompt):
                # I've no idea why but on every other
                # build STM32Cube loses track of where
                # most of the files are: you'll see it
                # say that it can't find u_cfg_sw.h and
                # fail.  Until we find out why just
                # give it two goes, deleting the project
                # we created before trying again.
                retries = 2
                while (elf_path is None) and (retries > 0):
                    # The STM32Cube IDE, based on Eclipse
                    # has no mechanism for overriding the locations
                    # of things so here we read the .project
                    # file and replace the locations of the
                    # STM32Cube SDK and Unity files as
                    # appropriate
                    if create_project(
                            mcu_dir, PROJECT_NAME,
                            updated_project_name_prefix + PROJECT_NAME,
                            STM32CUBE_FW_PATH,
                            working_dir + os.sep + u_utils.UNITY_SUBDIR,
                            printer, prompt):
                        # Do the build
                        build_start_time = time()
                        elf_path = build_binary(
                            mcu_dir, workspace_subdir,
                            updated_project_name_prefix + PROJECT_NAME, clean,
                            defines, printer, prompt)
                        if elf_path is None:
                            reporter.event(u_report.EVENT_TYPE_BUILD,
                                           u_report.EVENT_INFORMATION,
                                           "unable to build, will retry")
                            printer.string("{}if the compilation."       \
                                           " failure was because"        \
                                           " the build couldn't"         \
                                           " even find u_cfg_sw.h"       \
                                           " then ignore it, Eclipse"    \
                                           " lost its head, happens"     \
                                           " a lot, we will try again.". \
                                           format(prompt))
                    else:
                        reporter.event(
                            u_report.EVENT_TYPE_BUILD, u_report.EVENT_WARNING,
                            "unable to create STM32Cube project, will retry")
                    retries -= 1
                if elf_path:
                    reporter.event(
                        u_report.EVENT_TYPE_BUILD, u_report.EVENT_PASSED,
                        "build took {:.0f} second(s)".format(time() -
                                                             build_start_time))
                    # Lock the connection.
                    with u_connection.Lock(connection, connection_lock,
                                           CONNECTION_LOCK_GUARD_TIME_SECONDS,
                                           printer,
                                           prompt) as locked_connection:
                        if locked_connection:
                            # I have seen download failures occur if two
                            # ST-Link connections are initiated at the same time.
                            with u_utils.Lock(
                                    platform_lock,
                                    PLATFORM_LOCK_GUARD_TIME_SECONDS,
                                    "platform", printer,
                                    prompt) as locked_platform:
                                if locked_platform:
                                    reporter.event(
                                        u_report.EVENT_TYPE_DOWNLOAD,
                                        u_report.EVENT_START)
                                    # Do the download.  I have seen the STM32F4 debugger
                                    # barf on occasions so give this two bites of
                                    # the cherry
                                    retries = 2
                                    while not downloaded and (retries > 0):
                                        downloaded = download(
                                            connection,
                                            DOWNLOAD_GUARD_TIME_SECONDS,
                                            elf_path, printer, prompt)
                                        retries -= 1
                                        if not downloaded:
                                            if connection and "serial_port" in connection \
                                               and connection["serial_port"]:
                                                # Before retrying, reset the USB port
                                                u_utils.usb_reset("STMicroelectronics STLink" \
                                                                  "Virtual COM Port (" +
                                                                  connection["serial_port"] +
                                                                  ")", printer, prompt)
                                            sleep(5)
                                    if platform_lock:
                                        # Once the download has been done (or not) the platform lock
                                        # can be released, after a little safety sleep
                                        sleep(1)
                                        platform_lock.release()
                                    if downloaded:
                                        # Remove us from the list of pending downloads
                                        if download_list:
                                            download_list.remove(instance_text)
                                        reporter.event(
                                            u_report.EVENT_TYPE_DOWNLOAD,
                                            u_report.EVENT_COMPLETE)
                                        # Wait for all the other downloads to complete before
                                        # starting SWO logging
                                        u_utils.wait_for_completion(
                                            download_list, "download",
                                            DOWNLOADS_COMPLETE_GUARD_TIME_SECONDS,
                                            printer, prompt)
                                        # So that all STM32Cube instances don't start up at
                                        # once, which can also cause problems, wait the
                                        # instance-number number of seconds.
                                        hold_off = instance[0]
                                        if hold_off > 30:
                                            hold_off = 30
                                        sleep(hold_off)
                                        # Create and empty the SWO data file and decoded text file
                                        file_handle = open(SWO_DATA_FILE,
                                                           "w").close()
                                        file_handle = open(
                                            SWO_DECODED_TEXT_FILE,
                                            "w").close()
                                        reporter.event(
                                            u_report.EVENT_TYPE_TEST,
                                            u_report.EVENT_START)
                                        try:
                                            # Start a process which reads the
                                            # SWO output from a file, decodes it and
                                            # writes it back to a file
                                            process = Process(
                                                target=swo_decode_process,
                                                args=(SWO_DATA_FILE,
                                                      SWO_DECODED_TEXT_FILE))
                                            process.start()
                                            # Two bites at the cherry again
                                            retries = 2
                                            while not running and (retries >
                                                                   0):
                                                # Now start Open OCD to reset the target
                                                # and capture SWO output
                                                sleep(1)
                                                with u_utils.ExeRun(
                                                        open_ocd(
                                                            OPENOCD_COMMANDS,
                                                            connection),
                                                        printer, prompt):
                                                    running = True
                                                    # Open the SWO decoded text file for
                                                    # reading, binary to prevent the line
                                                    # endings being munged.
                                                    file_handle = open(
                                                        SWO_DECODED_TEXT_FILE,
                                                        "rb")
                                                    # Monitor progress based on the decoded
                                                    # SWO text
                                                    return_value = u_monitor.          \
                                                                   main(file_handle,
                                                                        u_monitor.CONNECTION_PIPE,
                                                                        RUN_GUARD_TIME_SECONDS,
                                                                        RUN_INACTIVITY_TIME_SECONDS,
                                                                        instance, printer,
                                                                        reporter,
                                                                        test_report_handle)
                                                    file_handle.close()
                                                retries -= 1
                                                if not running:
                                                    sleep(5)
                                            process.terminate()
                                        except KeyboardInterrupt:
                                            # Tidy up process on SIGINT
                                            printer.string(
                                                "{}caught CTRL-C, terminating..."
                                                .format(prompt))
                                            process.terminate()
                                            return_value = -1
                                        if return_value == 0:
                                            reporter.event(
                                                u_report.EVENT_TYPE_TEST,
                                                u_report.EVENT_COMPLETE)
                                        else:
                                            reporter.event(
                                                u_report.EVENT_TYPE_TEST,
                                                u_report.EVENT_FAILED)
                                    else:
                                        reporter.event(
                                            u_report.EVENT_TYPE_DOWNLOAD,
                                            u_report.EVENT_FAILED)
                        else:
                            reporter.event(u_report.EVENT_TYPE_INFRASTRUCTURE,
                                           u_report.EVENT_FAILED,
                                           "unable to lock a connection")
                else:
                    reporter.event(u_report.EVENT_TYPE_BUILD,
                                   u_report.EVENT_FAILED,
                                   "check debug log for details")

                # To avoid a build up of stuff, delete the temporary build and
                # workspace on exit
                tmp = mcu_dir + os.sep + updated_project_name_prefix + PROJECT_NAME
                if os.path.exists(tmp):
                    printer.string("{}deleting temporary build directory {}...".   \
                                   format(prompt, tmp))
                    u_utils.deltree(tmp, printer, prompt)
                if os.path.exists(workspace_subdir):
                    printer.string("{}deleting temporary workspace directory {}...". \
                                   format(prompt, workspace_subdir))
                    u_utils.deltree(workspace_subdir, printer, prompt)

            else:
                reporter.event(u_report.EVENT_TYPE_INFRASTRUCTURE,
                               u_report.EVENT_FAILED, "unable to fetch Unity")
        else:
            reporter.event(
                u_report.EVENT_TYPE_INFRASTRUCTURE, u_report.EVENT_FAILED,
                "there is a problem with the tools installation for STM32F4")

    # Remove us from the list of pending downloads for safety
    try:
        misc_locks["stm32f4_downloads_list"].remove(instance_text)
    except (AttributeError, ValueError, TypeError):
        pass

    return return_value
Exemple #3
0
def run(instance, mcu, toolchain, connection, connection_lock, platform_lock,
        misc_locks, clean, defines, ubxlib_dir, working_dir, printer, reporter,
        test_report_handle):
    '''Build/run on Zephyr'''
    return_value = -1
    build_dir = None
    instance_text = u_utils.get_instance_text(instance)

    # Don't need the platform lock
    del platform_lock

    # Only one toolchain for Zephyr
    del toolchain

    prompt = PROMPT + instance_text + ": "

    # Print out what we've been told to do
    text = "running Zephyr for " + mcu
    if connection and "debugger" in connection and connection["debugger"]:
        text += ", on JLink debugger serial number " + connection["debugger"]
    if clean:
        text += ", clean build"
    if defines:
        text += ", with #define(s)"
        for idx, define in enumerate(defines):
            if idx == 0:
                text += " \"" + define + "\""
            else:
                text += ", \"" + define + "\""
    if ubxlib_dir:
        text += ", ubxlib directory \"" + ubxlib_dir + "\""
    if working_dir:
        text += ", working directory \"" + working_dir + "\""
    printer.string("{}{}.".format(prompt, text))

    reporter.event(u_report.EVENT_TYPE_BUILD, u_report.EVENT_START, "Zephyr")
    # Switch to the working directory
    with u_utils.ChangeDir(working_dir):
        # Check that everything we need is installed
        # and configured
        if check_installation(TOOLS_LIST, printer, prompt):
            # Set up the environment variables for Zephyr
            returned_env = set_env(printer, prompt)
            if returned_env:
                # The west tools need to use the environment
                # configured above.
                print_env(returned_env, printer, prompt)
                # Note that Zephyr brings in its own
                # copy of Unity so there is no need to
                # fetch it here.
                # For Zephyr we need to obtain the full board name
                board = find_board(ubxlib_dir, mcu)
                if board:
                    # Do the build
                    build_start_time = time()
                    build_dir = build(board, clean, ubxlib_dir, defines,
                                      returned_env, printer, prompt, reporter)
                    if build_dir:
                        # Build succeeded, need to lock some things to do the download
                        reporter.event(
                            u_report.EVENT_TYPE_BUILD, u_report.EVENT_PASSED,
                            "build took {:.0f} second(s)".format(
                                time() - build_start_time))
                        # On NRF52 (NRF5)/Zephyr (NRF53/NRF52) doing a download
                        # on more than one platform at a time or doing a download
                        # while RTT logging is in progress seems to cause problems,
                        # even though it should be tied to the serial number of the
                        # given debugger on that board, so lock JLink for this.
                        jlink_lock = None
                        if "jlink_lock" in misc_locks:
                            jlink_lock = misc_locks["jlink_lock"]
                        with u_utils.Lock(jlink_lock,
                                          INSTALL_LOCK_WAIT_SECONDS, "JLink",
                                          printer, prompt) as locked_jlink:
                            if locked_jlink:
                                with u_connection.Lock(
                                        connection, connection_lock,
                                        CONNECTION_LOCK_GUARD_TIME_SECONDS,
                                        printer, prompt) as locked_connection:
                                    if locked_connection:
                                        # Get the device name for JLink
                                        jlink_device_name = jlink_device(mcu)
                                        if not jlink_device_name:
                                            reporter.event(
                                                u_report.
                                                EVENT_TYPE_INFRASTRUCTURE,
                                                u_report.EVENT_WARNING,
                                                "MCU not found in JLink devices"
                                            )
                                        # Do the download
                                        reporter.event(
                                            u_report.EVENT_TYPE_DOWNLOAD,
                                            u_report.EVENT_START)
                                        if download(
                                                connection, jlink_device_name,
                                                DOWNLOAD_GUARD_TIME_SECONDS,
                                                build_dir, returned_env,
                                                printer, prompt):
                                            reporter.event(
                                                u_report.EVENT_TYPE_DOWNLOAD,
                                                u_report.EVENT_COMPLETE)
                                            # Now the target can be reset
                                            u_utils.reset_nrf_target(
                                                connection, printer, prompt)
                                            reporter.event(
                                                u_report.EVENT_TYPE_TEST,
                                                u_report.EVENT_START)
                                            if connection and "swo_port" in connection:
                                                swo_port = connection[
                                                    "swo_port"]

                                            # With JLink started
                                            if jlink_device_name:
                                                RUN_JLINK.append("-Device")
                                                RUN_JLINK.append(
                                                    jlink_device(mcu))
                                            RUN_JLINK.append("-RTTTelnetPort")
                                            RUN_JLINK.append(str(swo_port))
                                            if connection and "debugger" in connection and \
                                               connection["debugger"]:
                                                RUN_JLINK.append("-USB")
                                                RUN_JLINK.append(
                                                    connection["debugger"])
                                            with u_utils.ExeRun(
                                                    RUN_JLINK,
                                                    printer,
                                                    prompt,
                                                    with_stdin=True
                                            ) as process_jlink:
                                                # Open the Telnet port to JLink
                                                # to get the debug output
                                                telnet_handle = u_utils.open_telnet(
                                                    swo_port, printer, prompt)
                                                if telnet_handle is not None:
                                                    # Monitor progress
                                                    return_value = u_monitor.    \
                                                                   main(telnet_handle,
                                                                        u_monitor.CONNECTION_TELNET,
                                                                        RUN_GUARD_TIME_SECONDS,
                                                                        RUN_INACTIVITY_TIME_SECONDS,
                                                                        instance, printer,
                                                                        reporter,
                                                                        test_report_handle)
                                                    telnet_handle.close()
                                                else:
                                                    reporter.event(u_report.EVENT_TYPE_INFRASTRUCTURE,
                                                                   u_report.EVENT_FAILED,
                                                                   "unable to open RTT port " +  \
                                                                   str(swo_port))
                                                # JLink is VERY touchy as to how it exits,
                                                # need to send it "exit\n" over stdin
                                                # for it to exit cleanly
                                                process_jlink.stdin.write(
                                                    "exit\n".encode())
                                                sleep(5)
                                            if return_value == 0:
                                                reporter.event(
                                                    u_report.EVENT_TYPE_TEST,
                                                    u_report.EVENT_COMPLETE)
                                            else:
                                                reporter.event(
                                                    u_report.EVENT_TYPE_TEST,
                                                    u_report.EVENT_FAILED)
                                        else:
                                            reporter.event(
                                                u_report.EVENT_TYPE_DOWNLOAD,
                                                u_report.EVENT_FAILED,
                                                "check debug log for details")
                                    else:
                                        reporter.event(
                                            u_report.EVENT_TYPE_INFRASTRUCTURE,
                                            u_report.EVENT_FAILED,
                                            "unable to lock a connection")
                            else:
                                reporter.event(
                                    u_report.EVENT_TYPE_INFRASTRUCTURE,
                                    u_report.EVENT_FAILED,
                                    "unable to lock JLink")
                    else:
                        return_value = 1
                        reporter.event(u_report.EVENT_TYPE_BUILD,
                                       u_report.EVENT_FAILED,
                                       "check debug log for details")
                else:
                    return_value = 1
                    reporter.event(u_report.EVENT_TYPE_INFRASTRUCTURE,
                                   u_report.EVENT_FAILED,
                                   "unable to find overlay file")
            else:
                reporter.event(u_report.EVENT_TYPE_INFRASTRUCTURE,
                               u_report.EVENT_FAILED,
                               "environment setup failed")
        else:
            reporter.event(
                u_report.EVENT_TYPE_INFRASTRUCTURE, u_report.EVENT_FAILED,
                "there is a problem with the tools installation for Zephyr")

    return return_value