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

samples: sensor: accel_trig : fail with device lis2dw12 not ready #86413

Open
djiatsaf-st opened this issue Feb 27, 2025 · 3 comments
Open

samples: sensor: accel_trig : fail with device lis2dw12 not ready #86413

djiatsaf-st opened this issue Feb 27, 2025 · 3 comments
Assignees
Labels
area: Sensors Sensors bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@djiatsaf-st
Copy link
Collaborator

Describe the bug

The changes made in this PR #85939 introduce a bug. The sample fails on STM32 platforms that don't have the x_nucleo_iks01a3 shield on them.

To Reproduce

  1. have STM32 board connected without x_nucleo_iks01a3 shied on it.
  2. go to your zephyr directory
  3. ./scripts/twister --device-testing --device-serial /dev/ttyACM0 -p nucleo_g071rb -T samples/sensor/accel_trig
  4. See handler.log file

Expected behavior

Valid console output if board have shied on it or integrated sensor, ortherwise skip sample scenario.

Logs and console output

  • Booting Zephyr OS build v4.1.0-rc2-70-gc135c37b3ad6 ***
    Device lis2dw12@19 is not ready

Environment (please complete the following information):

  • OS: Ubuntu 22.04 LTS
  • Toolchain Zephyr SDK 0.17.0

Additional context

The sample has valid output on the stm32f3_disco since the sensor is integrated on it.

@djiatsaf-st djiatsaf-st added the bug The issue is a bug, or the PR is fixing a bug label Feb 27, 2025
@djiatsaf-st djiatsaf-st changed the title samples: sensor: accel_trig : fail on many stm32 platform samples: sensor: accel_trig : fail on many stm32 platforms Feb 27, 2025
@djiatsaf-st djiatsaf-st added the platform: STM32 ST Micro STM32 label Feb 27, 2025
@djiatsaf-st djiatsaf-st removed the platform: STM32 ST Micro STM32 label Feb 27, 2025
@djiatsaf-st djiatsaf-st changed the title samples: sensor: accel_trig : fail on many stm32 platforms samples: sensor: accel_trig : fail with device lis2dw12 not ready Feb 27, 2025
@nordic-piks
Copy link
Collaborator

Found also with nrf platforms. Looks like this configuration is missing fixture which will select for testing only at devices which has shield mounted.

@nordic-piks
Copy link
Collaborator

@pcurt FYI

@nordic-piks nordic-piks added priority: low Low impact/importance bug area: Sensors Sensors labels Feb 28, 2025
@pcurt
Copy link
Contributor

pcurt commented Feb 28, 2025

This is because the depends on is too generic.

    depends_on:
      - arduino_i2c

I think we can add a filter and a fixture

--- a/samples/sensor/accel_trig/sample.yaml
+++ b/samples/sensor/accel_trig/sample.yaml
@@ -37,8 +37,10 @@ tests:
       - apard32690/max32690/m4
   sample.sensor.accel_trig.shield-tap:
     harness: console
+    filter: dt_compat_enabled("st,lis2dw12")
     tags: sensors
     harness_config:
+      fixture: fixture_sensor_accel_tap
       type: one_line
       regex:
         - "^\\s*[0-9A-Za-z_,+-.]*@[0-9A-Fa-f]* \\[m\/s\\^2\\]:    \
@@ -57,6 +59,7 @@ tests:
             dt_compat_enabled("st,iis2dlpc") or dt_compat_enabled("st,lis2dw12")
     tags: sensors
     harness_config:
+      fixture: fixture_sensor_accel_tap
       type: one_line
       regex:
         - "^\\s*[0-9A-Za-z_,+-.]*@[0-9A-Fa-f]* \\[m\/s\\^2\\]:    \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Sensors Sensors bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

4 participants