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

When not provided with no argument, it should report an error and usage example #7

Open
zoobab opened this issue Nov 30, 2017 · 1 comment

Comments

@zoobab
Copy link

zoobab commented Nov 30, 2017

When not provided with no argument, it should report an error and usage example.

Right now, it throws an error saying it cannot find "/dev/tty.usbserial-ftCYPMYJ":

$ ./stm32loader.py 
Traceback (most recent call last):
  File "./stm32loader.py", line 427, in <module>
    cmd.open(conf['port'], conf['baud'])
  File "./stm32loader.py", line 71, in open
    timeout=5               # set a timeout value, None for waiting forever
  File "/usr/lib64/python2.7/site-packages/serial/serialutil.py", line 236, in __init__
    self.open()
  File "/usr/lib64/python2.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/tty.usbserial-ftCYPMYJ: [Errno 2] No such file or directory: '/dev/tty.usbserial-ftCYPMYJ'
@florisla
Copy link

florisla commented Mar 7, 2018

Running without any option is a valid use case: in that case stm32loader prints the bootloader version and device ID.

It's just unfortunate that the default port has a low chance of being correct (and 0% chance on non-Unix platforms).

Basically, what you're asking is to make the -p [port] option mandatory.

I've done this in a branch (note: requires Python3): https://github.com/florisla/stm32loader/tree/require-option-p

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

2 participants