Skip to content

Does not work with builtin IMU on Nano 33 IoT #10

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

Open
Chedski opened this issue Aug 13, 2023 · 3 comments · May be fixed by #40
Open

Does not work with builtin IMU on Nano 33 IoT #10

Chedski opened this issue Aug 13, 2023 · 3 comments · May be fixed by #40

Comments

@Chedski
Copy link

Chedski commented Aug 13, 2023

FastIMU does not work with the builtin IMU of the Nano 33 IoT because the "who am i" value of the LSM6DS3 on the 33 is (or can be?) 0x6C instead of 0x69.

@LiquidCGS
Copy link
Owner

LiquidCGS commented Aug 13, 2023

That would actually point to that IMU not being an LSM6DS3 and being an LSM6DSO instead.
https://www.st.com/resource/en/datasheet/lsm6dso.pdf (see 9.11 on page 49)
Seeing as it's register map is pretty similar to the LSM6DS3's you might be able to modify F_LSM6DS3.hpp's line 53 to 0x6C and have it work
I'll look into adding support for it if I can get my hands on one of them.

@quicksketch
Copy link
Contributor

@LiquidCGS Thank you for the helpful tip. I have a LSM6DSO in a custom board and I confirmed that the LSM6DS3 driver works well for the accelerometer. The only line that needed changing was this:

#define LSM6DS3_WHOAMI_DEFAULT_VALUE	0x69

I changed it to this:

#define LSM6DS3_WHOAMI_DEFAULT_VALUE	0x6C

And then declared that as my IMU class via LSM6DS3 IMU; and it worked great with the LSM6DSO accelerometer.

@quicksketch
Copy link
Contributor

I confirmed this value from the official Arduino_LSM6DSOX library. Check this line in their source code file:

https://github.com/arduino-libraries/Arduino_LSM6DSOX/blob/0586b99357d41ee5c33b5a68e3d9affb9e10920f/src/LSM6DSOX.cpp#L82C48-L82C52

Here's the line copied for convenience:

  if (!(readRegister(LSM6DSOX_WHO_AM_I_REG) == 0x6C || readRegister(LSM6DSOX_WHO_AM_I_REG) == 0x69)) {

Interestingly they have the conditional that allows either of these addresses. It may be that they interchange the LSM6DS3 and LSM6DSO on their boards and they are hardware-compatible.

quicksketch added a commit to quicksketch/FastIMU that referenced this issue Jan 12, 2025
quicksketch added a commit to quicksketch/FastIMU that referenced this issue Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants