This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

connect sdk twi startup problems

I have connected a BM680 sensor on a BL654 (NRF52840) via I2C. I have connected the power to the BME680 on a switchable power rail. I need to power this rail with a GPIO pin on the NRF52. Also the I2C pins are connected to a GPIO pin of the NRF52840 to save power in sleep conditions. I have the following output in Zephyr.

I get an error the first boot cycle and I suspect the I2C is loaded before the power is applied to the sensor and the I2C pullup resistors. Because when I reload the code with a debugger the device works immediatly because the power and pull-ups are connected at startup. I have looked around but I can not find a way to set a gpio pin before the startup of the I2C. Is there a way to solve this issue?

*** Booting Zephyr OS build v2.4.0-ncs2  ***
[00:00:00.915,863] <err> i2c_nrfx_twi: Error on I2C line occurred for message 0
Hello! I'm running Zephyr v1 2.4.0 on nrf52840dk_nrf52840, a arm board.

*** Booting Zephyr OS build v2.4.0-ncs2  ***
Hello! I'm running Zephyr v1 2.4.0 on nrf52840dk_nrf52840, a arm board.

Found device "BME680"
Device 0x2000015c name is BME680
T: 17.250000; P: 100.274000; H: 61.923000; G: 88975.000000
T: 17.230000; P: 100.278000; H: 61.952000; G: 178953.000000
T: 17.260000; P: 100.276000; H: 61.890000; G: 217160.000000
T: 17.270000; P: 100.276000; H: 61.838000; G: 235988.000000

Parents Reply Children
No Data
Related