Now I can reliably produce the issue using my own app:
#include "Particle.h"
Serial1LogHandler log(115200, LOG_LEVEL_ALL);
SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(MANUAL);
//////////////////////////////////////////////
int myTestMode = 1; // 1 = API 2 = PMIC //
//////////////////////////////////////////////
void selectMode();
STARTUP( selectMode() );
void selectMode() {
if (myTestMode == 2) {
System.setPowerConfiguration(SystemPowerConfiguration().feature(SystemPowerFeature::DISABLE));
}
}
void setup() {
LOG(TRACE, "Application started.");
if (myTestMode == 1) {
LOG(TRACE, "Using system power manager API to configure PMIC.");
SystemPowerConfiguration conf;
conf.powerSourceMaxCurrent(900)
.powerSourceMinVoltage(5080)
.batteryChargeCurrent(1024)
.batteryChargeVoltage(4208)
.feature(SystemPowerFeature::PMIC_DETECTION);
System.setPowerConfiguration(conf);
}
if (myTestMode == 2) {
LOG(TRACE, "Using PMIC APIs to configure PMIC.");
PMIC pmic;
pmic.begin();
pmic.setInputVoltageLimit(5080);
pmic.setInputCurrentLimit(900) ;
pmic.setChargeVoltage(4208);
pmic.setChargeCurrent(0, 0, 1, 0, 0, 0);
pmic.enableDPDM();
pmic.enableBuck();
pmic.enableCharging();
}
PMIC pmic;
pmic.getVersion();
}
void loop() {
{
PMIC power(true);
LOG(TRACE, "Current PMIC settings:");
LOG(TRACE, "VIN Vmin: %u", power.getInputVoltageLimit());
LOG(TRACE, "VIN Imax: %u", power.getInputCurrentLimit());
LOG(TRACE, "Ichg: %u", power.getChargeCurrentValue());
LOG(TRACE, "Iterm: %u", power.getChargeVoltageValue());
int powerSource = System.powerSource();
int batteryState = System.batteryState();
float batterySoc = System.batteryCharge();
constexpr char const* batteryStates[] = {
"unknown", "not charging", "charging",
"charged", "discharging", "fault", "disconnected"
};
constexpr char const* powerSources[] = {
"unknown", "vin", "usb host", "usb adapter",
"usb otg", "battery"
};
LOG(TRACE, "Power source: %s", powerSources[std::max(0, powerSource)]);
LOG(TRACE, "Battery state: %s", batteryStates[std::max(0, batteryState)]);
LOG(TRACE, "Battery charge: %f", batterySoc);
LOG(TRACE, "");
}
delay(5000);
}
Both of the test modes using my app can produce the issue. But for test mode 2, charging can be resumed after released the EN pin.
The reason why I cannot reliably produce the issue is that I was connecting the Boron's UART TX/RX to my computer over a USB-UART bridge for debug purpose. There is power leakage on the RX pin, which may affect the MCU somehow even if the EN pin is pulled down.
Using the app that @Rftop provided above, I can produce the issue sometimes, and sometimes the charging LED just gave a shot and then kept off even if the EN pin is never pulled down after startup.
The log running my app for test mode 1:
0000000416 [app] application.cpp:64, setup(): TRACE: Application started.
0000000417 [app] application.cpp:67, setup(): TRACE: Using system power manager API to configure PMIC.
0000000438 [app] application.cpp:97, loop(): TRACE: Current PMIC settings:
0000000440 [app] application.cpp:98, loop(): TRACE: VIN Vmin: 4360
0000000446 [app] application.cpp:99, loop(): TRACE: VIN Imax: 3000
0000000449 [app] application.cpp:100, loop(): TRACE: Ichg: 1024
0000000457 [app] application.cpp:101, loop(): TRACE: Iterm: 4208
0000000461 [app] application.cpp:116, loop(): TRACE: Power source: battery
0000000468 [app] application.cpp:117, loop(): TRACE: Battery state: discharging
0000000479 [app] application.cpp:118, loop(): TRACE: Battery charge: 96.960938
0000005480 [app] application.cpp:97, loop(): TRACE: Current PMIC settings:
0000005481 [app] application.cpp:98, loop(): TRACE: VIN Vmin: 4360
0000005484 [app] application.cpp:99, loop(): TRACE: VIN Imax: 3000
0000005493 [app] application.cpp:100, loop(): TRACE: Ichg: 1024
0000005495 [app] application.cpp:101, loop(): TRACE: Iterm: 4208
0000005505 [app] application.cpp:116, loop(): TRACE: Power source: battery
0000005506 [app] application.cpp:117, loop(): TRACE: Battery state: discharging
0000005515 [app] application.cpp:118, loop(): TRACE: Battery charge: 96.960938
0000010525 [app] application.cpp:97, loop(): TRACE: Current PMIC settings:
0000010527 [app] application.cpp:98, loop(): TRACE: VIN Vmin: 5080
0000010533 [app] application.cpp:99, loop(): TRACE: VIN Imax: 900
0000010535 [app] application.cpp:100, loop(): TRACE: Ichg: 1024
0000010544 [app] application.cpp:101, loop(): TRACE: Iterm: 4208
Attach power supply on VUSB
0000010547 [app] application.cpp:116, loop(): TRACE: Power source: vin
0000010555 [app] application.cpp:117, loop(): TRACE: Battery state: charging
0000010566 [app] application.cpp:118, loop(): TRACE: Battery charge: 96.960938
0000015567 [app] application.cpp:97, loop(): TRACE: Current PMIC settings:
0000015568 [app] application.cpp:98, loop(): TRACE: VIN Vmin: 5080
0000015571 [app] application.cpp:99, loop(): TRACE: VIN Imax: 900
0000015580 [app] application.cpp:100, loop(): TRACE: Ichg: 1024
0000015582 [app] application.cpp:101, loop(): TRACE: Iterm: 4208
0000015591 [app] application.cpp:116, loop(): TRACE: Power source: vin
0000015593 [app] application.cpp:117, loop(): TRACE: Battery state: charging
0000015602 [app] application.cpp:118, loop(): TRACE: Battery charge: 96.960938
Pulled down the EN pin and power cycle the VUSB and then release EN:
0000000377 [net.pppncp] INFO: Creating PppNcpNetif LwIP interface
0000000378 [net.ppp.client] TRACE: PPP client initializing
0000000379 [net.ppp.client] TRACE: PPP phase -> 0
0000000389 [net.ppp.client] TRACE: PPP thread started
0000000393 [ncp.client] TRACE: Modem low level initialization OK
0000000398 [hal] TRACE: Heap: 48/166 Kbytes used
0000000415 [app] application.cpp:64, setup(): TRACE: Application started.
0000000416 [app] application.cpp:67, setup(): TRACE: Using system power manager API to configure PMIC.
0000000438 [app] application.cpp:97, loop(): TRACE: Current PMIC settings:
0000000440 [app] application.cpp:98, loop(): TRACE: VIN Vmin: 5080
0000000446 [app] application.cpp:99, loop(): TRACE: VIN Imax: 900
0000000449 [app] application.cpp:100, loop(): TRACE: Ichg: 1024
0000000457 [app] application.cpp:101, loop(): TRACE: Iterm: 4208
0000000461 [app] application.cpp:116, loop(): TRACE: Power source: vin
0000000468 [app] application.cpp:117, loop(): TRACE: Battery state: not charging
0000000471 [app] application.cpp:118, loop(): TRACE: Battery charge: 100.000000
0000005479 [app] application.cpp:97, loop(): TRACE: Current PMIC settings:
0000005480 [app] application.cpp:98, loop(): TRACE: VIN Vmin: 5080
0000005484 [app] application.cpp:99, loop(): TRACE: VIN Imax: 900
0000005492 [app] application.cpp:100, loop(): TRACE: Ichg: 1024
0000005495 [app] application.cpp:101, loop(): TRACE: Iterm: 4208
0000005504 [app] application.cpp:116, loop(): TRACE: Power source: vin
0000005506 [app] application.cpp:117, loop(): TRACE: Battery state: not charging
0000005514 [app] application.cpp:118, loop(): TRACE: Battery charge: 100.000000
0000010525 [app] application.cpp:97, loop(): TRACE: Current PMIC settings:
0000010526 [app] application.cpp:98, loop(): TRACE: VIN Vmin: 5080
0000010532 [app] application.cpp:99, loop(): TRACE: VIN Imax: 900
0000010535 [app] application.cpp:100, loop(): TRACE: Ichg: 1024
0000010544 [app] application.cpp:101, loop(): TRACE: Iterm: 4208
0000010547 [app] application.cpp:116, loop(): TRACE: Power source: vin
0000010554 [app] application.cpp:117, loop(): TRACE: Battery state: not charging
0000010565 [app] application.cpp:118, loop(): TRACE: Battery charge: 100.000000
0000398794 [app] application.cpp:97, loop(): TRACE: Current PMIC settings:
0000398795 [app] application.cpp:98, loop(): TRACE: VIN Vmin: 5080
0000398802 [app] application.cpp:99, loop(): TRACE: VIN Imax: 900
0000398803 [app] application.cpp:100, loop(): TRACE: Ichg: 1024
0000398813 [app] application.cpp:101, loop(): TRACE: Iterm: 4208
0000398815 [app] application.cpp:116, loop(): TRACE: Power source: vin
0000398824 [app] application.cpp:117, loop(): TRACE: Battery state: not charging
0000398835 [app] application.cpp:118, loop(): TRACE: Battery charge: 100.000000
Log when running test mode 2:
0000000283 [app] application.cpp:64, setup(): TRACE: Application started.
0000000283 [app] application.cpp:78, setup(): TRACE: Using PMIC APIs to configure PMIC.
0000000294 [app] application.cpp:97, loop(): TRACE: Current PMIC settings:
0000000296 [app] application.cpp:98, loop(): TRACE: VIN Vmin: 5080
0000000307 [app] application.cpp:99, loop(): TRACE: VIN Imax: 100
0000000308 [app] application.cpp:100, loop(): TRACE: Ichg: 1024
0000000318 [app] application.cpp:101, loop(): TRACE: Iterm: 4208
0000000319 [app] application.cpp:116, loop(): TRACE: Power source: unknown
0000000329 [app] application.cpp:117, loop(): TRACE: Battery state: unknown
0000000331 [app] application.cpp:118, loop(): TRACE: Battery charge: -1.000000
0000000340 [app] application.cpp:119, loop(): TRACE:
0000005343 [app] application.cpp:97, loop(): TRACE: Current PMIC settings:
0000005344 [app] application.cpp:98, loop(): TRACE: VIN Vmin: 5080
0000005345 [app] application.cpp:99, loop(): TRACE: VIN Imax: 500
0000005356 [app] application.cpp:100, loop(): TRACE: Ichg: 1024
0000005357 [app] application.cpp:101, loop(): TRACE: Iterm: 4208
0000005367 [app] application.cpp:116, loop(): TRACE: Power source: unknown
0000005372 [app] application.cpp:117, loop(): TRACE: Battery state: unknown
0000005378 [app] application.cpp:118, loop(): TRACE: Battery charge: -1.000000
0000005384 [app] application.cpp:119, loop(): TRACE:
I'll keep digging and post any finding here later.
Kind regards