Skip to content

Conversation

pyhys
Copy link
Contributor

@pyhys pyhys commented Aug 30, 2025

Product photo from https://learn.adafruit.com/assets/130701 with license CC BY-SA 3.0

Tested with command mentioned in the index.rst page.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for the Adafruit DS2484 I2C to 1-Wire Bus Adapter as a Zephyr shield, enabling 1-wire device communication through I2C connectivity.

  • Introduces a new shield configuration for the Adafruit DS2484 adapter
  • Refactors test harness configuration to move from common to individual test level
  • Adds shield-specific test case with appropriate platform configuration

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
boards/shields/adafruit_ds2484/shield.yml Shield metadata defining name, vendor, and supported features
boards/shields/adafruit_ds2484/doc/index.rst Complete documentation with overview, requirements, pin assignments, and usage examples
boards/shields/adafruit_ds2484/adafruit_ds2484.overlay Device tree overlay configuring the DS2484 I2C device and w1 node aliases
boards/shields/adafruit_ds2484/Kconfig.shield Kconfig shield selection configuration
samples/drivers/w1/scanner/sample.yaml Test harness refactoring and addition of shield-specific test case

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 4 to 6
common:
harness: console
tags:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the issue with the console harness and your shield?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I have misunderstood how this works. Ideally I would like to test on hardware (an actual shield). However now I at least would like to have a build-only test. Will that give any output on a console? Any help is appreciated.

It seems to work locally if I change back to the original "common" setting and add

  sample.drivers.w1.scanner.shields:
    platform_allow:
      - adafruit_qt_py_rp2040/rp2040
    extra_args:
      - platform:adafruit_qt_py_rp2040/rp2040:SHIELD="adafruit_ds2484"
    harness_config:
      type: one_line

Is that a better way?

@pyhys pyhys changed the title Boards: Shields: Add Adafruit DS2484 1-wire shield boards: shields: Add Adafruit DS2484 1-wire shield Aug 30, 2025
kartben
kartben previously approved these changes Aug 31, 2025
Copy link
Contributor

@str4t0m str4t0m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor notes.

@pyhys
Copy link
Contributor Author

pyhys commented Sep 21, 2025

@str4t0m I modified the sample.yaml to

  sample.drivers.w1.scanner.shields:
    platform_allow:
      - adafruit_qt_py_rp2040/rp2040
    integration_platforms:
      - adafruit_qt_py_rp2040/rp2040
    extra_args:
      - platform:adafruit_qt_py_rp2040/rp2040:SHIELD="adafruit_ds2484"
    harness_config:
      type: one_line
      regex:
        - "Number of devices found on bus: .*"

Then I can compile-test the overlay file locally with:

scripts/twister -T samples/drivers/w1/scanner -v -v --platform adafruit_qt_py_rp2040

and the resulting twister.json contains:

{
    "environment":{
        "os":"posix",
        "zephyr_version":"v4.2.0-2542-g04c885d95a85",
        "toolchain":"zephyr",
        "commit_date":"2025-09-21T13:38:57+02:00",
        "run_date":"2025-09-21T11:45:22+00:00",
        "options":{
            "testsuite_root":[
                "samples/drivers/w1/scanner"
            ],
            "platform":[
                "adafruit_qt_py_rp2040"
            ],
            "verbose":2
        }
    },
    "testsuites":[
        {
            "name":"sample.drivers.w1.scanner.shields",
            "arch":"arm",
            "platform":"adafruit_qt_py_rp2040/rp2040",
            "path":"samples/drivers/w1/scanner",
            "run_id":"62b42d4b391360108177f6360ec147af",
            "runnable":false,
            "retries":0,
            "toolchain":"zephyr",
            "status":"not run",
            "reason":"Unknown",
            "execution_time":"0.00",
            "build_time":"23.39",
            "testcases":[
                {
                    "identifier":"sample.drivers.w1.scanner.shields",
                    "execution_time":"0.00",
                    "status":"not run",
                    "reason":"Test was built only"
                }
            ]
        }
    ]
}

@pyhys
Copy link
Contributor Author

pyhys commented Sep 21, 2025

When I connect the shield to an adafruit_qt_py_rp2040, manually set the board to bootloader mode, and run:

scripts/twister -T samples/drivers/w1/scanner -v -v --platform adafruit_qt_py_rp2040  --device-testing --device-serial /dev/ttyUSB0

the result is a passing device test:

{
    "environment":{
        "os":"posix",
        "zephyr_version":"v4.2.0-2542-g04c885d95a85",
        "toolchain":"zephyr",
        "commit_date":"2025-09-21T13:38:57+02:00",
        "run_date":"2025-09-21T17:13:50+00:00",
        "options":{
            "testsuite_root":[
                "samples/drivers/w1/scanner"
            ],
            "device_testing":true,
            "device_serial":"/dev/ttyUSB0",
            "platform":[
                "adafruit_qt_py_rp2040"
            ],
            "verbose":2
        }
    },
    "testsuites":[
        {
            "name":"sample.drivers.w1.scanner.shields",
            "arch":"arm",
            "platform":"adafruit_qt_py_rp2040/rp2040",
            "path":"samples/drivers/w1/scanner",
            "run_id":"a3831980448e8ef45b7970b2573d90ce",
            "runnable":true,
            "retries":0,
            "toolchain":"zephyr",
            "status":"passed",
            "execution_time":"2.82",
            "build_time":"24.60",
            "testcases":[
                {
                    "identifier":"sample.drivers.w1.scanner.shields",
                    "execution_time":"2.82",
                    "status":"passed"
                }
            ]
        }
    ]
}

@pyhys
Copy link
Contributor Author

pyhys commented Sep 21, 2025

So what is the consensus @str4t0m @JarmouniA @kartben ?
Should I do any more changes to this PR?

@JarmouniA
Copy link
Contributor

So what is the consensus @str4t0m @JarmouniA @kartben ? Should I do any more changes to this PR?

In my opinion, no, the problem of testing with shields is general, not specific to this PR.

@kartben kartben requested a review from str4t0m September 25, 2025 06:59
kartben
kartben previously approved these changes Sep 25, 2025
@str4t0m
Copy link
Contributor

str4t0m commented Sep 25, 2025

If you have a chance could you please add the fixture as discussed on weekend above.

Good, @JarmouniA would it be fine for you if we add the fixture line for now, since we don't have anything better yet, and you propose an RFC issue or a PR introducing the shield filter. And after the shield filter has landed I'll convert the 1-Wire tests to use the shield filter where applicable?

@pyhys
Copy link
Contributor Author

pyhys commented Sep 25, 2025

Rebased on main to fix CI issues.

@pyhys
Copy link
Contributor Author

pyhys commented Oct 12, 2025

@JarmouniA and @str4t0m How do we proceed with this PR? Can it be merged now and the fixture be added later?

@str4t0m
Copy link
Contributor

str4t0m commented Oct 16, 2025

@pyhys It guess you have seen my proposal in comment? I would still prefer if you could add it here, as it would be just adding a single line. But if not, I can approve the PR and open a PR on the weekend to fix the issue.

Product photo from https://learn.adafruit.com/assets/130701
with license CC BY-SA 3.0

Tested with command mentioned in the index.rst page.

Signed-off-by: Jonas Berg <[email protected]>
@sonarqubecloud
Copy link

@pyhys
Copy link
Contributor Author

pyhys commented Oct 17, 2025

@str4t0m OK, I did not understand what to do previously. Now I added the fixture line. Can you please have a look to see that it is correct?

@str4t0m
Copy link
Contributor

str4t0m commented Oct 17, 2025

Great, thanks! Yes that what I meant.

@str4t0m str4t0m requested a review from kartben October 17, 2025 09:13
@henrikbrixandersen henrikbrixandersen merged commit 9434b2c into zephyrproject-rtos:main Oct 17, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants