Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

htrun requires a working DAPLink-style serial port, even when a communication port is specified #267

Closed
Patater opened this issue Aug 2, 2021 · 0 comments · Fixed by #269
Projects

Comments

@Patater
Copy link
Contributor

Patater commented Aug 2, 2021

Description

When specifying a communication port manually (e.g. using the -p /dev/ttyUSB1 option), htrun incorrectly still attempts to verify the existence and proper functioning of the Mbed/DAPLink-style serial port. It doesn't need this, so it shouldn't attempt to verify it.

$ mbedhtrun -f build/test.elf  -p /dev/ttyUSB1:115200 -e ./path/to/host_tests/ -r pyocd -c pyocd --target-id 9902
...
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/home/user/Documents/ARM/virt_env/lib/python3.8/site-packages/mbed_os_tools/test/host_tests_conn_proxy/conn_proxy.py", line 150, in conn_process
    connector = conn_primitive_factory(conn_resource, config, event_queue, logger)
  File "/home/user/Documents/ARM/virt_env/lib/python3.8/site-packages/mbed_os_tools/test/host_tests_conn_proxy/conn_proxy.py", line 104, in conn_primitive_factory
    connector = SerialConnectorPrimitive(
  File "/home/user/Documents/ARM/virt_env/lib/python3.8/site-packages/mbed_os_tools/test/host_tests_conn_proxy/conn_primitive_serial.py", line 46, in __init__
    serial_port = HostTestPluginBase().check_serial_port_ready(self.port, target_id=self.target_id, timeout=self.polling_timeout)
  File "/home/user/Documents/ARM/virt_env/lib/python3.8/site-packages/mbed_os_tools/test/host_tests_plugins/host_test_plugins.py", line 202, in check_serial_port_ready

Don't require a functional serial port (don't look before leaping) if a communication port is manually specified. check_serial_port_ready() probably need not be called.

Issue request type

[ ] Question
[ ] Enhancement
[X] Bug
@Patater Patater added this to Inbox in Mbed Core via automation Aug 2, 2021
@Patater Patater moved this from Inbox to To do (16) in Mbed Core Aug 2, 2021
Patater added a commit to Patater/mbed-os-tools that referenced this issue Aug 4, 2021
In order to work well with boards via the pyocd copy method, we should
not attempt to list Mbed style boards to see if the serial port changed
names. We should instead use the serial port as provided on the command
line. If we attempt to list Mbed style boards, we will run into an error
when the board is not Mbed-style, even if the command-line provided
serial port is correct. To add insult to injury, the error message given
in such cases gives advice that is impossible to follow; the output from
htrun recommends you provide the -u option, but you cannot; the -u
option is for mbed-ls, not htrun.

    $ mbedhtrun -f build/test.elf -p /dev/ttyUSB1:115200 -r pyocd -c pyocd --target-id 0240
    [1627903348.60][mbedls.lstools_base]MBED with target id '0240000034544e45001e00048e3800515a91000097969900' is connected, but not mounted. Use the '-u' flag to include it in the list.

Fixes ARMmbed#267
@Patater Patater moved this from To do (16) to Awaiting review (3) in Mbed Core Aug 11, 2021
Patater added a commit to Patater/mbed-os-tools that referenced this issue Aug 11, 2021
In order to work well with boards via the pyocd copy method, we should
not attempt to list Mbed style boards to see if the serial port changed
names. We should instead use the serial port as provided on the command
line. If we attempt to list Mbed style boards, we will run into an error
when the board is not Mbed-style, even if the command-line provided
serial port is correct. To add insult to injury, the error message given
in such cases gives advice that is impossible to follow; the output from
htrun recommends you provide the -u option, but you cannot; the -u
option is for mbed-ls, not htrun.

    $ mbedhtrun -f build/test.elf -p /dev/ttyUSB1:115200 -r pyocd -c pyocd --target-id 0240
    [1627903348.60][mbedls.lstools_base]MBED with target id '0240000034544e45001e00048e3800515a91000097969900' is connected, but not mounted. Use the '-u' flag to include it in the list.

The reason we are not simply overriding the pyocd plugin's
check_serial_port_ready() method is because we don't want to attempt
auto-detection of the serial port for any type of device, not just those
we'd use pyocd with. We always want to use the provided serial port when
passed in. If users want auto-detection of the serial port to use, they
can avoid providing the port on the command line to get the previous
behavior.

Fixes ARMmbed#267
Patater added a commit to Patater/mbed-os-tools that referenced this issue Aug 13, 2021
In order to work well with boards via the pyocd copy method, we should
not attempt to list Mbed style boards to see if the serial port changed
names. We should instead use the serial port as provided on the command
line. If we attempt to list Mbed style boards, we will run into an error
when the board is not Mbed-style, even if the command-line provided
serial port is correct. To add insult to injury, the error message given
in such cases gives advice that is impossible to follow; the output from
htrun recommends you provide the -u option, but you cannot; the -u
option is for mbed-ls, not htrun.

    $ mbedhtrun -f build/test.elf -p /dev/ttyUSB1:115200 -r pyocd -c pyocd --target-id 0240
    [1627903348.60][mbedls.lstools_base]MBED with target id '0240000034544e45001e00048e3800515a91000097969900' is connected, but not mounted. Use the '-u' flag to include it in the list.

The reason we are not simply overriding the pyocd plugin's
check_serial_port_ready() method is because we don't want to attempt
auto-detection of the serial port for any type of device, not just those
we'd use pyocd with. We always want to use the provided serial port when
passed in. If users want auto-detection of the serial port to use, they
can avoid providing the port on the command line to get the previous
behavior.

Fixes ARMmbed#267
Patater added a commit to Patater/mbed-os-tools that referenced this issue Aug 13, 2021
In order to work well with boards via the pyocd copy method, we should
not attempt to list Mbed style boards to see if the serial port changed
names. We should instead use the serial port as provided on the command
line. If we attempt to list Mbed style boards, we will run into an error
when the board is not Mbed-style, even if the command-line provided
serial port is correct. To add insult to injury, the error message given
in such cases gives advice that is impossible to follow; the output from
htrun recommends you provide the -u option, but you cannot; the -u
option is for mbed-ls, not htrun.

    $ mbedhtrun -f build/test.elf -p /dev/ttyUSB1:115200 -r pyocd -c pyocd --target-id 0240
    [1627903348.60][mbedls.lstools_base]MBED with target id '0240000034544e45001e00048e3800515a91000097969900' is connected, but not mounted. Use the '-u' flag to include it in the list.

The reason we are not simply overriding the pyocd plugin's
check_serial_port_ready() method is because we don't want to attempt
auto-detection of the serial port for any type of device, not just those
we'd use pyocd with. We always want to use the provided serial port when
passed in. If users want auto-detection of the serial port to use, they
can avoid providing the port on the command line to get the previous
behavior.

Fixes ARMmbed#267
Patater added a commit to Patater/mbed-os-tools that referenced this issue Aug 13, 2021
In order to work well with boards via the pyocd copy method, we should
not attempt to list Mbed style boards to see if the serial port changed
names. We should instead use the serial port as provided on the command
line. If we attempt to list Mbed style boards, we will run into an error
when the board is not Mbed-style, even if the command-line provided
serial port is correct. To add insult to injury, the error message given
in such cases gives advice that is impossible to follow; the output from
htrun recommends you provide the -u option, but you cannot; the -u
option is for mbed-ls, not htrun.

    $ mbedhtrun -f build/test.elf -p /dev/ttyUSB1:115200 -r pyocd -c pyocd --target-id 0240
    [1627903348.60][mbedls.lstools_base]MBED with target id '0240000034544e45001e00048e3800515a91000097969900' is connected, but not mounted. Use the '-u' flag to include it in the list.

The reason we are not simply overriding the pyocd plugin's
check_serial_port_ready() method is because we don't want to attempt
auto-detection of the serial port for any type of device, not just those
we'd use pyocd with. We always want to use the provided serial port when
passed in. If users want auto-detection of the serial port to use, they
can avoid providing the port on the command line to get the previous
behavior.

Fixes ARMmbed#267
Patater added a commit to Patater/mbed-os-tools that referenced this issue Aug 17, 2021
In order to work well with boards via the pyocd copy method, we should
not attempt to list Mbed style boards to see if the serial port changed
names. We should instead use the serial port as provided on the command
line. If we attempt to list Mbed style boards, we will run into an error
when the board is not Mbed-style, even if the command-line provided
serial port is correct. To add insult to injury, the error message given
in such cases gives advice that is impossible to follow; the output from
htrun recommends you provide the -u option, but you cannot; the -u
option is for mbed-ls, not htrun.

    $ mbedhtrun -f build/test.elf -p /dev/ttyUSB1:115200 -r pyocd -c pyocd --target-id 0240
    [1627903348.60][mbedls.lstools_base]MBED with target id '0240000034544e45001e00048e3800515a91000097969900' is connected, but not mounted. Use the '-u' flag to include it in the list.

The reason we are not simply overriding the pyocd plugin's
check_serial_port_ready() method is because we don't want to attempt
auto-detection of the serial port for any type of device, not just those
we'd use pyocd with. We always want to use the provided serial port when
passed in. If users want auto-detection of the serial port to use, they
can avoid providing the port on the command line to get the previous
behavior.

Fixes ARMmbed#267
Patater added a commit to Patater/mbed-os-tools that referenced this issue Aug 17, 2021
In order to work well with boards via the pyocd copy method, we should
not attempt to list Mbed style boards to see if the serial port changed
names. We should instead use the serial port as provided on the command
line. If we attempt to list Mbed style boards, we will run into an error
when the board is not Mbed-style, even if the command-line provided
serial port is correct. To add insult to injury, the error message given
in such cases gives advice that is impossible to follow; the output from
htrun recommends you provide the -u option, but you cannot; the -u
option is for mbed-ls, not htrun.

    $ mbedhtrun -f build/test.elf -p /dev/ttyUSB1:115200 -r pyocd -c pyocd --target-id 0240
    [1627903348.60][mbedls.lstools_base]MBED with target id '0240000034544e45001e00048e3800515a91000097969900' is connected, but not mounted. Use the '-u' flag to include it in the list.

The reason we are not simply overriding the pyocd plugin's
check_serial_port_ready() method is because we don't want to attempt
auto-detection of the serial port for any type of device, not just those
we'd use pyocd with. We always want to use the provided serial port when
passed in. If users want auto-detection of the serial port to use, they
can avoid providing the port on the command line to get the previous
behavior.

Fixes ARMmbed#267
Patater added a commit to Patater/mbed-os-tools that referenced this issue Aug 19, 2021
In order to work well with boards via the pyocd copy method, we should
not attempt to list Mbed style boards to see if the serial port changed
names. We should instead use the serial port as provided on the command
line. If we attempt to list Mbed style boards, we will run into an error
when the board is not Mbed-style, even if the command-line provided
serial port is correct. To add insult to injury, the error message given
in such cases gives advice that is impossible to follow; the output from
htrun recommends you provide the -u option, but you cannot; the -u
option is for mbed-ls, not htrun.

    $ mbedhtrun -f build/test.elf -p /dev/ttyUSB1:115200 -r pyocd -c pyocd --target-id 0240
    [1627903348.60][mbedls.lstools_base]MBED with target id '0240000034544e45001e00048e3800515a91000097969900' is connected, but not mounted. Use the '-u' flag to include it in the list.

The reason we are not simply overriding the pyocd plugin's
check_serial_port_ready() method is because we don't want to attempt
auto-detection of the serial port for any type of device, not just those
we'd use pyocd with. We always want to use the provided serial port when
passed in. If users want auto-detection of the serial port to use, they
can avoid providing the port on the command line to get the previous
behavior.

Fixes ARMmbed#267
Patater added a commit to Patater/mbed-os-tools that referenced this issue Aug 19, 2021
In order to work well with boards via the pyocd copy method, we should
not attempt to list Mbed style boards to see if the serial port changed
names. We should instead use the serial port as provided on the command
line. If we attempt to list Mbed style boards, we will run into an error
when the board is not Mbed-style, even if the command-line provided
serial port is correct. To add insult to injury, the error message given
in such cases gives advice that is impossible to follow; the output from
htrun recommends you provide the -u option, but you cannot; the -u
option is for mbed-ls, not htrun.

    $ mbedhtrun -f build/test.elf -p /dev/ttyUSB1:115200 -r pyocd -c pyocd --target-id 0240
    [1627903348.60][mbedls.lstools_base]MBED with target id '0240000034544e45001e00048e3800515a91000097969900' is connected, but not mounted. Use the '-u' flag to include it in the list.

The reason we are not simply overriding the pyocd plugin's
check_serial_port_ready() method is because we don't want to attempt
auto-detection of the serial port for any type of device, not just those
we'd use pyocd with. We always want to use the provided serial port when
passed in. If users want auto-detection of the serial port to use, they
can avoid providing the port on the command line to get the previous
behavior.

Fixes ARMmbed#267
Patater added a commit to Patater/mbed-os-tools that referenced this issue Aug 19, 2021
In order to work well with boards via the pyocd copy method, we should
not attempt to list Mbed style boards to see if the serial port changed
names. We should instead use the serial port as provided on the command
line. If we attempt to list Mbed style boards, we will run into an error
when the board is not Mbed-style, even if the command-line provided
serial port is correct. To add insult to injury, the error message given
in such cases gives advice that is impossible to follow; the output from
htrun recommends you provide the -u option, but you cannot; the -u
option is for mbed-ls, not htrun.

    $ mbedhtrun -f build/test.elf -p /dev/ttyUSB1:115200 -r pyocd -c pyocd --target-id 0240
    [1627903348.60][mbedls.lstools_base]MBED with target id '0240000034544e45001e00048e3800515a91000097969900' is connected, but not mounted. Use the '-u' flag to include it in the list.

The reason we are not simply overriding the pyocd plugin's
check_serial_port_ready() method is because we don't want to attempt
auto-detection of the serial port for any type of device, not just those
we'd use pyocd with. We always want to use the provided serial port when
passed in. If users want auto-detection of the serial port to use, they
can avoid providing the port on the command line to get the previous
behavior.

Fixes ARMmbed#267
@LDong-Arm LDong-Arm moved this from Awaiting review (3) to Review in progress (4) in Mbed Core Sep 2, 2021
Mbed Core automation moved this from Review in progress (4) to Done Sep 7, 2021
@Patater Patater moved this from Done to Reported in Mbed Core Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Mbed Core
  
Reported
Development

Successfully merging a pull request may close this issue.

1 participant