Skip to content

Commit

Permalink
samples: sensor: Use adxl362 and bme688 on nrf54
Browse files Browse the repository at this point in the history
Add alternative sample configuration for
- zephyr/samples/sensor/accel_polling,
- zephyr/samples/sensor/bme680.

Fix coverage when using alternative configuration for
- zephyr/tests/drivers/i2c/i2c_bme688.

Enable test execution on nrf54h20dk and nrf54l15pdk.
Select hardware based on fixture.
Add sensors to DTS with
- SHIELD=63565 on nrf54l,
- SHIELD=63566 on nrf54h.

Signed-off-by: Sebastian Głąb <[email protected]>
  • Loading branch information
nordic-segl authored and carlescufi committed May 17, 2024
1 parent 9b271cd commit 46f6922
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
sample:
name: Accelerometer polling sample
common:
depends_on: spi
tags: drivers spi sensors
harness: console

tests:
sample.sensor.accel_polling.nrf54h:
filter: not CONFIG_COVERAGE
harness_config:
fixture: pca63566
type: one_line
regex:
- "^\\s*[0-9A-Za-z_,+-.]*@[0-9A-Fa-f]* \\[m\/s\\^2\\]: \
\\(\\s*-?[0-9\\.]*,\\s*-?[0-9\\.]*,\\s*-?[0-9\\.]*\\)$"
extra_args:
- SHIELD=pca63566
platform_allow: nrf54h20dk/nrf54h20/cpuapp

sample.sensor.accel_polling.nrf54h_coverage:
filter: CONFIG_COVERAGE
harness_config:
fixture: pca63566
type: one_line
regex:
- "^\\s*[0-9A-Za-z_,+-.]*@[0-9A-Fa-f]* \\[m\/s\\^2\\]: \
\\(\\s*-?[0-9\\.]*,\\s*-?[0-9\\.]*,\\s*-?[0-9\\.]*\\)$"
extra_args:
- SHIELD=pca63566;coverage_support
platform_allow: nrf54h20dk/nrf54h20/cpuapp

sample.sensor.accel_polling.nrf54l:
filter: not CONFIG_COVERAGE
harness_config:
fixture: pca63565
type: one_line
regex:
- "^\\s*[0-9A-Za-z_,+-.]*@[0-9A-Fa-f]* \\[m\/s\\^2\\]: \
\\(\\s*-?[0-9\\.]*,\\s*-?[0-9\\.]*,\\s*-?[0-9\\.]*\\)$"
extra_args:
- SHIELD=pca63565
platform_allow: nrf54l15pdk/nrf54l15/cpuapp

sample.sensor.accel_polling.nrf54l_coverage:
filter: CONFIG_COVERAGE
harness_config:
fixture: pca63565
type: one_line
regex:
- "^\\s*[0-9A-Za-z_,+-.]*@[0-9A-Fa-f]* \\[m\/s\\^2\\]: \
\\(\\s*-?[0-9\\.]*,\\s*-?[0-9\\.]*,\\s*-?[0-9\\.]*\\)$"
extra_args:
- SHIELD=pca63565;coverage_support
platform_allow: nrf54l15pdk/nrf54l15/cpuapp
51 changes: 51 additions & 0 deletions scripts/twister/alt/zephyr/samples/sensor/bme680/sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
sample:
name: BME680 Sensor sample
common:
depends_on: i2c
tags: drivers i2c sensors
harness: console

tests:
sample.sensor.bme680.nrf54h:
filter: not CONFIG_COVERAGE
harness_config:
fixture: pca63566
type: one_line
regex:
- "^\\s*T:\\s*-?[0-9\\.]*; P:\\s*-?[0-9\\.]*; H: \\s*-?[0-9\\.]*; G:\\s*-?[0-9\\.]*$"
extra_args:
- SHIELD=pca63566
platform_allow: nrf54h20dk/nrf54h20/cpuapp

sample.sensor.bme680.nrf54h_coverage:
filter: CONFIG_COVERAGE
harness_config:
fixture: pca63566
type: one_line
regex:
- "^\\s*T:\\s*-?[0-9\\.]*; P:\\s*-?[0-9\\.]*; H: \\s*-?[0-9\\.]*; G:\\s*-?[0-9\\.]*$"
extra_args:
- SHIELD=pca63566;coverage_support
platform_allow: nrf54h20dk/nrf54h20/cpuapp

sample.sensor.bme680.nrf54l:
filter: not CONFIG_COVERAGE
harness_config:
fixture: pca63565
type: one_line
regex:
- "^\\s*T:\\s*-?[0-9\\.]*; P:\\s*-?[0-9\\.]*; H: \\s*-?[0-9\\.]*; G:\\s*-?[0-9\\.]*$"
extra_args:
- SHIELD=pca63565
platform_allow: nrf54l15pdk/nrf54l15/cpuapp

sample.sensor.bme680.nrf54l_coverage:
filter: CONFIG_COVERAGE
harness_config:
fixture: pca63565
type: one_line
regex:
- "^\\s*T:\\s*-?[0-9\\.]*; P:\\s*-?[0-9\\.]*; H: \\s*-?[0-9\\.]*; G:\\s*-?[0-9\\.]*$"
extra_args:
- SHIELD=pca63565;coverage_support
platform_allow: nrf54l15pdk/nrf54l15/cpuapp
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,37 @@ common:
harness: ztest
tests:
drivers.i2c.bme688_nrf54l:
filter: not CONFIG_COVERAGE
harness_config:
fixture: pca63565
extra_args:
- SHIELD=pca63565
platform_allow:
- nrf54l15pdk/nrf54l15/cpuapp

drivers.i2c.bme688_nrf54l_coverage:
filter: CONFIG_COVERAGE
harness_config:
fixture: pca63565
extra_args:
- SHIELD=pca63565;coverage_support
platform_allow:
- nrf54l15pdk/nrf54l15/cpuapp

drivers.i2c.bme688_nrf54h:
filter: not CONFIG_COVERAGE
harness_config:
fixture: pca63566
extra_args:
- SHIELD=pca63566
platform_allow:
- nrf54h20dk/nrf54h20/cpuapp

drivers.i2c.bme688_nrf54h_coverage:
filter: CONFIG_COVERAGE
harness_config:
fixture: pca63566
extra_args:
- SHIELD=pca63566;coverage_support
platform_allow:
- nrf54h20dk/nrf54h20/cpuapp

0 comments on commit 46f6922

Please sign in to comment.