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.76k stars 6.56k forks source link

adafruit_feather_nrf52840: tests/subsys/portability/cmsis_rtos_v2/portability.cmsis_rtos_v2 fails when building #80215

Open fkokosinski opened 4 days ago

fkokosinski commented 4 days ago

Describe the bug

The test in tests/subsys/portability/cmsis_rtos_v2/portability.cmsis_rtos_v2 fails to build for the following two Zephyr targets:

The following compilation error is reported:

/home/filip/zephyrproject/zephyr/drivers/sensor/voltage_divider/voltage.c:118:41: warning: implicit
declaration of function 'K_TIMEOUT_ABS_TICKS'; did you mean 'Z_TIMEOUT_MS_TICKS'? [-Wimplicit-function-declaration]
  118 |                 data->earliest_sample = K_TIMEOUT_ABS_TICKS(
      |                                         ^~~~~~~~~~~~~~~~~~~
      |                                         Z_TIMEOUT_MS_TICKS
/home/filip/zephyrproject/zephyr/drivers/sensor/voltage_divider/voltage.c:118:41: error: incompatible types when assigning to type 'k_timeout_t' from type 'int'
/home/filip/zephyrproject/zephyr/drivers/sensor/voltage_divider/voltage.c: In function 'voltage_ini
':
/home/filip/zephyrproject/zephyr/drivers/sensor/voltage_divider/voltage.c:145:33: error: incompatible types when assigning to type 'k_timeout_t' from type 'int'
  145 |         data->earliest_sample = K_TIMEOUT_ABS_TICKS(0);

To Reproduce Steps to reproduce the behavior:

  1. west build -p -b adafruit_feather_nrf52840/nrf52840/sense tests/subsys/portability/cmsis_rtos_v2
  2. See error

Expected behavior

Build doesn't end with an error.

Impact

Showstopper (failing CI). See #80038.

Environment (please complete the following information):

fkokosinski commented 4 days ago

For context: this bug is most likely caused by this sample's config, because it explicitly n-selects CONFIG_TIMEOUT_64BIT: https://github.com/zephyrproject-rtos/zephyr/blob/main/tests/subsys/portability/cmsis_rtos_v2/prj.conf#L16.

Whereas K_TIMEOUT_ABS_TICKS is only defined when CONFIG_TIMEOUT_64BIT is y-selected: https://github.com/zephyrproject-rtos/zephyr/blob/main/include/zephyr/kernel.h#L1442-L1456.

nashif commented 3 days ago

well, when a board enables more than the basic and the test has its own requirement, worlds collide. This test should just be built/run on simulation platforms IMO and not on every other board we have.

The build failure is not in the test, it is in some sensor driver

/home/filip/zephyrproject/zephyr/drivers/sensor/voltage_divider/voltage.c: In function 'voltage_ini