Ultra low power mode Wp76xx

Hi everyone
I try to start the following application to test ultra low power mode on wp76xx module, here the code
void SwitchToLowPowerMode(void)
{
LE_INFO(“************** START ULTRA LOW POWER MODE **************”);

// Boot after 1000 second of shutdown.
LE_ERROR_IF(le_ulpm_BootOnTimer(1000) != LE_OK, "Can't set timer as boot source");
                        
// Boot if GPIO36 voltage level is high.
LE_ERROR_IF(le_ulpm_BootOnGpio(36, LE_ULPM_GPIO_HIGH) != LE_OK, "Can't set gpio36 as boot source");
                                
// Boot if GPIO38 voltage level is low.
LE_ERROR_IF(le_ulpm_BootOnGpio(38, LE_ULPM_GPIO_LOW) != LE_OK, "Can't set gpio38 as boot source");
                                               
// Initiate shutdown.
LE_ERROR_IF(le_ulpm_ShutDown() != LE_OK, "Can't initiate shutdown");

}

But when le_ulpm_ShutDown() is called i get an error that correspond to result LE_NOT_POSSIBLE.
Than i try to enable manually this mode by do the following commands:

cd /sys/module/swimcu_pm/boot_source/
echo 100 > timer/timeout
echo 1 > enable

Than the board is shutdown and after 100s exit from low power mode. I measure the power consumption and doesn’t change. Can anyone tell me what i’m wrong?

Hi @abalzano,

could you provide some logs from logread when you run that app?

Thanks

Hi @CoRfr,
Here some logs

Jan 6 00:23:14 swi-mdm9x28 user.debug Legato: DBUG | powerApp[3408]/framework T=main | le_ulpm_client.c DoConnectService() 363 | ======= Starting another client for ‘powerApp.powerComponent.le_ulpm’ service ========
Jan 6 00:23:14 swi-mdm9x28 user.info Legato: INFO | powerApp[3408]/powerComponent T=main | init.c SwitchToLowPowerMode() 6 | ************** START ULTRA LOW POWER MODE **************
Jan 6 00:23:14 swi-mdm9x28 user.debug kernel: [ 1070.583676] gpio-200 (sysfs): gpiod_request: status -16
Jan 6 00:23:14 swi-mdm9x28 user.err kernel: [ 1070.584057] i2c-msm-v2 78b8000.i2c: NACK: slave not responding, ensure its powered: msgs(n:1 cur:0 tx) bc(rx:0 tx:18) mode:FIFO slv_addr:0x3a MSTR_STS:0x081343c8 OPER:0x00000090
Jan 6 00:23:14 swi-mdm9x28 user.info kernel: [ 1070.602584] gpio_check_and_wake: wake-n_gpio26 STATE=WAKEUP
Jan 6 00:23:14 swi-mdm9x28 user.err kernel: [ 1070.615908] pm_set_mcu_ulpm_enable: ext pin wu fail 4
Jan 6 00:23:14 swi-mdm9x28 user.info kernel: [ 1070.681511] gpio_check_and_wake: wake-n_gpio26 STATE=WAKEUP
Jan 6 00:23:14 swi-mdm9x28 user.info kernel: [ 1070.717579] gpio_check_and_wake: wake-n_gpio26 STATE=SLEEP
Jan 6 00:23:14 swi-mdm9x28 user.err Legato: =ERR= | powerManagerService[687]/powerMgr T=main | le_ulpm.c WriteToSysfs() 146 | Error writing to sysfs file ‘/sys/module/swimcu_pm/boot_source/enable’ (Input/output error).
Jan 6 00:23:14 swi-mdm9x28 user.err kernel: [ 1070.722786] enable_store: invalid input 1 ret -5
Jan 6 00:23:14 swi-mdm9x28 user.err Legato: =ERR= | powerApp[3408]/powerComponent T=main | init.c SwitchToLowPowerMode() 18 | Can’t initiate shutdown

I don’t have devMode app installed.
If i try to set /sys/module/swimcu_pm/boot_source/enable manually the board initiate shutdown. Seems that Legato don’t have the permission to start this mode. The pwrManager is running.

Thanks

Hi @abalzano,

I tried with WP7607 using Release 9, I was able reproduce the issue. Though for me le_ulpm_ShutDown() is returning successfully(LE_OK), But actually shutdown is not happening.

Shutdown is not happening only when the GPIO 36 or 38 is used to boot on with voltage level high(LE_ULPM_GPIO_HIGH).

With voltage level low(LE_ULPM_GPIO_LOW) shutdown is happening successfully.

Regards,
Muralidhara N.

Hi @abalzano,

As i had said in my previous post, Only with voltage level low(LE_ULPM_GPIO_LOW) shutdown will happen and with voltage level high(LE_ULPM_GPIO_HIGH) shutdown is not happening , That’s because if you configure to boot on GPIO36/GPIO38 when the voltage level is high and then you attempt to shutdown while the voltage level is at the same level(high) you want it to boot on.

Please check the below mangoH forum link for more info on this:

I verified the below code where it is configured to boot on GPIO36 & GPIO38 when the voltage level is low on WP85 and Wp76 , With this shutdown happens without any issues:

COMPONENT_INIT
{

LE_INFO("************** START ULTRA LOW POWER MODE **************");

// Boot after 1000 second of shutdown.
LE_ERROR_IF(le_ulpm_BootOnTimer(1000) != LE_OK, "Can't set timer as boot source");
                    
// Boot if GPIO36 voltage level is high.
LE_ERROR_IF(le_ulpm_BootOnGpio(36, LE_ULPM_GPIO_LOW) != LE_OK, "Can't set gpio36 as boot source");
                            
// Boot if GPIO38 voltage level is low.
LE_ERROR_IF(le_ulpm_BootOnGpio(38, LE_ULPM_GPIO_LOW) != LE_OK, "Can't set gpio38 as boot source");
                                           
// Initiate shutdown.
LE_ERROR_IF(le_ulpm_ShutDown() != LE_OK, "Can't initiate shutdown");

}

Regards,
Muralidhara N.