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

nRF Connect SDK Tutorial - Part 3 | NCS v1.3.0 --> 1.2 Walkthrough for BME280 - gives compilation error

I am trying to repeat the example in the tutorial: using board: nrf9160dk_nrf9160.

nRF Connect SDK Tutorial - Part 3 | NCS v1.3.0 --> 1.2 Walkthrough for BME280 -  but gives compilation error

2> ../src/main.c:17:2: error: #error Your devicetree has no enabled nodes with compatible "bosch,bme280"

I couldn't figure out and can you help on how to resove this.

Thanks

Chandra

  • Hi,

     

     

    nrf9160dk_nrf9160.

     When configuring the project, did you select the board that corresponds to your overlay file?

    If the board is "nrf9160dk_nrf9160" then the overlay should be samples/my-app/nrf9160dk_nrf9160.overlay and contain the corresponding overlay settings for the sensor you're using.

     

    Could you please share your overlay file and which board you're configuring the project for, if it still doesn't work?

     

    Note: its normal to use the board nrf9160dk_nrf9160ns, as the modem can only communicate with an application in the non-secure region.

     

    Kind regards,

    Håkon

  • While choosing nRF Connect options --> Board Directory , I couldn't find find  nrf9160dk_nrf9160ns in  <SourcePath>/ncs/v1.3.0/zephyr/boards/arm. I could see only nrf9160dk_nrf9160.

    Can you help on how to choose nrf9160dk_nrf9160ns.

    Thanks

    Chandra

  • You select the board "nrf9160dk_nrf9160" in zephyr/boards/arm, then it should give you a choice on variant under "Board name":

     

    Kind regards,

    Håkon

  • Thanks i could select nrf9160dk_nrf9160ns.

    nrf9160dk_nrf9160ns.overlay:  content

    &i2c1 {
        compatible = "nordic,nrf-twim";
        status = "okay";
        sda-pin = < 30 >;
        scl-pin = < 31 >;
        clock-frequency = <I2C_BITRATE_STANDARD>;  
        
        /* The I2C address could be one of two, here 0x76 is assumed */
        bme280@76 {
            compatible = "bosch,bme280";
            reg = <0x76>;
            label = "BME280";
        };
    };

    But I am getting following assertion, at  the end of compilation:

    static assertion failed: "Only one of the following peripherals can be enabled: SPI1, SPIM1, SPIS1, TWI1, TWIM1, TWIS1, UARTE1. Check nodes with status \"okay\" in zephyr.dts."

    below is the content of  zephyr.dts specific to i2c:

                i2c1: i2c@9000 {
                    #address-cells = < 0x1 >;
                    #size-cells = < 0x0 >;
                    reg = < 0x9000 0x1000 >;
                    clock-frequency = < 0x186a0 >;
                    interrupts = < 0x9 0x1 >;
                    status = "okay";
                    label = "I2C_1";
                    compatible = "nordic,nrf-twim";
                    sda-pin = < 0x1e >;
                    scl-pin = < 0x1f >;
                    bme280@76 {
                        compatible = "bosch,bme280";
                        reg = < 0x76 >;
                        label = "BME280";
                    };
                };

  • Hi,

     

    It seems that you have found an issue in our blog! my apologies, I'll report this to the owner of the post.

    The issue can be resolved by disabling uart1 in your overlay:

    &uart1 {status = "disabled";};

     

    Could you try adding this and see if it compiles properly now (remember to re-import your project!) ?

     

    Kind regards,

    Håkon

Related