-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Bug
Copy link
Labels
area: SensorsSensorsSensorsbugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bugplatform: STM32ST Micro STM32ST Micro STM32priority: lowLow impact/importance bugLow impact/importance bug
Description
Describe the bug
ST LIS2DUX12 accelerometer driver doesn't convert the raw value of temperature to Celsius.
When I read the SENSOR_CHAN_DIE_TEMP channel, I get values like these (of type struct sensor_value
): .val1 = 1360, .val2 = 0
.
According to the docs, they must be in Celsius.
To Reproduce
Steps to reproduce the behavior:
- Get a board with a LIS2DUX12 accelerometer
- Enable the LIS2DUX12 driver (by adding the accelerometer into the device tree)
- Add
CONFIG_LIS2DUX12_ENABLE_TEMP=y
to prj.conf - Run some code which reads the SENSOR_CHAN_DIE_TEMP channel. Like the following:
const struct device *dev = DEVICE_DT_GET(LIS2DUX12);
struct sensor_value val = { .val1 = 0, .val2 = 0 };
sensor_channel_get(dev, SENSOR_CHAN_DIE_TEMP, &val);
LOG_DBG("Temperature: %d.%06d", val.val1, val.val2);
Logs and console output
[00:22:32.297,729] <dbg> test_accelerometer: Temperature: 1520.000000
Environment
- Zephyr 3.7.0-rc2
Metadata
Metadata
Assignees
Labels
area: SensorsSensorsSensorsbugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bugplatform: STM32ST Micro STM32ST Micro STM32priority: lowLow impact/importance bugLow impact/importance bug