NRF5340 I2C Pins

Hi everyone I am currently trying to connect some simple sensors using the I2C interface.

Currently I am working with an nRF5340 and nRFC 1.6.1 SDK

I loaded one of the samples using the FXAS21002 module.

Everything works fine on i2c1 when using the dedicated pins i.e.P1.02 <34> and P1.05 <35>.

For testing I tried using some other pins let's say P1.14 <46> and P1.15 <47> and this is the overlay I am using

&i2c1 {
    compatible = "nordic,nrf-twim";
	status = "okay";

	scl-pin = <46>; //p1.14
	sda-pin = <47>; //p1.15

	// sda-pin = <35>;
	// scl-pin = <34>;

    clock-frequency = <I2C_BITRATE_STANDARD>;  
	
	
	fxas21002@21 {
		compatible = "nxp,fxas21002";
		status = "okay";
		reg = <0x21>;
		label = "FXAS21002";
		
	};
};

and for the project file

CONFIG_STDOUT_CONSOLE=y
CONFIG_LOG=y
CONFIG_I2C=y
#CONFIG_NRFX_TWIM1=y
CONFIG_SENSOR=y
CONFIG_FXAS21002=y
CONFIG_SENSOR_LOG_LEVEL_DBG=y
#CONFIG_FXAS21002_TRIGGER_OWN_THREAD=y
CONFIG_CBPRINTF_FP_SUPPORT=y

CONFIG_I2C_NRFX=y

Is it generally possible to use other gpios for I2C? Reading around the answered question it certainly seems that way.

When I use the default pins from the sample everything works fine, also tried a BME280 sensor, no issues at all.

According to other answers the overlay should do the trick to change/declare the proper pins to be used.

AM I missing something in the settings?

Related