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

Win32 Override File #3

Merged
merged 11 commits into from
Oct 2, 2019
Merged

Win32 Override File #3

merged 11 commits into from
Oct 2, 2019

Conversation

fragmuffin
Copy link
Owner

@fragmuffin fragmuffin commented Oct 2, 2019

Option to create a map of pyboard serial numbers to comport & mounted drive.

Example content saved to %USERPROFILE%\.upytester-map.yaml

'327834873036':
    comport: COM3
    mountpoint: D:\
'3976346C3436':
    comport: COM4
    mountpoint: E:\

Then run upytester with PYBOARD_CONFIG_FILE environment variable:

> set PYBOARD_CONFIG_FILE=%USERPROFILE%\.upytester-map.yaml
> python -m upytester list
Connected PyBoards: <serial> <comport> <mountpoint>
    327834873036    COM3             D:\

WARNING: upytester assumes the map you've given is correct, if it is incorrect then files may be synchronised to a USB stick, or another drive.
Also, if 2 pyboards are connected in reverse order, then you will end up stimulating the wrong board.

What should these values be?

To get the above information from Windows:

  1. Open the Device Manager
  2. Click: View > Devices by Connection
  3. Find your pyboard thorugh the system hierarchy, it will likely be something like:
    • <your computer>
    • ACPI x64-based PC
    • Microsoft ACPI-Compliant System
    • PCI Express Root Complex
    • Intel(R) USB 3.1 eXtensible Host Controller -1.10 (Microsoft)
    • USB Root Hub (USB 3.0)
    • USB Composite Device

It's also likely you'll find more than one USB Composite Device.
The pyboards are a composite containing a Serial interface, and Mass Storage interface.

USB Composite Device
    - USB Mass Storage Device
    - USB Serial Device (COMx)

Serial Number
Right-click on USB Composite Device > select Properties.
Select the Details tab > select Device instance path from the drop-down.
That attribute's value will be something like USB\VID_F055&PID_9800\327834873036, whereby the serial-number is everything after the last \, in this case: 327834873036

comport
That's easy; that's listed in the name of one of the children of the USB Composite Device.
For example: USB Serial Device (COM3) is connected on COM3.

mountpoint
Simply disconnect, and re-connect your pyboard and observe which drive it's mounted on.
For example, you may see PYBOARD mounted on D:\.

WARNING: if you have multiple pyboards, I recommend connecting them to a USB hub, and disconnect the USB hub (not individual pyboards), then re-connect... the order in which the OS mounts the drives should be consistent.

With all the examples above, you would end up with a %USERPROFILE%\.upytester-map.yaml file with contents:

'327834873036':
    comport: COM3
    mountpoint: D:\

@fragmuffin
Copy link
Owner Author

Workaround for #2 (not a solution)

@fragmuffin fragmuffin merged commit bfebf14 into master Oct 2, 2019
@fragmuffin fragmuffin deleted the feature/win32-workaround branch October 3, 2019 06:40
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

Successfully merging this pull request may close these issues.

1 participant