zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.82k stars 6.6k forks source link

tests: mimxrt1050_evk : samples/sensor/qdec : build failure #74841

Closed hakehuang closed 4 months ago

hakehuang commented 4 months ago

Describe the bug samples/sensor/qdec build failure

Please also mention any information which could help others to understand the problem you're facing:

e6d8ed2e0d99bb25e9c4002b2a14c8c3a15e9e9b is the first bad commit
commit e6d8ed2e0d99bb25e9c4002b2a14c8c3a15e9e9b
Author: Gerson Fernando Budke <nandojve@gmail.com>
Date:   Wed Jun 19 21:49:29 2024 +0200

    samples: sensor: qdec: Fix wrong harness

    The #73619 which fixes the atmel,sam-tc-qdec sensor implementation
    introduced agregression on the sample test removing the harness
    console. That changed the test to use the default ztest behaviour
    which is incompatible with the test outpout. This restore the
    harness to the default console value.

    Fixes: #74531

    Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>

 samples/sensor/qdec/sample.yaml | 13 +++++++++++++
 1 file changed, 13 insertions(+)

To Reproduce Steps to reproduce the behavior:

west twister -p mimxrt1050_evk -s samples/sensor/qdec/sample.sensor.qdec_sensor

Expected behavior build pass

Impact sensor supporting

Logs and console output

-- Board: mimxrt1050_evk, Revision: hyperflash, qualifiers: mimxrt1052
-- Found host-tools: zephyr 0.16.8 (/opt/toolchains/zephyr-sdk-0.16.8)
-- Found toolchain: zephyr 0.16.8 (/opt/toolchains/zephyr-sdk-0.16.8)
-- Found Dtc: /opt/toolchains/zephyr-sdk-0.16.8/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6") 
-- Found BOARD.dts: /home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/boards/nxp/mimxrt1050_evk/mimxrt1050_evk.dts
-- Found devicetree overlay: /home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/boards/nxp/mimxrt1050_evk/mimxrt1050_evk_mimxrt1052_hyperflash.overlay
-- Found devicetree overlay: /home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/samples/sensor/qdec/boards/mimxrt1050_evk.overlay
devicetree error: /home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/samples/sensor/qdec/boards/mimxrt1050_evk.overlay:41 (column 1): parse error: undefined node label 'touch_controller'
-- In: /home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/twister-out/mimxrt1050_evk/samples/sensor/qdec/sample.sensor.qdec_sensor/zephyr, command: /usr/bin/python;/home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/scripts/dts/gen_defines.py;--dts;/home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/twister-out/mimxrt1050_evk/samples/sensor/qdec/sample.sensor.qdec_sensor/zephyr/zephyr.dts.pre;--dtc-flags;'';--bindings-dirs;/home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/dts/bindings;--header-out;/home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/twister-out/mimxrt1050_evk/samples/sensor/qdec/sample.sensor.qdec_sensor/zephyr/include/generated/zephyr/devicetree_generated.h.new;--dts-out;/home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/twister-out/mimxrt1050_evk/samples/sensor/qdec/sample.sensor.qdec_sensor/zephyr/zephyr.dts.new;--edt-pickle-out;/home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/twister-out/mimxrt1050_evk/samples/sensor/qdec/sample.sensor.qdec_sensor/zephyr/edt.pickle;--edtlib-Werror;--vendor-prefixes;/home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/dts/bindings/vendor-prefixes.txt
CMake Error at cmake/modules/dts.cmake:296 (message):
  gen_defines.py failed with return code: 1
Call Stack (most recent call first):
  cmake/modules/zephyr_default.cmake:132 (include)
  share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
  share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)
  cmake/package_helper.cmake:126 (find_package)

Environment (please complete the following information):

pdgendt commented 4 months ago

CC @nandojve

nandojve commented 4 months ago

Hi @hakehuang, @pdgendt ,

On the log there is an specific message about: devicetree error: /home/jenkins/agent/workspace/bitbucket_build_platform/zephyr/samples/sensor/qdec/boards/mimxrt1050_evk.overlay:41 (column 1): parse error: undefined node label 'touch_controller'"

Since this is a building error I would say that e6d8ed2 is not the root of the problem. The e6d8ed2 enables all devices with qdec0 to catch any possible build error and maybe this is why you can see this now.

dleach02 commented 4 months ago

@EmilioCBen please add this to the 3.7 bug sweep

dleach02 commented 4 months ago

@hakehuang this test fails in v3.6.0. Something changed in your test environment and I suspect it is running test cases outside of twister or something because the sample.yaml for this test case is only for nucleo_f401re (which @nandojve is also pointing out because the failure is the lack of a touchscreen):

tests:
  sample.sensor.qdec_sensor:
    platform_allow: nucleo_f401re
    harness_config:
      fixture: fixture_mech_encoder

Also, the bisect is wrong, which I suspect is automated given that it fails with v3.6.0.

hakehuang commented 4 months ago

Also, the bisect is wrong, which I suspect is automated given that it fails with v3.6.0. @dleach02 this case is never enabled before e6d8ed2e0d99bb25e9c4002b2a14c8c3a15e9e9b, so bisect detect this issue when NXP platform is enabled, as @nandojve comments: Since this is a building error I would say that e6d8ed2 is not the root of the problem. The e6d8ed2 enables all devices with qdec0 to catch any possible build error and maybe this is why you can see this now.

see below testcase.yml.

tests:
  sample.sensor.qdec_sensor:
    filter: dt_alias_exists("qdec0")
    harness_config:
      type: multi_line
      ordered: true
      regex:
        - "Quadrature decoder sensor test"
        - "Position = (.*) degrees"
dleach02 commented 4 months ago

Okay, it was originally broken with a PR #56128 when the touch_controller node name was deprecated, but no automated twister testing caught this. But then further, @danieldegrasse removed the node completely since it was associated with a display to go in favor of shields defining the display in PR #72175. Then @nandojve PR to enable devices with qdec0 to be included in the test set things up for twister to find it the bug...