Skip to content

ST LIS2DUX12 driver: will not correctly read values on big-endian HW #75758

@ragrus-nbl

Description

@ragrus-nbl

Describe the bug
ST LIS2DUX12 accelerometer driver makes unnecessary "little-endian to CPU endian" conversion. This will lead to incorrect readings on big-endian HW.

I believe these sys_le16_to_cpu() conversions are not needed: three here and one there.

That's because values are converted to CPU endianness in the hal_st code: here and there correspondingly.

I can't reproduce/check this in practice as I don't have a big-endian HW with this sensor.

To Reproduce
Read any sensor channel (e.g., SENSOR_CHAN_DIE_TEMP) on big-endian HW.

Environment

  • Zephyr 3.7.0-rc2

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