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

nrf9160 I2C master not working

Hi,

I have a working project and want to use I2C 2 instead of UART 2. I have changed the .dts file:

/*
&uart2 {
    status = "okay";
        current-speed = <115200>;
    tx-pin = <29>;
    rx-pin = <30>;
};
*/


&i2c2 {        
    compatible = "nordic,nrf-twim";
    status = "okay";            
    scl-pin = <29>;
    sda-pin = <30>;    
};

And I have added the following rows to the prj.conf file:

#Configure I2C
CONFIG_I2C=y
CONFIG_I2C_NRFX=y
CONFIG_I2C_2=y

When I try to open the project I get however an error:

I am using nRF SDK v1.5.0

Please help! I have no idea what is getting wrong after this small change!

Parents
  • In general, .dts files are used to describe the default hardware and its peripherals. Overlay files can then be used to modify the default settings of the peripherals.

    If you have not added an i2c peripheral to the devicetree of your board yet, then this should of course be done in the .dts file. However, UART2 (which I understood is enabled by default) should then be disabled via an overlay file.

    Have you performed a “Run CMake” in SES after modifying the .dts file?

    Regards,

    Markus

Reply
  • In general, .dts files are used to describe the default hardware and its peripherals. Overlay files can then be used to modify the default settings of the peripherals.

    If you have not added an i2c peripheral to the devicetree of your board yet, then this should of course be done in the .dts file. However, UART2 (which I understood is enabled by default) should then be disabled via an overlay file.

    Have you performed a “Run CMake” in SES after modifying the .dts file?

    Regards,

    Markus

Children
No Data
Related