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
  • Hi,

     

    You should not need to alter anything when compiling the example:

    https://docs.nordicsemi.com/bundle/ncs-3.3.0/page/nrf/samples/pmic/native/npm13xx_one_button/README.html

     

    Please note that the "npm1300_ek" shield uses i2c0 on the nrf52dk, and not i2c1.

    Same goes for the zephyr sample:

    https://docs.nordicsemi.com/bundle/ncs-3.3.0/page/zephyr/samples/shields/npm13xx_ek/index.html#npm13xx_ek

    Here you need to set the shield parameter (as you do in CMakeLists.txt):

    https://docs.nordicsemi.com/bundle/ncs-3.3.0/page/zephyr/samples/shields/npm13xx_ek/index.html#building_and_running

     

    Kind regards,

    Håkon

  • Hi,

    editing an example was my fault. But Using I2c0 is no difference. Tried with the original sample npm1300.overlay.

    I additonally enabled the shell in the prj.conf:

    CONFIG_PRINTK=y
    CONFIG_LOG_CMDS=y
    CONFIG_I2C_LOG_LEVEL_DBG=y
    CONFIG_SHELL=y
    CONFIG_LOG=y
    CONFIG_UART_CONSOLE=y
    CONFIG_EARLY_CONSOLE=y
    CONFIG_I2C_SHELL=y

    The result of >device list< is:

    uart:~$ device list
    devices:
    - clock@40000000 (READY)
      DT node labels: clock
    - gpio@50000000 (READY)
      DT node labels: gpio0
    - uart@40002000 (READY)
      DT node labels: uart0 arduino_serial
    - i2c@40003000 (READY)
      DT node labels: i2c0 arduino_i2c
    - pwm@4001c000 (READY)
      DT node labels: pwm0
    - pmic@6b (DISABLED)
      DT node labels: npm1300_ek_pmic
    - gpio-controller (DISABLED)
      DT node labels: npm1300_ek_gpio
    - regulators (READY)
      DT node labels: npm1300_ek_regulators
    - LDO2 (DISABLED)
      DT node labels: npm1300_ek_ldo2
    - LDO1 (DISABLED)
      DT node labels: npm1300_ek_ldo1
    - BUCK2 (DISABLED)
      DT node labels: npm1300_ek_buck2
    - BUCK1 (DISABLED)
      DT node labels: npm1300_ek_buck1
    - leds (READY)
    - leds (DISABLED)
      DT node labels: npm1300_ek_leds
    - pwmleds (READY)
    - temp@4000c000 (READY)
      DT node labels: temp
    - charger (DISABLED)
      DT node labels: npm1300_ek_charger

    So pmic@6b is disabled despite in the npm1300.overlay:

    &npm1300_ek_pmic {
    host-int-gpios = <&gpio0 22 0>;
    pmic-int-pin = <3>;
    };
    What am i missing?
  • When i compile the original sample, just configuring the required shield in CMakeLists i get the message "Error: led device is not ready". USB-C Cable for USB PMIC and a Battery to Jumper 2. The nrf52 DK can't access/contact the npm1300 EK, wired as in the sample mentioned.

  • Hi,

     

    Here is a generic illustration of the setup: https://docs.nordicsemi.com/bundle/ug_npm1300_ek/page/UG/nPM1300_EK/using_nrf5340_DK.html

    I connected the minimum amount of pins, ie. SDA/SCL/VDDIO/GND to the nRF52-DK, and compiled the example zephyr/samples/shields/npm13xx_ek:

    west build -b nrf52dk/nrf52832 -- -DSHIELD=npm1300_ek

     

    And flashed it, and it shows:

    *** Booting nRF Connect SDK v3.3.0-ba167d9f3db4 ***
    *** Using Zephyr OS v4.3.99-fd9204a02d52 ***
    Set up button at gpio@50000000 pin 13
    V: 0.014 I: 0.0000 T: -88.11
    Charger Status: 0, Error: 0, VBUS: connected
    

     

    If you still have issues, can you please share a more verbose output? including your build command and serial output?

    A picture of your setup would be good as well.

     

    Kind regards,

    Håkon

  • 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.

  • My console output:

    Building npm13xx_ek
    west build --build-dir /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek --pristine --board nrf52dk/nrf52832 -- -DCONF_FILE="prj.conf" -DEXTRA_DTC_OVERLAY_FILE=npm1300.overlay -DDTC_OVERLAY_FILE=boards/nrf52dk_nrf52832.overlay -DDEBUG_THREAD_INFO=On -DCONFIG_DEBUG_THREAD_INFO=y -DSHIELD=npm1300_ek -Dnpm13xx_ek_DEBUG_THREAD_INFO=Off
    
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: /home/thomas/ncs/toolchains/43683a87ea/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
    -- Cache files will be written to: /home/thomas/.cache/zephyr
    -- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
    -- Board: nrf52dk, qualifiers: nrf52832
    -- Shield(s): npm1300_ek
    Parsing /home/thomas/ncs/v3.2.0/zephyr/share/sysbuild/Kconfig
    Loaded configuration '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/_sysbuild/empty.conf'
    Merged configuration '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/_sysbuild/empty.conf'
    Configuration saved to '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/zephyr/.config'
    Kconfig header saved to '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/_sysbuild/autoconf.h'
    -- 
       ********************************
       * Running CMake for npm13xx_ek *
       ********************************
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek
    -- CMake version: 3.21.0
    -- Found Python3: /home/thomas/ncs/toolchains/43683a87ea/usr/local/bin/python (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
    -- Cache files will be written to: /home/thomas/.cache/zephyr
    -- Zephyr version: 4.2.99 (/home/thomas/ncs/v3.2.0/zephyr)
    -- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
    -- Board: nrf52dk, qualifiers: nrf52832
    -- Shield(s): npm1300_ek
    -- Found host-tools: zephyr 0.17.0 (/home/thomas/ncs/toolchains/43683a87ea/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (/home/thomas/ncs/toolchains/43683a87ea/opt/zephyr-sdk)
    -- Found Dtc: /home/thomas/ncs/toolchains/43683a87ea/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/thomas/ncs/v3.2.0/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts
    -- Found devicetree overlay: /home/thomas/ncs/v3.2.0/zephyr/boards/shields/npm1300_ek/npm1300_ek.overlay
    -- Found devicetree overlay: boards/nrf52dk_nrf52832.overlay
    -- Found devicetree overlay: npm1300.overlay
    -- Generated zephyr.dts: /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek/zephyr/zephyr.dts
    -- Generated pickled edt: /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek/zephyr/edt.pickle
    -- Generated devicetree_generated.h: /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek/zephyr/include/generated/zephyr/devicetree_generated.h
    Parsing /home/thomas/ncs/v3.2.0/zephyr/Kconfig
    Loaded configuration '/home/thomas/ncs/v3.2.0/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832_defconfig'
    Merged configuration '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/prj.conf'
    Merged configuration '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek/zephyr/misc/generated/extra_kconfig_options.conf'
    Merged configuration '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek/zephyr/.config.sysbuild'
    Configuration saved to '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek/zephyr/.config'
    Kconfig header saved to '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/thomas/ncs/toolchains/43683a87ea/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/thomas/ncs/toolchains/43683a87ea/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Using ccache: /home/thomas/ncs/toolchains/43683a87ea/usr/bin/ccache
    -- Found gen_kobject_list: /home/thomas/ncs/v3.2.0/zephyr/scripts/build/gen_kobject_list.py
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build
    -- west build: building application
    [5/234] Generating include/generated/zephyr/version.h
    -- Zephyr version: 4.2.99 (/home/thomas/ncs/v3.2.0/zephyr), build: ncs-v3.2.0
    [234/234] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:      109680 B       512 KB     20.92%
                 RAM:       19488 B        64 KB     29.74%
            IDT_LIST:          0 GB        32 KB      0.00%
    Generating files from /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek/zephyr/zephyr.elf for board: nrf52dk
    [10/10] Generating ../merged.hex

Reply
  • My console output:

    Building npm13xx_ek
    west build --build-dir /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek --pristine --board nrf52dk/nrf52832 -- -DCONF_FILE="prj.conf" -DEXTRA_DTC_OVERLAY_FILE=npm1300.overlay -DDTC_OVERLAY_FILE=boards/nrf52dk_nrf52832.overlay -DDEBUG_THREAD_INFO=On -DCONFIG_DEBUG_THREAD_INFO=y -DSHIELD=npm1300_ek -Dnpm13xx_ek_DEBUG_THREAD_INFO=Off
    
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: /home/thomas/ncs/toolchains/43683a87ea/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
    -- Cache files will be written to: /home/thomas/.cache/zephyr
    -- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
    -- Board: nrf52dk, qualifiers: nrf52832
    -- Shield(s): npm1300_ek
    Parsing /home/thomas/ncs/v3.2.0/zephyr/share/sysbuild/Kconfig
    Loaded configuration '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/_sysbuild/empty.conf'
    Merged configuration '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/_sysbuild/empty.conf'
    Configuration saved to '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/zephyr/.config'
    Kconfig header saved to '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/_sysbuild/autoconf.h'
    -- 
       ********************************
       * Running CMake for npm13xx_ek *
       ********************************
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek
    -- CMake version: 3.21.0
    -- Found Python3: /home/thomas/ncs/toolchains/43683a87ea/usr/local/bin/python (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
    -- Cache files will be written to: /home/thomas/.cache/zephyr
    -- Zephyr version: 4.2.99 (/home/thomas/ncs/v3.2.0/zephyr)
    -- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
    -- Board: nrf52dk, qualifiers: nrf52832
    -- Shield(s): npm1300_ek
    -- Found host-tools: zephyr 0.17.0 (/home/thomas/ncs/toolchains/43683a87ea/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (/home/thomas/ncs/toolchains/43683a87ea/opt/zephyr-sdk)
    -- Found Dtc: /home/thomas/ncs/toolchains/43683a87ea/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/thomas/ncs/v3.2.0/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts
    -- Found devicetree overlay: /home/thomas/ncs/v3.2.0/zephyr/boards/shields/npm1300_ek/npm1300_ek.overlay
    -- Found devicetree overlay: boards/nrf52dk_nrf52832.overlay
    -- Found devicetree overlay: npm1300.overlay
    -- Generated zephyr.dts: /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek/zephyr/zephyr.dts
    -- Generated pickled edt: /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek/zephyr/edt.pickle
    -- Generated devicetree_generated.h: /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek/zephyr/include/generated/zephyr/devicetree_generated.h
    Parsing /home/thomas/ncs/v3.2.0/zephyr/Kconfig
    Loaded configuration '/home/thomas/ncs/v3.2.0/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832_defconfig'
    Merged configuration '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/prj.conf'
    Merged configuration '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek/zephyr/misc/generated/extra_kconfig_options.conf'
    Merged configuration '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek/zephyr/.config.sysbuild'
    Configuration saved to '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek/zephyr/.config'
    Kconfig header saved to '/home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/thomas/ncs/toolchains/43683a87ea/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/thomas/ncs/toolchains/43683a87ea/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Using ccache: /home/thomas/ncs/toolchains/43683a87ea/usr/bin/ccache
    -- Found gen_kobject_list: /home/thomas/ncs/v3.2.0/zephyr/scripts/build/gen_kobject_list.py
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build
    -- west build: building application
    [5/234] Generating include/generated/zephyr/version.h
    -- Zephyr version: 4.2.99 (/home/thomas/ncs/v3.2.0/zephyr), build: ncs-v3.2.0
    [234/234] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:      109680 B       512 KB     20.92%
                 RAM:       19488 B        64 KB     29.74%
            IDT_LIST:          0 GB        32 KB      0.00%
    Generating files from /home/thomas/ncs/v3.2.0/zephyr/samples/shields/npm13xx_ek/build/npm13xx_ek/zephyr/zephyr.elf for board: nrf52dk
    [10/10] Generating ../merged.hex

Children
  • Hi,

     

    nRF52_DK_usr said:

    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:

    This is the same setup as I have.

    What about P18? Is there a jumper present on this header?

    This one should not be present if the voltages differs between the NPM EK and nRF DK.

     

    Could you share a picture of how the jumpers are setup on your NPM1300-EK?

     

    Kind regards,

    Håkon

     

  • On P18 is no jumper. See my jumper configuration picture attached.

  • HI, what about the SHIELD detect pins on the nRF52 DK using the I/O expander for boards that follow arduino standard, see from the nRF52 DK userguide v3.x.x?

    "The I/O expander releases these GPIOs for general use when the nRF52 DK is used together with boards
    that follow the Arduino standard. The I/O expander can be permanently enabled by shorting solder bridge
    SB18, or permanently disabled by cutting the shorting track on SB19. You must also short SB18 when
    cutting SB19 for full compatibility with the Arduino standard.
    The I/O expander can be temporarily enabled by connecting SHIELD DETECT to ground."

  • HI, i tried some LOG_DBG and some LED switching....with worked partially but is confusing too.

    static const struct device *leds_npm = NPM13XX_DEVICE(leds);
    
    int main(void)
    {
    
    	k_sleep(K_MSEC(100));
    	LOG_DBG("=====Boot complete=====");
    
    	int err = i2c_is_ready_dt(&i2c_spec);
    
    	k_sleep(K_MSEC(1000));	
    	
    	printk("====One Button===\n");
    	//printk("PMIC Init Status: %d\n", device_init(pmic->state));
    	LOG_DBG("I2C bus state: %d", err);
    	LOG_DBG("I2C0 state: %p", (void*)i2c->state);
    	LOG_DBG("LEDs name: %s\n", leds_npm->name);
    	k_sleep(K_MSEC(100));
    	LOG_DBG("LEDs ready: %d\n", device_is_ready(leds));
    	k_sleep(K_MSEC(100));
    	LOG_DBG("PMIC name: %s", (pmic->name));	
    	LOG_DBG("PMIC state: %p", (void*)pmic->state);
    	//LOG_DBG("PMIC config: %s", pmic->ops);
    	LOG_DBG("Charger name: %s", (charger->name));	
    
    	/*
    	if (!device_is_ready(leds)) {
    		printk("Error: led device is not ready\n");
    		//return 0;		
    	}
    
    	if (!configure_events()) {
    		printk("Error: could not configure events\n");
    		//return 0;
    	}*/
    
    	while (1) {
    		led_on(leds_npm, 2U);
    		k_msleep(flash_time_ms);
    		led_off(leds_npm, 2U);
    		k_msleep(flash_time_ms);
    	}
    }

    The amber LED is blinking, removing SDA/SDC or Jumper on P17 results in no blinking.

    Adding another LED1 by:

    -adapt npm1300.overlay with: >nordic,led1-mode="host";<

    pristine rebuild DOESN'T work, against expectation. Why?

    The LED is "not ready", but switching in a while loop, so the I2C signal from nRF52 DK is obviously working. Confusing.

  • Hi,

     

    Here is the .hex that I used for testing:

    8400.zephyr.hex 

    And here is a picture of my setup:

    It is similar to yours, and I also tried setting up similar to your setup (P15 header), and still did not see any issues.

     

    Could you try my .hex file and see if this behaves similar?

     

    Kind regards,

    Håkon

Related