I’m having a problem setting up ULPM to boot via GPIO. When I use the sample code listed in the Legato API I get the following error when I shut the device down. I’m using ULPM firmware version 002.004. If I change the LE_ULPM_GPIO_HIGH to LE_ULPM_GPIO_RISING I don’t get an error anymore but the device also won’t come out of shutdown when I apply 1.8V to GPIO 36. Any help would be greatly appreciated.
Nov 21 12:55:42 | powerManagerService[633]/powerMgr T=main | le_ulpm.c WriteToSysfs() 146 | Error writing to sysfs file ‘/sys/module/swimcu_pm/boot_source/enable’ (Input/output error).
Nov 21 12:55:42 | lowpower[1563]/LowPowerComponent T=main | LowPowerComponent.c _LowPowerComponent_COMPONENT_INIT() 23 | Can’t initiate shutdown
Here is the code I’m using:
COMPONENT_INIT
{
char version[LE_ULPM_MAX_VERS_LEN+1];
// Connect to service
le_ulpm_ConnectService();// 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(120) != 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”);sleep(60);
// Initiate shutdown.
LE_ERROR_IF(le_ulpm_ShutDown() != LE_OK, “Can’t initiate shutdown”);
}