Skip to content

LIS2DUX12 setting incorrect ODR configuration #92393

@aaronduignan

Description

@aaronduignan

In lis2dux12_freq_to_odr_val, the code cycles through the array of possible ODR frequencies and breaking when the value is less than or equal to current value in the array.

This will break too soon or incorrectly when the user tries to configure the frequency to 6Hz, 12.5Hz and 25Hz (Normal mode) as the 3rd element in the array is 25Hz (ULP).

Suggest checking if the PM state is LIS2DUX12_OPER_MODE_LOW_POWER before selecting the (ULP) frequencies. This should protect against the issue of configuring 25Hz ULP for 6, 12.5 and 25Hz (Normal mode).

https://github.com/zephyrproject-rtos/zephyr/blame/ad4c3e3e9afe1385ab80adf3fa2d3309fad68c60/drivers/sensor/st/lis2dux12/lis2dux12.c#L57

Metadata

Metadata

Labels

area: SensorsSensorsbugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions