i2c_write_dt gives me -EIO

Hi,

I followed the tutorial in the DevAcademy nRF Connect SDK Fundamentals where we try to establish an I2C communication. I managed to compile it, but the i2c_write_dt functions gives me an -EIO (general input / output error). Even the logic analyser on pins P0.31 and P0.30 gives some strange pulses. I have seen on some sites that you have to configure the i2s, but I have not found on how to do that in Nordic's examples or in the nRF Connect SDK Fundamentals course. There are some examples on the websites, but there either deprived macro functions are used or they do not work for this board. 

Could some give me some ideas why is not working? 

Code:

  • main.c

/*
 * Copyright (c) 2016 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 * 
 * Note: Tested on nRF52833 DK
 */

#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
/* STEP 3 - Include the header file of the I2C API */
#include <zephyr/drivers/i2c.h>
/* STEP 4.1 - Include the header file of printk() */
#include <zephyr/sys/printk.h>
/* 1000 msec = 1 sec */
#define SLEEP_TIME_MS   1000

/* STEP 8 - Define the I2C slave device address and the addresses of relevant registers */
#define STTS751_TEMP_HIGH_REG            0x00
#define STTS751_TEMP_LOW_REG             0x02
#define STTS751_CONFIG_REG               0x03

/* STEP 6 - Get the node identifier of the sensor */
#define I2C2_NODE DT_NODELABEL(mysensor)

void main(void)
{

	int ret;

/* STEP 7 - Retrieve the API-specific device structure and make sure that the device is ready to use  */
	static const struct i2c_dt_spec dev_i2c = I2C_DT_SPEC_GET(I2C2_NODE);
	if (!device_is_ready(dev_i2c.bus)) {
		printk("I2C bus %s is not ready!\n\r",dev_i2c.bus->name);
		return;
	}

/* STEP 9 - Setup the sensor by writing the value 0x8C to the Configuration register */
	uint8_t config[2] = {STTS751_CONFIG_REG,0x8C};
	ret = i2c_write_dt(&dev_i2c, config, sizeof(config));
	if(ret != 0){
		printk("Failed to write to I2C device address %x at Reg. %x \n", dev_i2c.addr,config[0]);
		return;
	}

	while (1) {
/* STEP 10 - Read the temperature from the sensor */
		uint8_t temp_reading[2]= {0};
		uint8_t sensor_regs[2] ={STTS751_TEMP_LOW_REG,STTS751_TEMP_HIGH_REG};
		ret = i2c_write_read_dt(&dev_i2c,&sensor_regs[0],1,&temp_reading[0],1);
		if(ret != 0){
			printk("Failed to write/read I2C device address %x at Reg. %x \r\n", dev_i2c.addr,sensor_regs[0]);
		}
		ret = i2c_write_read_dt(&dev_i2c,&sensor_regs[1],1,&temp_reading[1],1);
		if(ret != 0){
			printk("Failed to write/read I2C device address %x at Reg. %x \r\n", dev_i2c.addr,sensor_regs[1]);
		}

/* STEP 11 - Convert the two bytes to a 12-bits */
		int temp = ((int)temp_reading[1] * 256 + ((int)temp_reading[0] & 0xF0)) / 16;
		if(temp > 2047)
		{
			temp -= 4096;
		}

		// Convert to engineering units 
		double cTemp = temp * 0.0625;
		double fTemp = cTemp * 1.8 + 32;

		//Print reading to console  
		printk("Temperature in Celsius : %.2f C \n", cTemp);
		printk("Temperature in Fahrenheit : %.2f F \n", fTemp);
		k_msleep(SLEEP_TIME_MS);
	}
}

  • nrf9160dk_nrf9160_ns.overlay

&i2c2 {
    
    mysensor: mysensor@4a{
        compatible = "i2c-device";
        status = "okay";
        reg = < 0x4a >;
        label = "MYSENSOR";
    };
};

  • prj.conf

CONFIG_GPIO=y
CONFIG_I2C=y
CONFIG_CBPRINTF_FP_SUPPORT=y

  • zephyr.dts

/dts-v1/;

/ {
	#address-cells = < 0x1 >;
	#size-cells = < 0x1 >;
	model = "Nordic nRF9160 DK NRF9160";
	compatible = "nordic,nrf9160-dk-nrf9160";
	chosen {
		zephyr,entropy = &cryptocell;
		zephyr,flash-controller = &flash_controller;
		zephyr,console = &uart0;
		zephyr,shell-uart = &uart0;
		zephyr,uart-mcumgr = &uart0;
		zephyr,sram = &sram0_s;
		zephyr,flash = &flash0;
		zephyr,code-partition = &slot0_partition;
		zephyr,sram-secure-partition = &sram0_s;
		zephyr,sram-non-secure-partition = &sram0_ns;
	};
	aliases {
		led0 = &led0;
		led1 = &led1;
		led2 = &led2;
		led3 = &led3;
		pwm-led0 = &pwm_led0;
		sw0 = &button0;
		sw1 = &button1;
		sw2 = &button2;
		sw3 = &button3;
		bootloader-led0 = &led0;
		mcuboot-button0 = &button0;
		mcuboot-led0 = &led0;
		watchdog0 = &wdt0;
	};
	soc {
		#address-cells = < 0x1 >;
		#size-cells = < 0x1 >;
		compatible = "nordic,nRF9160-SICA", "nordic,nRF9160", "nordic,nRF91", "simple-bus";
		interrupt-parent = < &nvic >;
		ranges;
		nvic: interrupt-controller@e000e100 {
			#address-cells = < 0x1 >;
			compatible = "arm,v8m-nvic";
			reg = < 0xe000e100 0xc00 >;
			interrupt-controller;
			#interrupt-cells = < 0x2 >;
			arm,num-irq-priority-bits = < 0x3 >;
			phandle = < 0x1 >;
		};
		systick: timer@e000e010 {
			compatible = "arm,armv8m-systick";
			reg = < 0xe000e010 0x10 >;
			status = "disabled";
		};
		sram0: memory@20000000 {
			compatible = "mmio-sram";
			reg = < 0x20000000 0x40000 >;
		};
		peripheral@50000000 {
			#address-cells = < 0x1 >;
			#size-cells = < 0x1 >;
			ranges = < 0x0 0x50000000 0x10000000 >;
			flash_controller: flash-controller@39000 {
				compatible = "nordic,nrf91-flash-controller";
				reg = < 0x39000 0x1000 >;
				partial-erase;
				#address-cells = < 0x1 >;
				#size-cells = < 0x1 >;
				flash0: flash@0 {
					compatible = "soc-nv-flash";
					erase-block-size = < 0x1000 >;
					write-block-size = < 0x4 >;
					reg = < 0x0 0x100000 >;
					partitions {
						compatible = "fixed-partitions";
						#address-cells = < 0x1 >;
						#size-cells = < 0x1 >;
						boot_partition: partition@0 {
							label = "mcuboot";
							reg = < 0x0 0x10000 >;
						};
						slot0_partition: partition@10000 {
							label = "image-0";
							reg = < 0x10000 0x40000 >;
						};
						slot0_ns_partition: partition@50000 {
							label = "image-0-nonsecure";
							reg = < 0x50000 0x30000 >;
						};
						slot1_partition: partition@80000 {
							label = "image-1";
							reg = < 0x80000 0x40000 >;
						};
						slot1_ns_partition: partition@c0000 {
							label = "image-1-nonsecure";
							reg = < 0xc0000 0x30000 >;
						};
						scratch_partition: partition@f0000 {
							label = "image-scratch";
							reg = < 0xf0000 0xa000 >;
						};
						storage_partition: partition@fa000 {
							label = "storage";
							reg = < 0xfa000 0x6000 >;
						};
					};
				};
			};
			adc: adc@e000 {
				compatible = "nordic,nrf-saadc";
				reg = < 0xe000 0x1000 >;
				interrupts = < 0xe 0x1 >;
				status = "okay";
				#io-channel-cells = < 0x1 >;
				phandle = < 0x12 >;
			};
			dppic: dppic@17000 {
				compatible = "nordic,nrf-dppic";
				reg = < 0x17000 0x1000 >;
				status = "okay";
			};
			egu0: egu@1b000 {
				compatible = "nordic,nrf-egu";
				reg = < 0x1b000 0x1000 >;
				interrupts = < 0x1b 0x1 >;
				status = "okay";
			};
			egu1: egu@1c000 {
				compatible = "nordic,nrf-egu";
				reg = < 0x1c000 0x1000 >;
				interrupts = < 0x1c 0x1 >;
				status = "okay";
			};
			egu2: egu@1d000 {
				compatible = "nordic,nrf-egu";
				reg = < 0x1d000 0x1000 >;
				interrupts = < 0x1d 0x1 >;
				status = "okay";
			};
			egu3: egu@1e000 {
				compatible = "nordic,nrf-egu";
				reg = < 0x1e000 0x1000 >;
				interrupts = < 0x1e 0x1 >;
				status = "okay";
			};
			egu4: egu@1f000 {
				compatible = "nordic,nrf-egu";
				reg = < 0x1f000 0x1000 >;
				interrupts = < 0x1f 0x1 >;
				status = "okay";
			};
			egu5: egu@20000 {
				compatible = "nordic,nrf-egu";
				reg = < 0x20000 0x1000 >;
				interrupts = < 0x20 0x1 >;
				status = "okay";
			};
			ipc: ipc@2a000 {
				compatible = "nordic,nrf-ipc";
				reg = < 0x2a000 0x1000 >;
				interrupts = < 0x2a 0x1 >;
				status = "okay";
			};
			i2s0: i2s@28000 {
				compatible = "nordic,nrf-i2s";
				#address-cells = < 0x1 >;
				#size-cells = < 0x0 >;
				reg = < 0x28000 0x1000 >;
				interrupts = < 0x28 0x1 >;
				status = "disabled";
			};
			kmu: kmu@39000 {
				compatible = "nordic,nrf-kmu";
				reg = < 0x39000 0x1000 >;
				interrupts = < 0x39 0x1 >;
				status = "okay";
			};
			pdm0: pdm@26000 {
				compatible = "nordic,nrf-pdm";
				reg = < 0x26000 0x1000 >;
				interrupts = < 0x26 0x1 >;
				status = "disabled";
			};
			regulators: regulator@4000 {
				compatible = "nordic,nrf-regulators";
				reg = < 0x4000 0x1000 >;
				status = "okay";
			};
			vmc: vmc@3a000 {
				compatible = "nordic,nrf-vmc";
				reg = < 0x3a000 0x1000 >;
				status = "okay";
			};
			uart0: uart@8000 {
				compatible = "nordic,nrf-uarte";
				reg = < 0x8000 0x1000 >;
				interrupts = < 0x8 0x1 >;
				status = "okay";
				current-speed = < 0x1c200 >;
				pinctrl-0 = < &uart0_default >;
				pinctrl-1 = < &uart0_sleep >;
				pinctrl-names = "default", "sleep";
			};
			uart1: arduino_serial: uart@9000 {
				compatible = "nordic,nrf-uarte";
				reg = < 0x9000 0x1000 >;
				interrupts = < 0x9 0x1 >;
				status = "okay";
				current-speed = < 0x1c200 >;
				pinctrl-0 = < &uart1_default >;
				pinctrl-1 = < &uart1_sleep >;
				pinctrl-names = "default", "sleep";
			};
			uart2: uart@a000 {
				compatible = "nordic,nrf-uarte";
				reg = < 0xa000 0x1000 >;
				interrupts = < 0xa 0x1 >;
				status = "disabled";
				pinctrl-0 = < &uart2_default >;
				pinctrl-1 = < &uart2_sleep >;
				pinctrl-names = "default", "sleep";
			};
			uart3: uart@b000 {
				compatible = "nordic,nrf-uarte";
				reg = < 0xb000 0x1000 >;
				interrupts = < 0xb 0x1 >;
				status = "disabled";
			};
			i2c0: i2c@8000 {
				compatible = "nordic,nrf-twim";
				#address-cells = < 0x1 >;
				#size-cells = < 0x0 >;
				reg = < 0x8000 0x1000 >;
				clock-frequency = < 0x186a0 >;
				interrupts = < 0x8 0x1 >;
				status = "disabled";
			};
			i2c1: i2c@9000 {
				compatible = "nordic,nrf-twim";
				#address-cells = < 0x1 >;
				#size-cells = < 0x0 >;
				reg = < 0x9000 0x1000 >;
				clock-frequency = < 0x186a0 >;
				interrupts = < 0x9 0x1 >;
				status = "disabled";
			};
			i2c2: arduino_i2c: i2c@a000 {
				compatible = "nordic,nrf-twim";
				#address-cells = < 0x1 >;
				#size-cells = < 0x0 >;
				reg = < 0xa000 0x1000 >;
				clock-frequency = < 0x186a0 >;
				interrupts = < 0xa 0x1 >;
				status = "okay";
				pinctrl-0 = < &i2c2_default >;
				pinctrl-1 = < &i2c2_sleep >;
				pinctrl-names = "default", "sleep";
				mysensor: mysensor@4a {
					compatible = "i2c-device";
					status = "okay";
					reg = < 0x4a >;
					label = "MYSENSOR";
				};
			};
			i2c3: i2c@b000 {
				compatible = "nordic,nrf-twim";
				#address-cells = < 0x1 >;
				#size-cells = < 0x0 >;
				reg = < 0xb000 0x1000 >;
				clock-frequency = < 0x186a0 >;
				interrupts = < 0xb 0x1 >;
				status = "disabled";
			};
			spi0: spi@8000 {
				compatible = "nordic,nrf-spim";
				#address-cells = < 0x1 >;
				#size-cells = < 0x0 >;
				reg = < 0x8000 0x1000 >;
				interrupts = < 0x8 0x1 >;
				max-frequency = < 0x7a1200 >;
				status = "disabled";
			};
			spi1: spi@9000 {
				compatible = "nordic,nrf-spim";
				#address-cells = < 0x1 >;
				#size-cells = < 0x0 >;
				reg = < 0x9000 0x1000 >;
				interrupts = < 0x9 0x1 >;
				max-frequency = < 0x7a1200 >;
				status = "disabled";
			};
			spi2: spi@a000 {
				compatible = "nordic,nrf-spim";
				#address-cells = < 0x1 >;
				#size-cells = < 0x0 >;
				reg = < 0xa000 0x1000 >;
				interrupts = < 0xa 0x1 >;
				max-frequency = < 0x7a1200 >;
				status = "disabled";
			};
			spi3: arduino_spi: spi@b000 {
				compatible = "nordic,nrf-spim";
				#address-cells = < 0x1 >;
				#size-cells = < 0x0 >;
				reg = < 0xb000 0x1000 >;
				interrupts = < 0xb 0x1 >;
				max-frequency = < 0x7a1200 >;
				status = "okay";
				cs-gpios = < &arduino_header 0x10 0x1 >;
				pinctrl-0 = < &spi3_default >;
				pinctrl-1 = < &spi3_sleep >;
				pinctrl-names = "default", "sleep";
			};
			pwm0: pwm@21000 {
				compatible = "nordic,nrf-pwm";
				reg = < 0x21000 0x1000 >;
				interrupts = < 0x21 0x1 >;
				status = "okay";
				#pwm-cells = < 0x3 >;
				pinctrl-0 = < &pwm0_default >;
				pinctrl-1 = < &pwm0_sleep >;
				pinctrl-names = "default", "sleep";
				phandle = < 0x10 >;
			};
			pwm1: pwm@22000 {
				compatible = "nordic,nrf-pwm";
				reg = < 0x22000 0x1000 >;
				interrupts = < 0x22 0x1 >;
				status = "disabled";
				#pwm-cells = < 0x3 >;
			};
			pwm2: pwm@23000 {
				compatible = "nordic,nrf-pwm";
				reg = < 0x23000 0x1000 >;
				interrupts = < 0x23 0x1 >;
				status = "disabled";
				#pwm-cells = < 0x3 >;
			};
			pwm3: pwm@24000 {
				compatible = "nordic,nrf-pwm";
				reg = < 0x24000 0x1000 >;
				interrupts = < 0x24 0x1 >;
				status = "disabled";
				#pwm-cells = < 0x3 >;
			};
			gpio0: gpio@842500 {
				compatible = "nordic,nrf-gpio";
				gpio-controller;
				reg = < 0x842500 0x300 >;
				#gpio-cells = < 0x2 >;
				status = "okay";
				port = < 0x0 >;
				phandle = < 0xf >;
			};
			rtc0: rtc@14000 {
				compatible = "nordic,nrf-rtc";
				reg = < 0x14000 0x1000 >;
				cc-num = < 0x4 >;
				interrupts = < 0x14 0x1 >;
				status = "okay";
				clock-frequency = < 0x8000 >;
				prescaler = < 0x1 >;
			};
			rtc1: rtc@15000 {
				compatible = "nordic,nrf-rtc";
				reg = < 0x15000 0x1000 >;
				cc-num = < 0x4 >;
				interrupts = < 0x15 0x1 >;
				status = "okay";
				clock-frequency = < 0x8000 >;
				prescaler = < 0x1 >;
			};
			clock: clock@5000 {
				compatible = "nordic,nrf-clock";
				reg = < 0x5000 0x1000 >;
				interrupts = < 0x5 0x1 >;
				status = "okay";
			};
			power: power@5000 {
				compatible = "nordic,nrf-power";
				reg = < 0x5000 0x1000 >;
				interrupts = < 0x5 0x1 >;
				status = "okay";
			};
			wdt: wdt0: watchdog@18000 {
				compatible = "nordic,nrf-wdt";
				reg = < 0x18000 0x1000 >;
				interrupts = < 0x18 0x1 >;
				status = "okay";
			};
			timer0: timer@f000 {
				compatible = "nordic,nrf-timer";
				status = "okay";
				reg = < 0xf000 0x1000 >;
				cc-num = < 0x6 >;
				interrupts = < 0xf 0x1 >;
				prescaler = < 0x0 >;
			};
			timer1: timer@10000 {
				compatible = "nordic,nrf-timer";
				status = "okay";
				reg = < 0x10000 0x1000 >;
				cc-num = < 0x6 >;
				interrupts = < 0x10 0x1 >;
				prescaler = < 0x0 >;
			};
			timer2: timer@11000 {
				compatible = "nordic,nrf-timer";
				status = "okay";
				reg = < 0x11000 0x1000 >;
				cc-num = < 0x6 >;
				interrupts = < 0x11 0x1 >;
				prescaler = < 0x0 >;
			};
		};
		cryptocell: crypto@50840000 {
			compatible = "nordic,nrf-cc310";
			reg = < 0x50840000 0x1000 >;
			status = "okay";
			#address-cells = < 0x1 >;
			#size-cells = < 0x1 >;
			cryptocell310: crypto@50841000 {
				compatible = "arm,cryptocell-310";
				reg = < 0x50841000 0x1000 >;
				interrupts = < 0x40 0x1 >;
			};
		};
		ctrlap: ctrlap@50006000 {
			compatible = "nordic,nrf-ctrlapperi";
			reg = < 0x50006000 0x1000 >;
			status = "okay";
		};
		gpiote: gpiote@5000d000 {
			compatible = "nordic,nrf-gpiote";
			reg = < 0x5000d000 0x1000 >;
			interrupts = < 0xd 0x5 >;
			status = "okay";
		};
		spu: spu@50003000 {
			compatible = "nordic,nrf-spu";
			reg = < 0x50003000 0x1000 >;
			interrupts = < 0x3 0x1 >;
			status = "okay";
		};
		ficr: ficr@ff0000 {
			compatible = "nordic,nrf-ficr";
			reg = < 0xff0000 0x1000 >;
			status = "okay";
		};
		uicr: uicr@ff8000 {
			compatible = "nordic,nrf-uicr";
			reg = < 0xff8000 0x1000 >;
			status = "okay";
		};
	};
	pinctrl: pin-controller {
		compatible = "nordic,nrf-pinctrl";
		uart0_default: uart0_default {
			phandle = < 0x2 >;
			group1 {
				psels = < 0x1d >, < 0x2001b >;
			};
			group2 {
				psels = < 0x1001c >, < 0x3001a >;
				bias-pull-up;
			};
		};
		uart0_sleep: uart0_sleep {
			phandle = < 0x3 >;
			group1 {
				psels = < 0x1d >, < 0x1001c >, < 0x2001b >, < 0x3001a >;
				low-power-enable;
			};
		};
		uart1_default: uart1_default {
			phandle = < 0x4 >;
			group1 {
				psels = < 0x1 >, < 0x2000e >;
			};
			group2 {
				psels = < 0x10000 >, < 0x3000f >;
				bias-pull-up;
			};
		};
		uart1_sleep: uart1_sleep {
			phandle = < 0x5 >;
			group1 {
				psels = < 0x1 >, < 0x10000 >, < 0x2000e >, < 0x3000f >;
				low-power-enable;
			};
		};
		uart2_default: uart2_default {
			phandle = < 0x6 >;
			group1 {
				psels = < 0x18 >, < 0x10017 >;
			};
		};
		uart2_sleep: uart2_sleep {
			phandle = < 0x7 >;
			group1 {
				psels = < 0x18 >, < 0x10017 >;
				low-power-enable;
			};
		};
		i2c2_default: i2c2_default {
			phandle = < 0x8 >;
			group1 {
				psels = < 0xc001e >, < 0xb001f >;
			};
		};
		i2c2_sleep: i2c2_sleep {
			phandle = < 0x9 >;
			group1 {
				psels = < 0xc001e >, < 0xb001f >;
				low-power-enable;
			};
		};
		pwm0_default: pwm0_default {
			phandle = < 0xd >;
			group1 {
				psels = < 0x160002 >;
			};
		};
		pwm0_sleep: pwm0_sleep {
			phandle = < 0xe >;
			group1 {
				psels = < 0x160002 >;
				low-power-enable;
			};
		};
		spi3_default: spi3_default {
			phandle = < 0xb >;
			group1 {
				psels = < 0x4000d >, < 0x6000c >, < 0x5000b >;
			};
		};
		spi3_sleep: spi3_sleep {
			phandle = < 0xc >;
			group1 {
				psels = < 0x4000d >, < 0x6000c >, < 0x5000b >;
				low-power-enable;
			};
		};
	};
	rng_hci: entropy_bt_hci {
		compatible = "zephyr,bt-hci-entropy";
		status = "okay";
	};
	cpus {
		#address-cells = < 0x1 >;
		#size-cells = < 0x0 >;
		cpu@0 {
			device_type = "cpu";
			compatible = "arm,cortex-m33f";
			reg = < 0x0 >;
			#address-cells = < 0x1 >;
			#size-cells = < 0x1 >;
			mpu: mpu@e000ed90 {
				compatible = "arm,armv8m-mpu";
				reg = < 0xe000ed90 0x40 >;
				arm,num-mpu-regions = < 0x10 >;
			};
		};
	};
	leds {
		compatible = "gpio-leds";
		led0: led_0 {
			gpios = < &gpio0 0x2 0x0 >;
			label = "Green LED 1";
		};
		led1: led_1 {
			gpios = < &gpio0 0x3 0x0 >;
			label = "Green LED 2";
		};
		led2: led_2 {
			gpios = < &gpio0 0x4 0x0 >;
			label = "Green LED 3";
		};
		led3: led_3 {
			gpios = < &gpio0 0x5 0x0 >;
			label = "Green LED 4";
		};
	};
	pwmleds {
		compatible = "pwm-leds";
		pwm_led0: pwm_led_0 {
			pwms = < &pwm0 0x0 0x1312d00 0x0 >;
		};
	};
	buttons {
		compatible = "gpio-keys";
		button0: button_0 {
			gpios = < &gpio0 0x6 0x11 >;
			label = "Push button 1";
		};
		button1: button_1 {
			gpios = < &gpio0 0x7 0x11 >;
			label = "Push button 2";
		};
		button2: button_2 {
			gpios = < &gpio0 0x8 0x11 >;
			label = "Switch 1";
		};
		button3: button_3 {
			gpios = < &gpio0 0x9 0x11 >;
			label = "Switch 2";
		};
	};
	interface_to_nrf52840: gpio-interface {
		compatible = "nordic,nrf9160dk-nrf52840-interface";
		#gpio-cells = < 0x2 >;
		gpio-map-mask = < 0xf 0x0 >;
		gpio-map-pass-thru = < 0x0 0xffffffff >;
		gpio-map = < 0x0 0x0 &gpio0 0x11 0x0 >, < 0x1 0x0 &gpio0 0x12 0x0 >, < 0x2 0x0 &gpio0 0x13 0x0 >, < 0x3 0x0 &gpio0 0x15 0x0 >, < 0x4 0x0 &gpio0 0x16 0x0 >, < 0x5 0x0 &gpio0 0x17 0x0 >;
		phandle = < 0x11 >;
	};
	nrf52840_reset: gpio-reset {
		compatible = "nordic,nrf9160dk-nrf52840-reset";
		status = "disabled";
		gpios = < &interface_to_nrf52840 0x5 0x0 >;
	};
	arduino_header: connector {
		compatible = "arduino-header-r3";
		#gpio-cells = < 0x2 >;
		gpio-map-mask = < 0xffffffff 0xffffffc0 >;
		gpio-map-pass-thru = < 0x0 0x3f >;
		gpio-map = < 0x0 0x0 &gpio0 0xe 0x0 >, < 0x1 0x0 &gpio0 0xf 0x0 >, < 0x2 0x0 &gpio0 0x10 0x0 >, < 0x3 0x0 &gpio0 0x11 0x0 >, < 0x4 0x0 &gpio0 0x12 0x0 >, < 0x5 0x0 &gpio0 0x13 0x0 >, < 0x6 0x0 &gpio0 0x0 0x0 >, < 0x7 0x0 &gpio0 0x1 0x0 >, < 0x8 0x0 &gpio0 0x2 0x0 >, < 0x9 0x0 &gpio0 0x3 0x0 >, < 0xa 0x0 &gpio0 0x4 0x0 >, < 0xb 0x0 &gpio0 0x5 0x0 >, < 0xc 0x0 &gpio0 0x6 0x0 >, < 0xd 0x0 &gpio0 0x7 0x0 >, < 0xe 0x0 &gpio0 0x8 0x0 >, < 0xf 0x0 &gpio0 0x9 0x0 >, < 0x10 0x0 &gpio0 0xa 0x0 >, < 0x11 0x0 &gpio0 0xb 0x0 >, < 0x12 0x0 &gpio0 0xc 0x0 >, < 0x13 0x0 &gpio0 0xd 0x0 >, < 0x14 0x0 &gpio0 0x1e 0x0 >, < 0x15 0x0 &gpio0 0x1f 0x0 >;
		phandle = < 0xa >;
	};
	arduino_adc: analog-connector {
		compatible = "arduino,uno-adc";
		#io-channel-cells = < 0x1 >;
		io-channel-map = < 0x0 &adc 0x1 >, < 0x1 &adc 0x2 >, < 0x2 &adc 0x3 >, < 0x3 &adc 0x4 >, < 0x4 &adc 0x5 >, < 0x5 &adc 0x6 >;
	};
	reserved-memory {
		#address-cells = < 0x1 >;
		#size-cells = < 0x1 >;
		ranges;
		sram0_s: image_s@20000000 {
			reg = < 0x20000000 0x16000 >;
		};
		sram0_modem: image_modem@20016000 {
			reg = < 0x20016000 0xa000 >;
		};
		sram0_ns: image_ns@20020000 {
			reg = < 0x20020000 0x20000 >;
		};
	};
};

  • snip from the logic analyzer view

  • nRF 9160 board

OS: Windows

SDK: 2.2.99-dev3

IDE: Visual Studio Code

Hardware: nRF9160 Development Kid

Thanks for the help!

Parents Reply Children
  • Hi Einarh, thanks! That was the issue. I can now use the I2C bus. However, I have another problem on a similar matter. I am now using the BME680 Sensor from Bosch. I decided to take the library from zephry and did some configuration to make it compatible to nrf9160.  I can compile it, but at run time the function device_is_ready() fails.It fails on this line:

    Basically, the dev->state->int_res should be 0, but it is 5, which in the errno.h is I/O error. Why is that so? Below are the files:

    main.c

    /*
     * Copyright (c) 2018 Bosch Sensortec GmbH
     *
     * SPDX-License-Identifier: Apache-2.0
     */
    
    #include <zephyr/kernel.h>
    #include <zephyr/device.h>
    #include <zephyr/drivers/sensor.h>
    #include <stdio.h>
    
    void main(void)
    {
    	const struct device *const dev = DEVICE_DT_GET_ONE(bosch_bme680);
    	struct sensor_value temp, press, humidity, gas_res;
    
    	if (!device_is_ready(dev)) {
    		printk("sensor: device not ready.\n");
    		return;
    	}
    
    	printf("Device %p name is %s\n", dev, dev->name);
    
    	while (1) {
    		k_sleep(K_MSEC(3000));
    
    		sensor_sample_fetch(dev);
    		sensor_channel_get(dev, SENSOR_CHAN_AMBIENT_TEMP, &temp);
    		sensor_channel_get(dev, SENSOR_CHAN_PRESS, &press);
    		sensor_channel_get(dev, SENSOR_CHAN_HUMIDITY, &humidity);
    		sensor_channel_get(dev, SENSOR_CHAN_GAS_RES, &gas_res);
    
    		printf("T: %d.%06d; P: %d.%06d; H: %d.%06d; G: %d.%06d\n",
    				temp.val1, temp.val2, press.val1, press.val2,
    				humidity.val1, humidity.val2, gas_res.val1,
    				gas_res.val2);
    	}
    }
    

    nrf9160dk_nrf9160_ns.overlay:

    &i2c2 {
    	bme680: bme680@77 {
    		compatible = "bosch,bme680";
    		reg = <0x77>;
    	};
    };

    zephyr.dts

    /dts-v1/;
    
    / {
    	#address-cells = < 0x1 >;
    	#size-cells = < 0x1 >;
    	model = "Nordic nRF9160 DK NRF9160";
    	compatible = "nordic,nrf9160-dk-nrf9160";
    	chosen {
    		zephyr,entropy = &psa_rng;
    		zephyr,flash-controller = &flash_controller;
    		zephyr,console = &uart0;
    		zephyr,shell-uart = &uart0;
    		zephyr,uart-mcumgr = &uart0;
    		zephyr,flash = &flash0;
    		zephyr,sram = &sram0_ns;
    		zephyr,code-partition = &slot0_ns_partition;
    	};
    	aliases {
    		led0 = &led0;
    		led1 = &led1;
    		led2 = &led2;
    		led3 = &led3;
    		pwm-led0 = &pwm_led0;
    		sw0 = &button0;
    		sw1 = &button1;
    		sw2 = &button2;
    		sw3 = &button3;
    		bootloader-led0 = &led0;
    		mcuboot-button0 = &button0;
    		mcuboot-led0 = &led0;
    		watchdog0 = &wdt0;
    	};
    	soc {
    		#address-cells = < 0x1 >;
    		#size-cells = < 0x1 >;
    		compatible = "nordic,nRF9160-SICA", "nordic,nRF9160", "nordic,nRF91", "simple-bus";
    		interrupt-parent = < &nvic >;
    		ranges;
    		nvic: interrupt-controller@e000e100 {
    			#address-cells = < 0x1 >;
    			compatible = "arm,v8m-nvic";
    			reg = < 0xe000e100 0xc00 >;
    			interrupt-controller;
    			#interrupt-cells = < 0x2 >;
    			arm,num-irq-priority-bits = < 0x3 >;
    			phandle = < 0x1 >;
    		};
    		systick: timer@e000e010 {
    			compatible = "arm,armv8m-systick";
    			reg = < 0xe000e010 0x10 >;
    			status = "disabled";
    		};
    		sram0: memory@20000000 {
    			compatible = "mmio-sram";
    			reg = < 0x20000000 0x40000 >;
    		};
    		peripheral@40000000 {
    			#address-cells = < 0x1 >;
    			#size-cells = < 0x1 >;
    			ranges = < 0x0 0x40000000 0x10000000 >;
    			flash_controller: flash-controller@39000 {
    				compatible = "nordic,nrf91-flash-controller";
    				reg = < 0x39000 0x1000 >;
    				partial-erase;
    				#address-cells = < 0x1 >;
    				#size-cells = < 0x1 >;
    				flash0: flash@0 {
    					compatible = "soc-nv-flash";
    					erase-block-size = < 0x1000 >;
    					write-block-size = < 0x4 >;
    					reg = < 0x0 0x100000 >;
    					partitions {
    						compatible = "fixed-partitions";
    						#address-cells = < 0x1 >;
    						#size-cells = < 0x1 >;
    						boot_partition: partition@0 {
    							label = "mcuboot";
    							reg = < 0x0 0x10000 >;
    						};
    						slot0_partition: partition@10000 {
    							label = "image-0";
    							reg = < 0x10000 0x40000 >;
    						};
    						slot0_ns_partition: partition@50000 {
    							label = "image-0-nonsecure";
    							reg = < 0x50000 0x30000 >;
    						};
    						slot1_partition: partition@80000 {
    							label = "image-1";
    							reg = < 0x80000 0x40000 >;
    						};
    						slot1_ns_partition: partition@c0000 {
    							label = "image-1-nonsecure";
    							reg = < 0xc0000 0x30000 >;
    						};
    						scratch_partition: partition@f0000 {
    							label = "image-scratch";
    							reg = < 0xf0000 0xa000 >;
    						};
    						storage_partition: partition@fa000 {
    							label = "storage";
    							reg = < 0xfa000 0x6000 >;
    						};
    					};
    				};
    			};
    			adc: adc@e000 {
    				compatible = "nordic,nrf-saadc";
    				reg = < 0xe000 0x1000 >;
    				interrupts = < 0xe 0x1 >;
    				status = "okay";
    				#io-channel-cells = < 0x1 >;
    				phandle = < 0x12 >;
    			};
    			dppic: dppic@17000 {
    				compatible = "nordic,nrf-dppic";
    				reg = < 0x17000 0x1000 >;
    				status = "okay";
    			};
    			egu0: egu@1b000 {
    				compatible = "nordic,nrf-egu";
    				reg = < 0x1b000 0x1000 >;
    				interrupts = < 0x1b 0x1 >;
    				status = "okay";
    			};
    			egu1: egu@1c000 {
    				compatible = "nordic,nrf-egu";
    				reg = < 0x1c000 0x1000 >;
    				interrupts = < 0x1c 0x1 >;
    				status = "okay";
    			};
    			egu2: egu@1d000 {
    				compatible = "nordic,nrf-egu";
    				reg = < 0x1d000 0x1000 >;
    				interrupts = < 0x1d 0x1 >;
    				status = "okay";
    			};
    			egu3: egu@1e000 {
    				compatible = "nordic,nrf-egu";
    				reg = < 0x1e000 0x1000 >;
    				interrupts = < 0x1e 0x1 >;
    				status = "okay";
    			};
    			egu4: egu@1f000 {
    				compatible = "nordic,nrf-egu";
    				reg = < 0x1f000 0x1000 >;
    				interrupts = < 0x1f 0x1 >;
    				status = "okay";
    			};
    			egu5: egu@20000 {
    				compatible = "nordic,nrf-egu";
    				reg = < 0x20000 0x1000 >;
    				interrupts = < 0x20 0x1 >;
    				status = "okay";
    			};
    			ipc: ipc@2a000 {
    				compatible = "nordic,nrf-ipc";
    				reg = < 0x2a000 0x1000 >;
    				interrupts = < 0x2a 0x1 >;
    				status = "okay";
    			};
    			i2s0: i2s@28000 {
    				compatible = "nordic,nrf-i2s";
    				#address-cells = < 0x1 >;
    				#size-cells = < 0x0 >;
    				reg = < 0x28000 0x1000 >;
    				interrupts = < 0x28 0x1 >;
    				status = "disabled";
    			};
    			kmu: kmu@39000 {
    				compatible = "nordic,nrf-kmu";
    				reg = < 0x39000 0x1000 >;
    				interrupts = < 0x39 0x1 >;
    				status = "okay";
    			};
    			pdm0: pdm@26000 {
    				compatible = "nordic,nrf-pdm";
    				reg = < 0x26000 0x1000 >;
    				interrupts = < 0x26 0x1 >;
    				status = "disabled";
    			};
    			regulators: regulator@4000 {
    				compatible = "nordic,nrf-regulators";
    				reg = < 0x4000 0x1000 >;
    				status = "okay";
    			};
    			vmc: vmc@3a000 {
    				compatible = "nordic,nrf-vmc";
    				reg = < 0x3a000 0x1000 >;
    				status = "okay";
    			};
    			uart0: uart@8000 {
    				compatible = "nordic,nrf-uarte";
    				reg = < 0x8000 0x1000 >;
    				interrupts = < 0x8 0x1 >;
    				status = "okay";
    				current-speed = < 0x1c200 >;
    				pinctrl-0 = < &uart0_default >;
    				pinctrl-1 = < &uart0_sleep >;
    				pinctrl-names = "default", "sleep";
    			};
    			uart1: arduino_serial: uart@9000 {
    				compatible = "nordic,nrf-uarte";
    				reg = < 0x9000 0x1000 >;
    				interrupts = < 0x9 0x1 >;
    				status = "disabled";
    				current-speed = < 0x1c200 >;
    				pinctrl-0 = < &uart1_default >;
    				pinctrl-1 = < &uart1_sleep >;
    				pinctrl-names = "default", "sleep";
    			};
    			uart2: uart@a000 {
    				compatible = "nordic,nrf-uarte";
    				reg = < 0xa000 0x1000 >;
    				interrupts = < 0xa 0x1 >;
    				status = "disabled";
    				pinctrl-0 = < &uart2_default >;
    				pinctrl-1 = < &uart2_sleep >;
    				pinctrl-names = "default", "sleep";
    			};
    			uart3: uart@b000 {
    				compatible = "nordic,nrf-uarte";
    				reg = < 0xb000 0x1000 >;
    				interrupts = < 0xb 0x1 >;
    				status = "disabled";
    			};
    			i2c0: i2c@8000 {
    				compatible = "nordic,nrf-twim";
    				#address-cells = < 0x1 >;
    				#size-cells = < 0x0 >;
    				reg = < 0x8000 0x1000 >;
    				clock-frequency = < 0x186a0 >;
    				interrupts = < 0x8 0x1 >;
    				status = "disabled";
    			};
    			i2c1: i2c@9000 {
    				compatible = "nordic,nrf-twim";
    				#address-cells = < 0x1 >;
    				#size-cells = < 0x0 >;
    				reg = < 0x9000 0x1000 >;
    				clock-frequency = < 0x186a0 >;
    				interrupts = < 0x9 0x1 >;
    				status = "disabled";
    			};
    			i2c2: arduino_i2c: i2c@a000 {
    				compatible = "nordic,nrf-twim";
    				#address-cells = < 0x1 >;
    				#size-cells = < 0x0 >;
    				reg = < 0xa000 0x1000 >;
    				clock-frequency = < 0x186a0 >;
    				interrupts = < 0xa 0x1 >;
    				status = "okay";
    				pinctrl-0 = < &i2c2_default >;
    				pinctrl-1 = < &i2c2_sleep >;
    				pinctrl-names = "default", "sleep";
    				bme680: bme680@77 {
    					compatible = "bosch,bme680";
    					reg = < 0x77 >;
    				};
    			};
    			i2c3: i2c@b000 {
    				compatible = "nordic,nrf-twim";
    				#address-cells = < 0x1 >;
    				#size-cells = < 0x0 >;
    				reg = < 0xb000 0x1000 >;
    				clock-frequency = < 0x186a0 >;
    				interrupts = < 0xb 0x1 >;
    				status = "disabled";
    			};
    			spi0: spi@8000 {
    				compatible = "nordic,nrf-spim";
    				#address-cells = < 0x1 >;
    				#size-cells = < 0x0 >;
    				reg = < 0x8000 0x1000 >;
    				interrupts = < 0x8 0x1 >;
    				max-frequency = < 0x7a1200 >;
    				status = "disabled";
    			};
    			spi1: spi@9000 {
    				compatible = "nordic,nrf-spim";
    				#address-cells = < 0x1 >;
    				#size-cells = < 0x0 >;
    				reg = < 0x9000 0x1000 >;
    				interrupts = < 0x9 0x1 >;
    				max-frequency = < 0x7a1200 >;
    				status = "disabled";
    			};
    			spi2: spi@a000 {
    				compatible = "nordic,nrf-spim";
    				#address-cells = < 0x1 >;
    				#size-cells = < 0x0 >;
    				reg = < 0xa000 0x1000 >;
    				interrupts = < 0xa 0x1 >;
    				max-frequency = < 0x7a1200 >;
    				status = "disabled";
    			};
    			spi3: arduino_spi: spi@b000 {
    				compatible = "nordic,nrf-spim";
    				#address-cells = < 0x1 >;
    				#size-cells = < 0x0 >;
    				reg = < 0xb000 0x1000 >;
    				interrupts = < 0xb 0x1 >;
    				max-frequency = < 0x7a1200 >;
    				status = "okay";
    				cs-gpios = < &arduino_header 0x10 0x1 >;
    				pinctrl-0 = < &spi3_default >;
    				pinctrl-1 = < &spi3_sleep >;
    				pinctrl-names = "default", "sleep";
    			};
    			pwm0: pwm@21000 {
    				compatible = "nordic,nrf-pwm";
    				reg = < 0x21000 0x1000 >;
    				interrupts = < 0x21 0x1 >;
    				status = "okay";
    				#pwm-cells = < 0x3 >;
    				pinctrl-0 = < &pwm0_default >;
    				pinctrl-1 = < &pwm0_sleep >;
    				pinctrl-names = "default", "sleep";
    				phandle = < 0x10 >;
    			};
    			pwm1: pwm@22000 {
    				compatible = "nordic,nrf-pwm";
    				reg = < 0x22000 0x1000 >;
    				interrupts = < 0x22 0x1 >;
    				status = "disabled";
    				#pwm-cells = < 0x3 >;
    			};
    			pwm2: pwm@23000 {
    				compatible = "nordic,nrf-pwm";
    				reg = < 0x23000 0x1000 >;
    				interrupts = < 0x23 0x1 >;
    				status = "disabled";
    				#pwm-cells = < 0x3 >;
    			};
    			pwm3: pwm@24000 {
    				compatible = "nordic,nrf-pwm";
    				reg = < 0x24000 0x1000 >;
    				interrupts = < 0x24 0x1 >;
    				status = "disabled";
    				#pwm-cells = < 0x3 >;
    			};
    			gpio0: gpio@842500 {
    				compatible = "nordic,nrf-gpio";
    				gpio-controller;
    				reg = < 0x842500 0x300 >;
    				#gpio-cells = < 0x2 >;
    				status = "okay";
    				port = < 0x0 >;
    				phandle = < 0xf >;
    			};
    			rtc0: rtc@14000 {
    				compatible = "nordic,nrf-rtc";
    				reg = < 0x14000 0x1000 >;
    				cc-num = < 0x4 >;
    				interrupts = < 0x14 0x1 >;
    				status = "okay";
    				clock-frequency = < 0x8000 >;
    				prescaler = < 0x1 >;
    			};
    			rtc1: rtc@15000 {
    				compatible = "nordic,nrf-rtc";
    				reg = < 0x15000 0x1000 >;
    				cc-num = < 0x4 >;
    				interrupts = < 0x15 0x1 >;
    				status = "okay";
    				clock-frequency = < 0x8000 >;
    				prescaler = < 0x1 >;
    			};
    			clock: clock@5000 {
    				compatible = "nordic,nrf-clock";
    				reg = < 0x5000 0x1000 >;
    				interrupts = < 0x5 0x1 >;
    				status = "okay";
    			};
    			power: power@5000 {
    				compatible = "nordic,nrf-power";
    				reg = < 0x5000 0x1000 >;
    				interrupts = < 0x5 0x1 >;
    				status = "okay";
    			};
    			wdt: wdt0: watchdog@18000 {
    				compatible = "nordic,nrf-wdt";
    				reg = < 0x18000 0x1000 >;
    				interrupts = < 0x18 0x1 >;
    				status = "okay";
    			};
    			timer0: timer@f000 {
    				compatible = "nordic,nrf-timer";
    				status = "okay";
    				reg = < 0xf000 0x1000 >;
    				cc-num = < 0x6 >;
    				interrupts = < 0xf 0x1 >;
    				prescaler = < 0x0 >;
    			};
    			timer1: timer@10000 {
    				compatible = "nordic,nrf-timer";
    				status = "okay";
    				reg = < 0x10000 0x1000 >;
    				cc-num = < 0x6 >;
    				interrupts = < 0x10 0x1 >;
    				prescaler = < 0x0 >;
    			};
    			timer2: timer@11000 {
    				compatible = "nordic,nrf-timer";
    				status = "okay";
    				reg = < 0x11000 0x1000 >;
    				cc-num = < 0x6 >;
    				interrupts = < 0x11 0x1 >;
    				prescaler = < 0x0 >;
    			};
    		};
    		gpiote: gpiote@40031000 {
    			compatible = "nordic,nrf-gpiote";
    			reg = < 0x40031000 0x1000 >;
    			interrupts = < 0x31 0x5 >;
    			status = "okay";
    		};
    	};
    	pinctrl: pin-controller {
    		compatible = "nordic,nrf-pinctrl";
    		uart0_default: uart0_default {
    			phandle = < 0x2 >;
    			group1 {
    				psels = < 0x1d >, < 0x2001b >;
    			};
    			group2 {
    				psels = < 0x1001c >, < 0x3001a >;
    				bias-pull-up;
    			};
    		};
    		uart0_sleep: uart0_sleep {
    			phandle = < 0x3 >;
    			group1 {
    				psels = < 0x1d >, < 0x1001c >, < 0x2001b >, < 0x3001a >;
    				low-power-enable;
    			};
    		};
    		uart1_default: uart1_default {
    			phandle = < 0x4 >;
    			group1 {
    				psels = < 0x1 >, < 0x2000e >;
    			};
    			group2 {
    				psels = < 0x10000 >, < 0x3000f >;
    				bias-pull-up;
    			};
    		};
    		uart1_sleep: uart1_sleep {
    			phandle = < 0x5 >;
    			group1 {
    				psels = < 0x1 >, < 0x10000 >, < 0x2000e >, < 0x3000f >;
    				low-power-enable;
    			};
    		};
    		uart2_default: uart2_default {
    			phandle = < 0x6 >;
    			group1 {
    				psels = < 0x18 >, < 0x10017 >;
    			};
    		};
    		uart2_sleep: uart2_sleep {
    			phandle = < 0x7 >;
    			group1 {
    				psels = < 0x18 >, < 0x10017 >;
    				low-power-enable;
    			};
    		};
    		i2c2_default: i2c2_default {
    			phandle = < 0x8 >;
    			group1 {
    				psels = < 0xc001e >, < 0xb001f >;
    			};
    		};
    		i2c2_sleep: i2c2_sleep {
    			phandle = < 0x9 >;
    			group1 {
    				psels = < 0xc001e >, < 0xb001f >;
    				low-power-enable;
    			};
    		};
    		pwm0_default: pwm0_default {
    			phandle = < 0xd >;
    			group1 {
    				psels = < 0x160002 >;
    			};
    		};
    		pwm0_sleep: pwm0_sleep {
    			phandle = < 0xe >;
    			group1 {
    				psels = < 0x160002 >;
    				low-power-enable;
    			};
    		};
    		spi3_default: spi3_default {
    			phandle = < 0xb >;
    			group1 {
    				psels = < 0x4000d >, < 0x6000c >, < 0x5000b >;
    			};
    		};
    		spi3_sleep: spi3_sleep {
    			phandle = < 0xc >;
    			group1 {
    				psels = < 0x4000d >, < 0x6000c >, < 0x5000b >;
    				low-power-enable;
    			};
    		};
    	};
    	rng_hci: entropy_bt_hci {
    		compatible = "zephyr,bt-hci-entropy";
    		status = "okay";
    	};
    	cpus {
    		#address-cells = < 0x1 >;
    		#size-cells = < 0x0 >;
    		cpu@0 {
    			device_type = "cpu";
    			compatible = "arm,cortex-m33f";
    			reg = < 0x0 >;
    			#address-cells = < 0x1 >;
    			#size-cells = < 0x1 >;
    			mpu: mpu@e000ed90 {
    				compatible = "arm,armv8m-mpu";
    				reg = < 0xe000ed90 0x40 >;
    				arm,num-mpu-regions = < 0x10 >;
    			};
    		};
    	};
    	psa_rng: psa-rng {
    		compatible = "zephyr,psa-crypto-rng";
    		status = "okay";
    	};
    	leds {
    		compatible = "gpio-leds";
    		led0: led_0 {
    			gpios = < &gpio0 0x2 0x0 >;
    			label = "Green LED 1";
    		};
    		led1: led_1 {
    			gpios = < &gpio0 0x3 0x0 >;
    			label = "Green LED 2";
    		};
    		led2: led_2 {
    			gpios = < &gpio0 0x4 0x0 >;
    			label = "Green LED 3";
    		};
    		led3: led_3 {
    			gpios = < &gpio0 0x5 0x0 >;
    			label = "Green LED 4";
    		};
    	};
    	pwmleds {
    		compatible = "pwm-leds";
    		pwm_led0: pwm_led_0 {
    			pwms = < &pwm0 0x0 0x1312d00 0x0 >;
    		};
    	};
    	buttons {
    		compatible = "gpio-keys";
    		button0: button_0 {
    			gpios = < &gpio0 0x6 0x11 >;
    			label = "Push button 1";
    		};
    		button1: button_1 {
    			gpios = < &gpio0 0x7 0x11 >;
    			label = "Push button 2";
    		};
    		button2: button_2 {
    			gpios = < &gpio0 0x8 0x11 >;
    			label = "Switch 1";
    		};
    		button3: button_3 {
    			gpios = < &gpio0 0x9 0x11 >;
    			label = "Switch 2";
    		};
    	};
    	interface_to_nrf52840: gpio-interface {
    		compatible = "nordic,nrf9160dk-nrf52840-interface";
    		#gpio-cells = < 0x2 >;
    		gpio-map-mask = < 0xf 0x0 >;
    		gpio-map-pass-thru = < 0x0 0xffffffff >;
    		gpio-map = < 0x0 0x0 &gpio0 0x11 0x0 >, < 0x1 0x0 &gpio0 0x12 0x0 >, < 0x2 0x0 &gpio0 0x13 0x0 >, < 0x3 0x0 &gpio0 0x15 0x0 >, < 0x4 0x0 &gpio0 0x16 0x0 >, < 0x5 0x0 &gpio0 0x17 0x0 >;
    		phandle = < 0x11 >;
    	};
    	nrf52840_reset: gpio-reset {
    		compatible = "nordic,nrf9160dk-nrf52840-reset";
    		status = "disabled";
    		gpios = < &interface_to_nrf52840 0x5 0x0 >;
    	};
    	arduino_header: connector {
    		compatible = "arduino-header-r3";
    		#gpio-cells = < 0x2 >;
    		gpio-map-mask = < 0xffffffff 0xffffffc0 >;
    		gpio-map-pass-thru = < 0x0 0x3f >;
    		gpio-map = < 0x0 0x0 &gpio0 0xe 0x0 >, < 0x1 0x0 &gpio0 0xf 0x0 >, < 0x2 0x0 &gpio0 0x10 0x0 >, < 0x3 0x0 &gpio0 0x11 0x0 >, < 0x4 0x0 &gpio0 0x12 0x0 >, < 0x5 0x0 &gpio0 0x13 0x0 >, < 0x6 0x0 &gpio0 0x0 0x0 >, < 0x7 0x0 &gpio0 0x1 0x0 >, < 0x8 0x0 &gpio0 0x2 0x0 >, < 0x9 0x0 &gpio0 0x3 0x0 >, < 0xa 0x0 &gpio0 0x4 0x0 >, < 0xb 0x0 &gpio0 0x5 0x0 >, < 0xc 0x0 &gpio0 0x6 0x0 >, < 0xd 0x0 &gpio0 0x7 0x0 >, < 0xe 0x0 &gpio0 0x8 0x0 >, < 0xf 0x0 &gpio0 0x9 0x0 >, < 0x10 0x0 &gpio0 0xa 0x0 >, < 0x11 0x0 &gpio0 0xb 0x0 >, < 0x12 0x0 &gpio0 0xc 0x0 >, < 0x13 0x0 &gpio0 0xd 0x0 >, < 0x14 0x0 &gpio0 0x1e 0x0 >, < 0x15 0x0 &gpio0 0x1f 0x0 >;
    		phandle = < 0xa >;
    	};
    	arduino_adc: analog-connector {
    		compatible = "arduino,uno-adc";
    		#io-channel-cells = < 0x1 >;
    		io-channel-map = < 0x0 &adc 0x1 >, < 0x1 &adc 0x2 >, < 0x2 &adc 0x3 >, < 0x3 &adc 0x4 >, < 0x4 &adc 0x5 >, < 0x5 &adc 0x6 >;
    	};
    	reserved-memory {
    		#address-cells = < 0x1 >;
    		#size-cells = < 0x1 >;
    		ranges;
    		sram0_s: image_s@20000000 {
    			reg = < 0x20000000 0x16000 >;
    		};
    		sram0_modem: image_modem@20016000 {
    			reg = < 0x20016000 0xa000 >;
    		};
    		sram0_ns: image_ns@20020000 {
    			reg = < 0x20020000 0x20000 >;
    		};
    	};
    };
    

    prj.conf

    CONFIG_STDOUT_CONSOLE=y
    CONFIG_I2C=y
    CONFIG_SENSOR=y
    
    # BME680 - Temperature and humidity sensor.
    CONFIG_DT_HAS_BOSCH_BME680_ENABLED=y
    CONFIG_BME680=y
    CONFIG_BME680_TEMP_OVER_2X=y
    CONFIG_BME680_PRESS_OVER_16X=y
    CONFIG_BME680_HUMIDITY_OVER_1X=y

  • Hi

    I would guess this has to do with changes you've done to make it compatible with nRF9160, so it would help to see the exact changes you've made.

    But since this is a new issue could you please open a new ticket? This would make it easier for others with similar issues to find the ticket.

    -Einar

Related