You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/01/12 22:29:57 UTC
[GitHub] [tvm] gromero opened a new pull request #7265: [µTVM] Avoid listing links when probing serial ports
gromero opened a new pull request #7265:
URL: https://github.com/apache/tvm/pull/7265
SerialTransport.open() probes automatically the device name based upon a
grep regex if a device name is not provided. The code expects to find only
a single device. Currently when it probes for the available serial ports it
includes in the list the device names that are also symbolic links.
Since _find_openocd_serial_port() always returns a serial number for a
given serial port (not the device name path) the available device names
are always probed when the openocd flash runner is used.
It's not uncommon that device drivers create symbolic links for certain
kinds of serial devices, specially those that provide a serial port plus
an additional endpoint to program the device attached, like a ST-Link
interface, etc.
As a consequence the current code fails to select the correct device name
when symbolic links exist and the openocd flash runner is used.
That commit changes the probe behavior to avoid listing symbolic links when
probing the device name for the target serial port.
Without that change the following error happens:
```
Traceback (most recent call last):
File "./micro_tflite.py", line 255, in <module>
with tvm.micro.Session(binary=micro_binary, flasher=flasher) as session:
File "/home/gromero/git/tvm/python/tvm/micro/session.py ", line 127, in __enter__
self.transport = TransportLogger(
File "/home/gromero/git/tvm/python/tvm/micro/transport/base.py", line 79, in __enter__
self.open()
File "/home/gromero/git/tvm/python/tvm/micro/transport/base.py", line 207, in open
self.child.open()
File "/home/gromero/git/tvm/python/tvm/micro/transport/serial.py", line 72, in open
raise SerialPortNotFoundError(
NameError: name 'SerialPortNotFoundError' is not defined
When ARM `STM32 STLink` is used by a board and the following device names are created:
```
```
gromero@gromero0:~/git/tvm$ ls -l /dev/{ttyACM0,stlinkv2-1_0}
lrwxrwxrwx 1 root root 7 Jan 12 16:10 /dev/stlinkv2-1_0 -> ttyACM0
crw-rw-rw- 1 root plugdev 166, 0 Jan 12 21:32 /dev/ttyACM0
```
Thanks for contributing to TVM! Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from [Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers) by @ them in the pull request thread.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tqchen merged pull request #7265: [µTVM] Avoid listing links when probing serial ports
Posted by GitBox <gi...@apache.org>.
tqchen merged pull request #7265:
URL: https://github.com/apache/tvm/pull/7265
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] gromero commented on pull request #7265: [µTVM] Avoid listing links when probing serial ports
Posted by GitBox <gi...@apache.org>.
gromero commented on pull request #7265:
URL: https://github.com/apache/tvm/pull/7265#issuecomment-759078689
@areusch Could you please review? Thanks!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org