no device npm1300_ek (one button sample) with nRF52 DK on I2C Bus

I try to get the one button sample to work. There were several details missing to be able to compile and run this sample, which was very frustrating. After editing/updating the

prj.conf: CONFIG_I2C=y

CMakeLists.txt: set(SHIELD npm1300_ek)

nrf52dk_nrf52832.overlay:

 #include <zephyr/dt-bindings/pinctrl/nrf-pinctrl.h>

 &i2c1 {
 status = "okay";
 pinctrl-0 = <&i2c1_default>;
 pinctrl-1 = <&i2c1_sleep>;
 pinctrl-names = "default", "sleep";
 clock-frequency = <I2C_BITRATE_STANDARD>; 
 //clock-frequency = <10000>;
 };
 
 &i2c1_default {
 group1 {
 psels = <NRF_PSEL(TWIM_SDA, 0, 26)>,
 <NRF_PSEL(TWIM_SCL, 0, 27)>;
 bias-pull-up;
 };
};

&i2c1_sleep {
 group1 {
 psels = <NRF_PSEL(TWIM_SDA, 0, 26)>,
 <NRF_PSEL(TWIM_SCL, 0, 27)>;
 low-power-enable;
 };
};

My zephyr.dts i2c1 snippet:

/* node '/soc/i2c@40004000' defined in zephyr/dts/arm/nordic/nrf52832.dtsi:172 */
		i2c1: i2c@40004000 {
			#address-cells = < 0x1 >;      /* in zephyr/dts/arm/nordic/nrf52832.dtsi:181 */
			#size-cells = < 0x0 >;         /* in zephyr/dts/arm/nordic/nrf52832.dtsi:182 */
			reg = < 0x40004000 0x1000 >;   /* in zephyr/dts/arm/nordic/nrf52832.dtsi:183 */
			interrupts = < 0x4 0x1 >;      /* in zephyr/dts/arm/nordic/nrf52832.dtsi:184 */
			easydma-maxcnt-bits = < 0x8 >; /* in zephyr/dts/arm/nordic/nrf52832.dtsi:185 */
			zephyr,pm-device-runtime-auto; /* in zephyr/dts/arm/nordic/nrf52832.dtsi:187 */
			compatible = "nordic,nrf-twi"; /* in zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts:188 */
			status = "okay";               /* in ../../../../mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/npm13xx_one_button/build/npm13xx_one_button/zephyr/boards/nrf52dk_nrf52832.overlay:9 */
			pinctrl-0 = < &i2c1_default >; /* in ../../../../mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/npm13xx_one_button/build/npm13xx_one_button/zephyr/boards/nrf52dk_nrf52832.overlay:10 */
			pinctrl-1 = < &i2c1_sleep >;   /* in ../../../../mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/npm13xx_one_button/build/npm13xx_one_button/zephyr/boards/nrf52dk_nrf52832.overlay:11 */
			pinctrl-names = "default",
			                "sleep";       /* in ../../../../mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/npm13xx_one_button/build/npm13xx_one_button/zephyr/boards/nrf52dk_nrf52832.overlay:12 */
			clock-frequency = < 0x186a0 >; /* in ../../../../mnt/df01dc22-f3bf-40d5-9858-752a58c9832d/devprojects/nordicsemi/npm13xx_one_button/build/npm13xx_one_button/zephyr/boards/nrf52dk_nrf52832.overlay:13 */
		};

with claudes assistance/support i got it to compile and run. But an i2c scan i2c0 shows no device at all.

What minimal required steps/configuration have to setup to get I2C enabled and detect devices on the bus should be?

Trying with the nrf-connect (Ubuntu) Linux-Desktop app (2x USB -C, 1x LiPo Battery) i get NPM detected, the LiPo Battery to and can change parameters for ex. the LED's live, so the BOARD is working.

Any support/hint/help is appreciated.

Parents Reply
  • Hi,

    USB-C is connected to "USB PMIC" and the Battery to /P1-header,

    VBATIN & VBAT are connected via Jumper.

    On the nrf52 DK i use VDD (between RESET and 5V) on P1 header connected to VDDIO ot the TWI npm1300_EK header.

    (P2) NTC & 10k are connected via jumper.

    SDA -> P0.26

    SCL->P0.27

    Compiling the mentioned example, after manually adding set(SHIELD npm1300_ek) in CMakeLists.txt) results in the folllowing output:

    *** Booting nRF Connect SDK v3.2.0-5dcc6bd39b0f ***
    *** Using Zephyr OS v4.2.99-a57ad913cf4e ***
    Set up button at gpio@50000000 pin 13
    Error: led device is not ready
    Pmic device not ready.
    Charger device not ready.

Children
Related