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

Endless loop in bme68x_set_op_mode #18

Open
emArts-IoT opened this issue Dec 29, 2022 · 2 comments
Open

Endless loop in bme68x_set_op_mode #18

emArts-IoT opened this issue Dec 29, 2022 · 2 comments

Comments

@emArts-IoT
Copy link

When the device cannot be set to sleep mode (for whatever reason) the function never returns.

do
{
} while ((pow_mode != BME68X_SLEEP_MODE) && (rslt == BME68X_OK));

@kgoveas
Copy link

kgoveas commented Jan 2, 2023

@emArts-IoT , can you provide more details about the issue you are facing and the steps to reproduce it. In case the write functions are not working as expected, the code can get stuck in an endless loop.

@marsfan
Copy link

marsfan commented Dec 17, 2023

I know this is an older issue, but I ran into the same issue, and wanted to explain how I fixed it.

In my case, the write function was not to blame. It seemed to be that the read function is trying to read from register 0xF4 instead of 0x74, which has one bit different. After digging through the library a bit, this seems to be related to the SPI bus paging, but I am using I2C. I realized that I forgot to set the data device data structure to use the I2C interface instead of the SPI one. @emArts-IoT You might want to double check that you did not make the same mistake that I did.

@kgoveas It might be useful for the library to have a limit for the number of retries, and once it reaches that it outputs an error, so that the system does not get stuck in an endless loop in the library, which can be a little bit harder to trace down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants