Hi!
I'm testing the application with the custom Battery pofile I generated with nPM PowerUP app.
During testing I found the issue with the SOC value calcultation depending on the charger connection state.
In case the MCU (nRF5340) is reset while USB is connected (with active charger), the SOC is calculated as follows (using the nPM1300 sample from the SDK, NCS v2.6.2):
*** Booting nRF Connect SDK v3.5.99-ncs1-3 *** nRF Fuel Gauge version: 0.9.2 PMIC device ok V: 4.116, I: -0.163, T: 25.41, SoC: 7.56, TTE: nan, TTF: nan V: 4.116, I: -0.162, T: 25.41, SoC: 7.57, TTE: nan, TTF: nan V: 4.121, I: -0.162, T: 25.41, SoC: 7.59, TTE: nan, TTF: nan V: 4.121, I: -0.162, T: 25.41, SoC: 7.60, TTE: nan, TTF: nan
Yet in case the MCU is reset with USB disconnected, I get correct SOC predictions:
*** Booting nRF Connect SDK v3.5.99-ncs1-3 *** nRF Fuel Gauge version: 0.9.2 PMIC device ok V: 4.057, I: 0.007, T: 25.41, SoC: 100.00, TTE: nan, TTF: nan V: 4.057, I: 0.007, T: 25.41, SoC: 100.00, TTE: nan, TTF: nan V: 4.057, I: 0.007, T: 25.41, SoC: 100.00, TTE: nan, TTF: nan V: 4.062, I: 0.007, T: 25.41, SoC: 100.00, TTE: nan, TTF: nan V: 4.067, I: 0.007, T: 25.41, SoC: 100.00, TTE: nan, TTF: nan V: 4.140, I: -0.163, T: 25.41, SoC: 100.00, TTE: nan, TTF: nan V: 4.140, I: -0.163, T: 25.31, SoC: 100.00, TTE: nan, TTF: nan V: 4.135, I: -0.163, T: 25.41, SoC: 100.00, TTE: nan, TTF: nan V: 4.145, I: -0.163, T: 25.41, SoC: 100.00, TTE: nan, TTF: nan V: 4.140, I: -0.163, T: 25.41, SoC: 100.00, TTE: nan, TTF: nan V: 4.145, I: -0.163, T: 25.41, SoC: 100.00, TTE: nan, TTF: 9963
As you can see, according the the current direction in the log above, I've connected charger after the MCU reset and SOC value remains correct.
This issue leads to the incorrect device behavior during the OTA process, since it requires power supply to be connected (business logic) and perfroms reset to boot new FW.
Is there some bug of the algorithm or should I disable charger to call
nrf_fuel_gauge_init();and enable it again after that?
Thanks,
Anton