This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

case about driver BMA280

Hi,

1. Please provide me with an example of BMA280

2. The SDK: replication v1.7.1

3.IC:nRF9160

4. I tried to change the BME280 driver to BMA280 driver, but the following error was reported:

'DT_N_INST_0_bosch_bma280_REG_IDX_0_VAL_ADDRESS' undeclared (first use in this function); did you mean 'DT_N_S_cpus_S_cpu_0_REG_IDX_0_VAL_ADDRESS'?

Please tell me why this mistake happened.

board path:D:\ncs\v1.7.1\peter\bma280_1\boards\arm\nrf9160dk_nrf9160

code:

bma280_1.rar

Thank you for all your assistance.
Kind regards,
Peter.Min

  • Hi,

     

    You need to apply the .overlay file, which also seems to lack the "int1-gpio" definition. I just choose one gpio (P0.27 in this case), which you can freely change to one you have available.

    If using "nrf9160dk_nrf9160" as the board, you should name this file "nrf9160dk_nrf9160.overlay":

    /*
     * Copyright (c) 2020, Nordic Semiconductor ASA
     *
     * SPDX-License-Identifier: Apache-2.0
     */
    
    /*
     * Example configuration of a BME280 device on an Arduino I2C bus.
     *
     * Device address 0x77 is assumed. Your device may have a different
     * address; check your device documentation if unsure.
     */
    &arduino_i2c {
    	status = "okay";
    	bma280@77 {
    		compatible = "bosch,bma280";
    		reg = <0x77>;
    		int1-gpios = <&gpio0 27 0>;
    		label = "BMA280_I2C";
    	};
    };

     

    Then the build file will pick up on the sensor and should compile your project without any errors.

     

    Kind regards,

    Håkon

Related