cuwire icon indicating copy to clipboard operation
cuwire copied to clipboard

Automatic com port selection

Open apla opened this issue 9 years ago • 0 comments

cli precondition:

cuwire is called with upload or console command along with board option but no port option.

and

User has either:

  • one mcu board with native USB plugged in
  • one board via USB UART adapter plugged in, and the board doesn't have native USB

gui precondition:

Application has Automatic port selection setting turned on

and

User has either:

  • one mcu board with native USB plugged in
  • one board via USB UART adapter plugged in, and the board doesn't have native USB

Flow for native usb board:

  1. A user selects a board.
  2. A configuration for this board contains a usb vendorId:productId
  3. Port list refreshes automatically
  4. The app sees that the list contains one and only one port with the corresponding vendorId:productId
  5. The app selects this port automatically for firmware upload.

Flow for board plugged in via USB UART adapter:

  1. A user selects a board.
  2. A configuration for this board doesn't contain a usb vendorId:productId
  3. Port list refreshes automatically
  4. The app sees that the list contains one and only one port with the vendorId:productId of known USB UART adapter (ftdi, max232, plc2303, cp210x, ch341 at least)
  5. The app selects this port automatically for firmware upload.

Special conditions:

This use case doesn't apply:

  • If user plugged in multiple boards with one vendorId:productId
  • If user selected non-default programmer

Implementation details:

  • [x] api add vendorId:productId of usb uart
  • [x] cli display board name along with port name for matching vendorId:productId e4f853b67182f0
  • [ ] gui display board name along with port name for matching vendorId:productId
  • [x] cli guess port name if board name is provided f484adff94b
  • [ ] gui autoscan serial ports in 1 minute
  • [ ] gui should have option in settings to enable or disable automatic port selection
  • [ ] gui temporarily turn off autoselection if user select port manually after port autoselection (when to turn on?)

apla avatar Feb 03 '15 21:02 apla