cuwire
cuwire copied to clipboard
Automatic com port selection
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:
- A user selects a board.
- A configuration for this board contains a usb vendorId:productId
- Port list refreshes automatically
- The app sees that the list contains one and only one port with the corresponding vendorId:productId
- The app selects this port automatically for firmware upload.
Flow for board plugged in via USB UART adapter:
- A user selects a board.
- A configuration for this board doesn't contain a usb vendorId:productId
- Port list refreshes automatically
- 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)
- 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?)