Issue with Implementing BME680 with nRF5340DK Using I2C Protocol

Hi,

I am working on implementing the BME680 sensor with the nRF5340DK using the I2C protocol. I have successfully obtained the slave device address and the sensor address.

However, I am facing an issue when trying to read data from the sensor; I am unable to fetch any data. I need support to troubleshoot this problem and ensure proper data reading from the BME680 sensor.

Output:

Thank you

  • Hi,

    The error that you get is complaining about the qspi_nor device and not the BME680 sensor over I2C. What changes did you do to your board files (.dts and .overlay)? Which GPIOs are the I2C device using?

    Kind regards,
    Andreas

  • Hi,

    i2c3 {
        status = "okay";
        pinctrl-0 = <&i2c3_default>;
        pinctrl-1 = <&i2c3_sleep>;
        pinctrl-names = "default", "sleep";
        bme680:bme680@76 {
            compatible = "i2c-device";
            reg = <0x76>;
        };
     
    i2c3_default: i2c3_default {
            group1 {
                psels = <NRF_PSEL(TWIM_SCL, 1, 3)>,
                 <NRF_PSEL(TWIM_SDA, 1, 2)>;
            };
    These are the pin config for I2C.
    &qspi {
        status = "okay";
        pinctrl-0 = <&qspi_default>;
        pinctrl-1 = <&qspi_sleep>;
        pinctrl-names = "default", "sleep";
        w25q32: w25q32@0 {
            compatible = "nordic,qspi-nor";
            reg = <0>;
            /* MX25R64 supports only pp and pp4io */
            //writeoc = "pp4io";
            /* MX25R64 supports all readoc options */
            //readoc = "read4io";
            sck-frequency = <10000000>;
            jedec-id = [ef 40 16];
            //sfdp-bfp = [];
            size = <0x2000000>;
            has-dpd;
            t-enter-dpd = <3000>;
            t-exit-dpd = <30000>;
            writeoc = "pp";
            readoc = "fastread";
        };
    };
     
        qspi_default: qspi_default {
            group1 {
                psels = <NRF_PSEL(QSPI_SCK, 0, 27)>,
                        <NRF_PSEL(QSPI_IO0, 1, 5)>,
                        <NRF_PSEL(QSPI_IO1, 1, 6)>,
                        <NRF_PSEL(QSPI_IO2, 0, 21)>,
                        <NRF_PSEL(QSPI_IO3, 0, 26)>,
                        <NRF_PSEL(QSPI_CSN, 0, 24)>;
                nordic,drive-mode = <NRF_DRIVE_H0H1>;
            };

        };
    These are the pin details Qspi.
     
    Can you explain me the problem in this?
    Thank you.
  • HI,

    After that in the next, I can get the message like Failed to read Register D0, cross checked the register value in the datasheet is same.

    Thank you

  • Hi again,

    You say that you use the nrf5340dk, which has the mx25 external flash. Why have you set up the qspi external flash to use the w25q? Is this a custom board and not a DK? Here's the qspi configuration for the nRF5340DK https://github.com/nrfconnect/sdk-zephyr/blob/83c5c72f4ca9402ad70fd33e471f3fa8a9536614/boards/nordic/nrf5340dk/nrf5340_cpuapp_common.dtsi#L112 

    Kind regards,
    Andreas

  • Hi,

    Yes, I am having a Custom board, Agora_BT40 which is having the nRF5340dk mcu.

    Is that the issue from the qspi?why it is affecting in BME680?

    Thank you

Related