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.