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

Hardcoded serial port device node #1

Open
satoshinm opened this issue Dec 11, 2017 · 0 comments
Open

Hardcoded serial port device node #1

satoshinm opened this issue Dec 11, 2017 · 0 comments

Comments

@satoshinm
Copy link

satoshinm commented Dec 11, 2017

Attempting to use pirate-swd on my system, but it fails to open the device:

pirate-swd $ python flashSTM32.py  
Traceback (most recent call last):
  File "flashSTM32.py", line 41, in <module>
    main()
  File "flashSTM32.py", line 18, in main
    busPirate = PirateSWD("/dev/ttyUSB0")
  File "pirate-swd/PirateSWD.py", line 7, in __init__
    self.port = serial.Serial(port = f, baudrate = 115200, timeout = 0.01)
  File "/Library/Python/2.7/site-packages/serial/serialutil.py", line 240, in __init__
    self.open()
  File "/Library/Python/2.7/site-packages/serial/serialposix.py", line 268, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'

since it has a different name (/dev/tty.usbserial in my case). Suggestion: add a command-line option to specify an alternate serial port (--port /dev/tty.usbserial). I might help with this later... for now I changed it locally hardcoded to my device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant