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

LSM6DSO: Self test code working? Ever tried out? #145

Closed
capiman opened this issue Oct 8, 2021 · 1 comment
Closed

LSM6DSO: Self test code working? Ever tried out? #145

capiman opened this issue Oct 8, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@capiman
Copy link

capiman commented Oct 8, 2021

Was the code in

https://github.com/STMicroelectronics/STMems_Standard_C_drivers/blob/master/lsm6dso32_STdC/examples/lsm6dso32_self_test.c

ever tried out? Shall it be working? Code (especially the following lines) seems to be at least 3 years old, so long time not working?

Just found 2 bugs:

https://github.com/STMicroelectronics/STMems_Standard_C_drivers/blame/master/lsm6dso32_STdC/examples/lsm6dso32_self_test.c#L281

https://github.com/STMicroelectronics/STMems_Standard_C_drivers/blame/master/lsm6dso32_STdC/examples/lsm6dso32_self_test.c#L308

Both time

lsm6dso32_xl_flag_data_ready_get(&dev_ctx, &drdy);

instead of

lsm6dso32_gy_flag_data_ready_get(&dev_ctx, &drdy);

Or both equivalent? Or xl correct and only not working on my side?
At least on my side it was not working with xl. I was looking for hours,
till I saw the error. After changing to gy at the 2 places it was working immediately...

For completeness:

STATUS_REG (0x1E) see page 64 in datasheet DS12140 - Rev 2

GDA (Bit 1)
Gyroscope new data available. Default value: 0
(0: no set of data available at gyroscope output;
1: a new set of data is available at gyroscope output)

XLDA (Bit 0)
Accelerometer new data available. Default value: 0
(0: no set of data available at accelerometer output;
1: a new set of data is available at accelerometer output)

@capiman capiman added the bug Something isn't working label Oct 8, 2021
@capiman capiman changed the title LSM6DSO: Self test code working? LSM6DSO: Self test code working? Every tried out? Oct 8, 2021
@capiman capiman changed the title LSM6DSO: Self test code working? Every tried out? LSM6DSO: Self test code working? Ever tried out? Oct 8, 2021
@avisconti
Copy link
Contributor

Was the code in

https://github.com/STMicroelectronics/STMems_Standard_C_drivers/blob/master/lsm6dso32_STdC/examples/lsm6dso32_self_test.c

ever tried out? Shall it be working? Code (especially the following lines) seems to be at least 3 years old, so long time not working?

Just found 2 bugs:

https://github.com/STMicroelectronics/STMems_Standard_C_drivers/blame/master/lsm6dso32_STdC/examples/lsm6dso32_self_test.c#L281

https://github.com/STMicroelectronics/STMems_Standard_C_drivers/blame/master/lsm6dso32_STdC/examples/lsm6dso32_self_test.c#L308

Both time

lsm6dso32_xl_flag_data_ready_get(&dev_ctx, &drdy);

instead of

lsm6dso32_gy_flag_data_ready_get(&dev_ctx, &drdy);

Or both equivalent? Or xl correct and only not working on my side? At least on my side it was not working with xl. I was looking for hours, till I saw the error. After changing to gy at the 2 places it was working immediately...

They are not equivalent, xl is for accel and gy is for gyroscope. All of this are typos introduced with copy/paiste from the xl case to gy case. I'm sorry for this errors. I took the ownership of the STdC drivers only recently, and I guess that this example was tested for xl code only. After gy was added probably it was not retested.

I provide the patch for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants