How to I use Ultra Low Power mode in WP77xx

Hi,

I want to use Ultra Low Power in WP77xx / WP76xx

I try to use sample code and update it to wp77xx.
sample code is here:

void SwitchToLowPowerMode
(
    void
)
{
    char version[LE_ULPM_MAX_VERS_LEN+1];
 
    // Get ultra low power manager firmware version
    LE_FATAL_IF(le_ulpm_GetFirmwareVersion(version, sizeof(version)) != LE_OK,
        "Failed to get ultra low power firmware version");
 
     LE_INFO("Ultra Low Power Manager Firmware version: %s", version);
 
    // Boot after 1000 second of shutdown.
    LE_ERROR_IF(le_ulpm_BootOnTimer(10) != 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");
}

execute log:

root@swi-mdm9x28-wp:~# app start textLoc
root@swi-mdm9x28-wp:~# [  660.593136] i2c-msm-v2 78b8000.i2c: NACK: slave not responding, ensure its powered: msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0x3a MSTR_STS:0x001363c8 OPER:0x00000090
[  660.613187] swimcu_pm_wusrc_config: check statep->gpio_pin_mask 0x10001
[  660.633560] swimcu_pm_wusrc_config: failed to GPIO config 0x10001 (4)
[  660.650357] swimcu_psm_enable_attr_store: Failed to enable mode 6: -5
Jan  6 00:11:02 swi-mdm9x28-wp user.info Legato:  INFO | supervisor[1021]/supervisor T=main | app.c app_Start() 3377 | Starting app 'textLoc'
Jan  6 00:11:02 swi-mdm9x28-wp user.info Legato:  INFO | supervisor[1021]/supervisor T=main | app.c CreateFileLink() 1991 | Skipping file link '/legato/systems/current/apps/textLoc/read-only/lib/libComponent_textLocComponent.so' to '/legato/systems/current/appsWriteable/textL
Jan  6 00:11:02 swi-mdm9x28-wp user.info Legato:  INFO | supervisor[1021]/supervisor T=main | app.c CreateFileLink() 1991 | Skipping file link '/legato/systems/current/apps/textLoc/read-only/bin/textloc' to '/legato/systems/current/appsWriteable/textLoc/bin/textloc': Already
Jan  6 00:11:02 swi-mdm9x28-wp user.debug Legato:  DBUG | _UNKNOWN_[16941]/<invalid> T=main | _componentMain.c _textLocComponent_Init() 44 | Initializing textLocComponent component library.
Jan  6 00:11:02 swi-mdm9x28-wp user.debug Legato:  DBUG | _UNKNOWN_[16941]/framework T=main | le_mrc_client.c DoConnectService() 355 | ======= Starting client for 'textloc.textLocComponent.le_mrc' service ========
Jan  6 00:11:02 swi-mdm9x28-wp user.debug Legato:  DBUG | _UNKNOWN_[16941]/framework T=main | le_sms_client.c DoConnectService() 355 | ======= Starting client for 'textloc.textLocComponent.le_sms' service ========
Jan  6 00:11:02 swi-mdm9x28-wp user.warn Legato: -WRN- | _UNKNOWN_[16941]/framework T=main | LE_FILENAME le_fdMonitor_Create() 672 | FD Monitor object name 'textloc.textLocComponent.le_posCtrl' truncated to 'textloc.textLocComponent.le_pos'.
Jan  6 00:11:02 swi-mdm9x28-wp user.debug Legato:  DBUG | _UNKNOWN_[16941]/framework T=main | le_posCtrl_client.c DoConnectService() 355 | ======= Starting client for 'textloc.textLocComponent.le_posCtrl' service ========
Jan  6 00:11:02 swi-mdm9x28-wp user.debug Legato:  DBUG | _UNKNOWN_[16941]/framework T=main | le_pos_client.c DoConnectService() 355 | ======= Starting client for 'textloc.textLocComponent.le_pos' service ========
Jan  6 00:11:02 swi-mdm9x28-wp user.warn Legato: -WRN- | _UNKNOWN_[16941]/framework T=main | LE_FILENAME le_fdMonitor_Create() 672 | FD Monitor object name 'textloc.textLocComponent.le_ulpm' truncated to 'textloc.textLocComponent.le_ulp'.
Jan  6 00:11:02 swi-mdm9x28-wp user.debug Legato:  DBUG | _UNKNOWN_[16941]/framework T=main | le_ulpm_client.c DoConnectService() 355 | ======= Starting client for 'textloc.textLocComponent.le_ulpm' service ========
Jan  6 00:11:02 swi-mdm9x28-wp user.warn Legato: -WRN- | _UNKNOWN_[16941]/framework T=main | LE_FILENAME le_fdMonitor_Create() 672 | FD Monitor object name 'textloc.textLocComponent.le_bootReason' truncated to 'textloc.textLocComponent.le_boo'.
Jan  6 00:11:02 swi-mdm9x28-wp user.debug Legato:  DBUG | _UNKNOWN_[16941]/framework T=main | le_bootReason_client.c DoConnectService() 355 | ======= Starting client for 'textloc.textLocComponent.le_bootReason' service ========
Jan  6 00:11:03 swi-mdm9x28-wp user.info Legato:  INFO | textloc[16941]/textLocComponent T=main | textLoc.c _textLocComponent_COMPONENT_INIT() 383 | TextLoc started
Jan  6 00:11:03 swi-mdm9x28-wp user.info Legato:  INFO | textloc[16941]/textLocComponent T=main | textLoc.c SwitchToLowPowerMode() 364 | Ultra Low Power Manager Firmware version: 002.011

I have questions about log:

[  660.613187] swimcu_pm_wusrc_config: check statep->gpio_pin_mask 0x10001
[  660.633560] swimcu_pm_wusrc_config: failed to GPIO config 0x10001 (4)
[  660.650357] swimcu_psm_enable_attr_store: Failed to enable mode 6: -5

Does it not enable ultra low power mode ?

BTW I want to every 10 sec into ultra low power in loop.

suggest you to try with AT commands first:

AT!POWERWAKE 
AT!POWERMODE

Hi @jyijyi

Could you give me a sample?
I try it but it seems not work.
image

Does WP7702 / WP7607 not support Ultra Low Power mode ?

didn’t you need to set AT!POWERMODE according to AT command user guide?

you can also see here:

Note that ULPM entry takes some time to complete. Wake from ULPM is essentially a full boot that takes somewhere around 30 seconds. The boot process also requires a good deal of power, so while power consumption during ULPM mode is very low, the power cost of frequent UPLM entry and exit will likely outweigh power savings unless the ULPM duration is fairly long. Sierra has not published a “break even” guidelines.

Hi @dpinc ,

Thanks for the heads up.

Actually, I’d like to wake you up every 10 minutes.
Do you think OK for this?

Hi @jyijyi ,

I have a question about camera

Could I build uvc driver and put it into FX30?

Actually, I’d like to use USB camera.
How can I do this?

By the way I want to get linux image like yocto_wp76xx.4k.cwe or yocto_wp77xx.4k.cwe.

you can see this document for the UVC driver:

Hi @jyijyi ,

Thanks for your reply.
My question is that Can I build linux image from yocto and put it into FX30.


I just use this source and build it then put it into mangoh.
Are they the same?

you need to download the yocto source of FX30 with leaf tool.

Hi @jyijyi ,

I have a question about ULPM.

Which version support ULPM in WP76xx ?

I try to use it in R9 but it seems error.

And I try R12 is cannot wake up.

at!powerwake=1,10
at!powerwake=1,10
OK
at!powerwake?
at!powerwake?
!POWERWAKE:

OK

have you tried R16 or R13?

Hi @jyijyi ,

Not yet, because I want to use “swiflash -m wp76 -r -f”

you can go to R12, after using swiflash , and then back to R13 or R16 to test

Hi @jyijyi ,

OK. I got it R13 is worked.