nPM1300 Configuration

Hi,

I would like your support in reviewing and helping define the correct configuration for the NPM1300 charger in our application.

Here is the current configuration we are using:

npm1300_charger: charger {
    compatible = "nordic,npm1300-charger";
    status = "okay";
    term-microvolt = <4100000>;
    term-warm-microvolt = <4000000>;
    current-microamp = <130000>;
    dischg-limit-microamp = <1340000>;
    vbus-limit-microamp = <500000>;
    thermistor-ohms = <10000>;
    thermistor-beta = <3435>;
    charging-enable;
};

We are using the following battery: renata ICP621333PA-01 3.7V / 230mAh

Could you please confirm whether this configuration is appropriate for the battery in use? I noticed that the PMIC offers additional protection and safety configurations. If possible, I would appreciate your guidance on defining a recommended and more complete set of parameters.

We are also encountering a couple of issues:

  1. Occasionally, the PMIC does not detect the USB-C charger connection during boot.

  2. When the USB connection is not recognized, the fuel gauge reports 0% state of charge (SOC).

Any advice or suggestions to address these issues would be greatly appreciated.

Parents Reply Children
  • thanks I will try it and see if this works.

    regarding the first question I asked, about the correct battery configuration settings, I used chatGPT to help me with that.

    can you review it here and let me know if its OK? It would be helpful to have a professional set of eyes to approve it:

    chatgpt.com/.../67f21a09-60ec-8001-95c5-2149c9cc0a10

  • Our PMIC team commented on the discharge limit was a bit high. Try setting it to 240mA.

    Best regards,

    Edvin

  • Thank Edvin, this seems to work well!

    I have another issue related to the npm1300 driver. occasionally this function - hal_fg_init() returns false.

    Is there a problem in this function? I also tried a retry mechanism on this function, but when it fails, it always fail until the next reboot. 

    int hal_fg_init(void)
    {
        struct sensor_value value;
        struct nrf_fuel_gauge_init_parameters parameters = {
            .model = &battery_model,
            .opt_params = NULL,
        };
        int32_t chg_status;
        bool found = false;
    
        if (fuelgauge_device != NULL) {
            LOG_INF("fuel gauge HAL already initialized");
            return 0;
        }
    
        LOG_INF("initialize NPM1300 fuel gauge HAL (version: \"%s\", battery: \"%s\")",
                nrf_fuel_gauge_version, battery_model.name);
    
        fuelgauge_device = DEVICE_DT_GET(FUELGAUGE_CONTROLLER0_NODE);
        if (fuelgauge_device) {
            if (device_is_ready(fuelgauge_device)) {
                LOG_INF("found fuel gauge controller \"%s\"", fuelgauge_device->name);
                found = true;
            } else {
                LOG_ERR("Fuel gauge controller \"%s\" is not ready", fuelgauge_device->name);
            }
        }
    
        if (found == false) {
            LOG_ERR("no fuel gauge controller found");
            return -1;
        }
    
        if (read_npm1300_fuelgauge(fuelgauge_device, &parameters.v0, &parameters.i0, &parameters.t0,
                                   &chg_status) < 0) {
            return -1;
        }
    
        /* Store charge nominal and termination current, needed for ttf calculation */
        sensor_channel_get(fuelgauge_device, SENSOR_CHAN_GAUGE_DESIRED_CHARGING_CURRENT, &value);
        max_charge_current = (float)value.val1 + ((float)value.val2 / 1000000);
        term_charge_current = max_charge_current / 10.f;
    
        nrf_fuel_gauge_init(&parameters, NULL);
    
        ref_time = k_uptime_get();
    
        if (configure_npm1300_events() < 0) {
            return -1;
        }
    
        return 0;
    }
    

  • Are you able to see what part of this function that returns an error? Perhaps if you assign different return values for the different checks (for debugging purposes), and print the return value after the hal_fg_init() has returned? Which check is it that fails?

    Best regards,

    Edvin

  • Hi Edvin,

    so, the part that is failing is device_is_ready(fuelgauge_device) function returns sometimes false. statistically its one out a few resets process. Unfortunately, this happens although the device is ready, and removing this check solves the problem. We have the same issue with the IMU driver as well but much less often than the fuelgague.

    So, I'm wondering, is this check redundant? what is good for? should I remove this check for all of the drivers (we have quite a few of those checks)?

Related