It didn't work for me as well using PLC-M12 module, but I fixed it!
I found the code change of SetBusPowerMode() @felmue wrote, which did not work for my new core2 modules.
Dug into the datasheet and found GPIO0 connected to VBUSENABLE must be 0V.
In the code below the GPIO0 is set to open drain output(=pull down only) and set to Low=0V.
I've changed the AXP192.cpp file directly in C:\Users\user\OneDrive\Documents\Arduino\libraries\M5Core2\src
To make it work. Good luck.
// Select source for BUS_5V
// 0 : use internal boost
// 1 : powered externally
void AXP192::SetBusPowerMode(uint8_t state)
{
uint8_t data;
if (state == 0)
{
// Set GPIO to 3.3V (LDO OUTPUT mode)
data = Read8bit(0x91);
Write1Byte(0x91, (data & 0x0F) | 0xF0);
// Set GPIO0 to LDO OUTPUT, pullup N_VBUSEN to disable VBUS supply from BUS_5V
data = Read8bit(0x90);
Write1Byte(0x90, (data & 0xF8) | 0x02);
// Set EXTEN to enable 5v boost
data = Read8bit(0x10);
Write1Byte(0x10, data | 0x04);
}
else
{
// Set EXTEN to disable 5v boost
data = Read8bit(0x10);
Write1Byte(0x10, data & ~0x04);
// Set GPIO0 to low, enabling VBUS supply from BUS_5V
// GPIO0 open drain output
data = Read8bit(0x90);
Write1Byte(0x90, (data & 0xF8));
// set GPIO0 to 0
data=Read8bit(0x94);
Write1Byte(0x94,data&=~1);
}
}