Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADXL sensor drivers attempt to modify config struct at run-time #83853

Open
ubieda opened this issue Jan 11, 2025 · 2 comments · May be fixed by #83852
Open

ADXL sensor drivers attempt to modify config struct at run-time #83853

ubieda opened this issue Jan 11, 2025 · 2 comments · May be fixed by #83852
Assignees
Labels
area: Sensors Sensors bug The issue is a bug, or the PR is fixing a bug platform: ADI Analog Devices, Inc.

Comments

@ubieda
Copy link
Member

ubieda commented Jan 11, 2025

Describe the bug
Drivers for ADXL345 and ADXL372 attempt to modify the config struct when setting ODR attribute:

Since config struct is constant, modifying it triggers a fault.

This is present since 4.0.0:

To Reproduce

Build samples/drivers/sensor/accel_polling with either of these sensors, and it will crash, since this sample sets the ODR.

Expected behavior
Config struct is not modified at run-time.

@ubieda ubieda added bug The issue is a bug, or the PR is fixing a bug platform: ADI Analog Devices, Inc. labels Jan 11, 2025
@ubieda ubieda self-assigned this Jan 11, 2025
@ubieda ubieda added the area: Sensors Sensors label Jan 11, 2025
@glenn-andrews
Copy link
Collaborator

Should ODR be in the data struct instead of config?

@ubieda
Copy link
Member Author

ubieda commented Jan 13, 2025

Should ODR be in the data struct instead of config?

I hadn't seen any references in the file (get_attr() is not implemented), henced I had the PR removing it. I did take another look and I see it's referenced in process_fifo_samples_cb in Streaming mode. I'll add it back up in data. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Sensors Sensors bug The issue is a bug, or the PR is fixing a bug platform: ADI Analog Devices, Inc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants