-
Notifications
You must be signed in to change notification settings - Fork 7k
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
drivers: sensor: icm42670: supports icm42670-P and icm42670-S #71374
drivers: sensor: icm42670: supports icm42670-P and icm42670-S #71374
Conversation
Hello @afontaine-invn, and thank you very much for your first pull request to the Zephyr project! |
c22caff
to
e45513b
Compare
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.
please, check Zephyr contribution guidelines. There seem to be PDFs and binary files in this PR.
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.
An initial pass here (and this is large so I'll need time to look at it again) with some high level notable comments but...
I love that this is being submitted as a PR from you, with a TDK email address. I hope this is just the first of many to be frank.
That said there's some issues that will need to be addressed. Blobs are problematic, pdf's are problematic, rewriting the register map but not using the zephyr macros for describing masks and manipulating fields seems like a step backwards. Using the existing trigger API requiring a thread or work queue also feels like a step backwards, but that's not on you.
Is the code under the imu directory here something from a TDK software devkit? If so it might be worth considering looking at how ST packages and uses stmemsc for ST sensor drivers. It does not need to live or be managed then by Zephyr but can be managed entirely but TDK in something like a hal_tdk git repository.
.../invn.algo.sw-integration.aml-42670s-gcc-arm-none-eabi-cm4-fpu-1.6.0/include/invn_algo_aml.h
Outdated
Show resolved
Hide resolved
.../invn.algo.sw-integration.aml-42670s-gcc-arm-none-eabi-cm4-fpu-1.6.0/include/invn_algo_aml.h
Outdated
Show resolved
Hide resolved
e45513b
to
30399c8
Compare
Thanks for the PR! Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. |
Hi @teburd, @carlescufi, thank you very much for your review! You point many subjects to address, Find my answers below:
|
e3c9a40
to
61896e5
Compare
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.
any DT binding property with a default value needs justification of the default value in the description https://docs.zephyrproject.org/latest/build/dts/bindings-upstream.html
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.
I updated the DT bindings with default description as required.
61896e5
to
a65d60c
Compare
|
||
power-mode: | ||
type: string | ||
default: "low noise" |
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.
missing justification
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.
Thanks for the comment. I added the default value justification for this property also.
a65d60c
to
ed01c24
Compare
I opened an issue to create the tdk_hal repository #71561 |
Sensor WG 04/22/2024 Asked the question around pros/cons of using sensor vendor supplied HALs: Pros:
Questions Posed (Potential Cons):
|
Hi @teburd , |
No blocking issues from me no, I expect the TSC will likely approve hal_tdk barring any major concerns, and then this can go in with the tdk hal code removed. I'd expect some more progress in a week or so as the TSC meets weekly, and our sensor maintainer (Maureen Helm at Analog) is traveling this week |
6a42d21
to
357036d
Compare
HI @MaureenHelm, |
https://github.com/tdk-invn-oss/zephyr.hal_tdk Signed-off-by: Aurelie Fontaine <aurelie.fontaine@tdk.com>
Prepare to use official TDK Invensense Inc. driver for icm42670-P/-S sensor in tdk_hal module. Simplify I2C and SPI transport files. Driver code moves in hal_tdk module. Adds APEX features, such as Pedometer, Tilt detection, Wake on Motion and Significant Motion Detector. Signed-off-by: Aurelie Fontaine <aurelie.fontaine@tdk.com>
Add the power mode, accel and gyro filtering options, and apex features. Add -p and -s compatible. Signed-off-by: Aurelie Fontaine <aurelie.fontaine@tdk.com>
It reports IMU 6-axis accelerometer and gyroscope data using DRDY interrupt. Signed-off-by: Aurelie Fontaine <aurelie.fontaine@tdk.com>
It reports Advanced Pedometer and Event Detection features, such as Pedometer, Tilt detection, Wake on Motion and Significant Motion Detector. Device tree options. Signed-off-by: Aurelie Fontaine <aurelie.fontaine@tdk.com>
Update i2c and spi dtsi test to comply with new compatible icm42670p. Signed-off-by: Aurelie Fontaine <aurelie.fontaine@tdk.com>
357036d
to
5a1c846
Compare
Hello @MaureenHelm , Thanks for the approval, we're happy to achieve this step! |
HI @MaureenHelm , |
Thank you for your patience @afontaine-invn @sriccardi-invn and team, and sorry this took so long. This will go in with the next merge batch in just a couple hours. |
Hi @afontaine-invn! To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge. Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁 |
Every build now prints:
|
Created #83151 to get rid of the warning. |
dts: supports icm42670-P/-S
samples: sensor: tdk_apex: TDK APEX generic sample
samples: sensor: 6DOF motion DRDY generic sample
module: HAL TDK module
Adds official TDK Invensense Inc. driver in TDK HAL module for icm42670-P/-S sensor.
Adds SPI and I2C interface support.
Adds APEX features, such as Pedometer, Tilt detection, Wake on Motion
and Significant Motion Detector.
Add generic samples supporting this driver.
Integration module test successful with https://github.com/tdk-invn-oss/zephyr.hal_tdk
Validated with custom setup: nrf52dk_nrf52832 + icm42670-P/-S EVB board
Build ok by running:
west twister -T samples\sensor\tdk_apex-T samples\sensor\6dof_motion_drdy -p nrf52dk/nrf52832
Signed-off-by: Aurelie Fontaine aurelie.fontaine@tdk.com