Good Day.
I'm trying to run the "npm1300_fuel_gauge" example on a custom board (nRF52840), but I'm getting errors that I don't know how to fix.
The first thing I did was to get the PMIC configuration overlay file (config.overlay) through nPM PowerUP. Then I transferred the code from config.overlay to the custom board device tree file (custom_board_nrf52840.dts). I plan to connect the PMIC via I2C1.
custom_board_nrf52840.dts -->
&i2c1 {
compatible = "nordic,nrf-twi";
/* Cannot be used together with spi1. */
status = "okay";
pinctrl-0 = <&i2c1_default>;
pinctrl-1 = <&i2c1_sleep>;
pinctrl-names = "default", "sleep";
npm1300_ek_pmic: pmic@6b {
compatible = "nordic,npm1300";
reg = <0x6b>;
npm1300_ek_gpio: gpio-controller {
compatible = "nordic,npm1300-gpio";
gpio-controller;
#gpio-cells = <2>;
ngpios = <5>;
};
npm1300_ek_regulators: regulators {
compatible = "nordic,npm1300-regulator";
npm1300_ek_buck1: BUCK1 {
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <3300000>;
retention-microvolt = <1200000>;
};
npm1300_ek_buck2: BUCK2 {
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <3300000>;
retention-microvolt = <1800000>;
};
npm1300_ek_ldo1: LDO1 {
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <3300000>;
regulator-initial-mode = <NPM1300_LDSW_MODE_LDSW>;
// soft-start-microamp = <10000>;
};
npm1300_ek_ldo2: LDO2 {
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <3300000>;
regulator-initial-mode = <NPM1300_LDSW_MODE_LDSW>;
// soft-start-microamp = <10000>;
};
};
npm1300_ek_charger: charger {
compatible = "nordic,npm1300-charger";
term-microvolt = <4200000>;
term-warm-microvolt = <3600000>;
// term-current-percent = <10>;
current-microamp = <100000>;
// trickle-microvolt = <2900000>;
dischg-limit-microamp = <1000000>;
vbus-limit-microamp = <500000>;
thermistor-ohms = <10000>;
thermistor-beta = <3380>;
charging-enable;
};
npm1300_ek_leds: leds {
compatible = "nordic,npm1300-led";
nordic,led0-mode = "error";
nordic,led1-mode = "charging";
nordic,led2-mode = "host";
};
};
};
custom_board_nrf52840-pinctrl.dtsi -->
i2c1_default: i2c1_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 15)>,
<NRF_PSEL(TWIM_SCL, 0, 17)>;
bias-pull-up;
};
};
i2c1_sleep: i2c1_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 15)>,
<NRF_PSEL(TWIM_SCL, 0, 17)>;
low-power-enable;
};
};
The following errors occur in the .dts file (see screenshot).
I know that these values should be taken from the "fuel_gauge.h" file, but that doesn't happen for some reason.
I see an error in the prj.conf file too (see screenshot).
When building the project, I see the following information -->
I have not changed the CMakeLists.txt files.
# Copyright (c) 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
cmake_minimum_required(VERSION 3.20.0)
set(SHIELD npm1300_ek)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(my_npm1300_fuel_gauge)
add_subdirectory(src)
Can you please tell me where I am making a mistake when transferring this example to my custom board?
Thank you.