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

Recovery and reset on the same relay #1390

Open
sjg20 opened this issue May 3, 2024 · 3 comments
Open

Recovery and reset on the same relay #1390

sjg20 opened this issue May 3, 2024 · 3 comments

Comments

@sjg20
Copy link
Contributor

sjg20 commented May 3, 2024

For tegra boards (and also Samsung) I need to a reset sequence like this:

  • assert reset
  • assert recovery
  • de-assert reset
  • de-assert recovery

For some boards I have reset and recovery on the same HIDrelay. How do I tell labgrid which is which?

My exports are:

  HIDRelay:
    ## reset
    ## usbrelay 0 2
    ##serial: 6QMBS
    index: 2
    usbrelay: True
    match:
      '@ID_PATH': 'pci-0000:00:14.0-usb-0:10.1.2'

  HIDRelay:
    ## recovery
    ## usbrelay 0 3
    ##serial: 6QMBS
    index: 3
    usbrelay: True
    match:
      '@ID_PATH': 'pci-0000:00:14.0-usb-0:10.1.2'

and I'm not sure what to put in the env:

  tk1:
    resources:
      RemotePlace:
        name: tk1

    drivers:
      AlwaysPowerDriver: {}
      SerialDriver: {}
      DigitalOutputResetDriver: {}
      DigitalOutputRecoveryDriver: {}       -- added by me, a 'RecoveryProtocol' driver
      HIDRelayDriver: {}

It seems that labgrid assumes that DigitalOutputResetDriver refers to the only digital output available. But what if there are two? I don't see how to make this connection in the various configuration files.

@sjg20
Copy link
Contributor Author

sjg20 commented May 10, 2024

Any thoughts on this one?

The place only shows one relay:

Place 'tk1':
  matches:
    kea/tk1/*
  acquired: ellesmere/sglass
  acquired resources:
    kea/tk1/NetworkHIDRelay/HIDRelay
    kea/tk1/NetworkSerialPort/NetworkSerialPort
    kea/tk1/NetworkTegraUSBLoader/TegraUSBLoader
  created: 2024-05-03 12:08:38.000100
  changed: 2024-05-10 10:31:59.389736

When I try to use this place, I get:

LG_CROSSBAR=ws://kea:20408/ws labgrid-client -vv -c /vid/software/devel/ubtest/lab/env_rpi_try.cfg -V do-bootstrap 1 -V do-build 1 -V do-send 1 -p tk1 -s start -a console 
INFO               root: Selected role tk1 from configuration file
Traceback (most recent call last):
  File "/vid/software/devel/ubtest/labgrid/labgrid/target.py", line 373, in bind_driver
    self.get_driver(requirement, name=supplier_name, activate=False),
  File "/vid/software/devel/ubtest/labgrid/labgrid/target.py", line 240, in get_driver
    return self._get_driver(cls, name=name, resource=resource,
  File "/vid/software/devel/ubtest/labgrid/labgrid/target.py", line 189, in _get_driver
    raise NoDriverFoundError(
labgrid.exceptions.NoDriverFoundError: no DigitalOutputProtocol driver found in Target(name='tk1', env=Environment(config_file='/vid/software/devel/ubtest/lab/env_rpi_try.cfg'), var_dict=None)

The above exception was the direct cause of the following exception:
...

So it seems to see only one of the relay channels??

@sjg20
Copy link
Contributor Author

sjg20 commented Jun 15, 2024

I have another board which needs this (Beagleplay).

Undef 'Exporter Configuration' I can see how to create a group., but I am not sure how to apply this here:

  HIDRelay:
    ## reset
    ## usbrelay 2 6
    ## hub a 10
    ## serial: 7QMBS
    index: 6
    match:
      'ID_PATH': 'pci-0000:00:14.0-usb-0:10.4.2'

  HIDRelay:
    ## recovery (USR1)
    ## usbrelay 2 7
    ## hub a 10
    ## serial: 7QMBS
    index: 7
    match:
      'ID_PATH': 'pci-0000:00:14.0-usb-0:10.4.2'

They both have the same match string, of course...

BTW I have some ideas on how to improve the configuration, if anyone is interested.

@Emantor
Copy link
Member

Emantor commented Jun 17, 2024

Labgrid supports this, but you have to use the labgrid-client add-named-match for resources and than manually specify the bindings for both IODrivers. Part of it is explained in the labgrid-client man page and another part in this discussion.

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