- 
                Notifications
    You must be signed in to change notification settings 
- Fork 8.2k
sensor: adxl345: fix Streaming mode #88393
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
sensor: adxl345: fix Streaming mode #88393
Conversation
With actual parameter to determine whether the driver requires it: Streaming mode enabled. Signed-off-by: Luis Ubieda <[email protected]>
SQE flags are adjusted when preparing write/read ops, therefore an OR operation is required. Signed-off-by: Luis Ubieda <[email protected]>
| I've pushed additional changes to this branch: 
 | 
ba4e971    to
    ccebcc6      
    Compare
  
    This patch fixes previous overriding of ODR setting through DTS (it would always be 25-Hz, irrespective of what the DTS property said). While doing so, create dt-binding enum to improve settings clarity. Signed-off-by: Luis Ubieda <[email protected]>
To better reflect the actual ODR setting. Signed-off-by: Luis Ubieda <[email protected]>
Allow for users to define the fifo-watermark on a per-instance basis through device-tree properties. This setting is validated at build time, so missing it when required, or setting an invalid value should not end up in a run-time errror (as in: it runs but nothing happens). Signed-off-by: Luis Ubieda <[email protected]>
Since it's directly related (we can't just burst-read the fifo at once). This patch includes a comment block explaining this rationale. Signed-off-by: Luis Ubieda <[email protected]>
No functional changes, only formatting changes. Signed-off-by: Luis Ubieda <[email protected]>
So applications working with this shield will continue to work as before. Signed-off-by: Luis Ubieda <[email protected]>
ccebcc6    to
    873b090      
    Compare
  
    | I've pushed once more to fix the CI failures, which now seems to be green. PR is up for review! | 
| Hi all, | 
| - 11 # ADXL345_DT_ODR_200 | ||
| - 12 # ADXL345_DT_ODR_400 | ||
|  | ||
| fifo-watermark: | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should pick a direction and go with it. Most applications I've worked with (usually in AR/VR and Android) expect that the scheduling of the processing thread is predictable. So I much prefer to use SENSOR_ATTR_BATCH_DURATION or in DT some form of batch-duration-us. This way you can expect to get samples at the same time interval regardless of the ODR.
Whatever direction we go we should be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Friendly reminder @yperess: please let me know if there's anything else required for removing the NACK.
Thanks in advance!
| FYI - I'm planning to come back to this early next week. Stay tuned | 
| Per today's Sensor WG discussion, adding a DNM label until @MaureenHelm @yperess take another look | 
| @yperess please revisit | 
Description
This PR contains fixes found while troubleshooting the ADXL345 driver in order to get it working in Streaming mode.
Specific changes:
Note
While digging into this, some fixes were applied to NXP I2C RTIO driver (#88315) and nRF I2C RTIO driver (#88380 and #88390). They're required in order to prove this fix works.
Testing
Build Shell sample for nRF52840DK with Streaming commands enabled and validate sensor data is coming through (To replicate, please go to the branch with the I2C RTIO related fixes: https://github.com/croxel/zephyr/tree/fix-working-with-nrf52840dk/adxl345-streaming).
west build -b nrf52840dk/nrf52840 samples/subsys/shell/shell_module