def check_serial_port_ready(self, serial_port, target_id=None, timeout=60):
        """Check and update serial port name information for DUT.

        If no target_id is specified return the old serial port name.

        Args:
            serial_port: Current serial port name.
            target_id: Target ID of a device under test.
            timeout: Serial port pooling timeout in seconds.

        Returns:
            Tuple with result (always True) and serial port read from mbed-ls.
        """
        # If serial port changed (check using mbed-ls), use new serial port
        new_serial_port = None

        if target_id:
            # Sometimes OSes take a long time to mount devices (up to one minute).
            # Current pooling time: 120x 500ms = 1 minute
            self.print_plugin_info(
                "Waiting up to %d sec for '%s' serial port (current is '%s')..."
                % (timeout, target_id, serial_port)
            )
            timeout_step = 0.5
            timeout = int(timeout / timeout_step)
            for i in range(timeout):
                # mbed_lstools.main.create() should be done inside the loop. Otherwise
                # it will loop on same data.
                mbeds = create()
                mbed_list = mbeds.list_mbeds()  # list of mbeds present
                # get first item in list with a matching target_id, if present
                mbed_target = next(
                    (x for x in mbed_list if x["target_id"] == target_id), None
                )

                if mbed_target is not None:
                    # Only assign if serial port is present and known (not None)
                    if (
                        "serial_port" in mbed_target
                        and mbed_target["serial_port"] is not None
                    ):
                        new_serial_port = mbed_target["serial_port"]
                        if new_serial_port != serial_port:
                            # Serial port changed, update to new serial port
                            self.print_plugin_info(
                                "Serial port for tid='%s' changed from '%s' to '%s'..."
                                % (target_id, serial_port, new_serial_port)
                            )
                        break
                sleep(timeout_step)
        else:
            new_serial_port = serial_port

        return new_serial_port