WP85 ULPM App automatically get removed after 4 Boot cycles


#1

I had created an app to test ULPM with wake up on timer. I am using WP8548. Its working fine for 4 cycles of Shutdown and reboot. afterwards on 5th cycle boot up my app automatically got removed.The figure show my app running as ULP_testing_1. Also when I try to remove other 3 user apps,Its automatically getting reinstalled on the 5th cycle of ULPM boot up

Here is my Code…

#include “legato.h”
#include “interfaces.h”

//--------------------------------------------------------------------------
/**

  • Function Prototype
    */
    //--------------------------------------------------------------------------

void SwitchToLowPowerMode(void);

//--------------------------------------------------------------------------
/**

  • Variables Declarations
    */
    //--------------------------------------------------------------------------

le_timer_Ref_t ULPStartTimerRef = NULL;

//--------------------------------------------------------------------------
/**

  • ULP mode entering- system live delay timer Handler
    */
    //--------------------------------------------------------------------------

static void ULPSwitchingTimerHandler(le_timer_Ref_t timerRef){

LE_INFO("------------> Activating Ultra Low Power Mode<--------------");
SwitchToLowPowerMode();

//le_ulpm_BootOnTimer(60);
//le_ulpm_ShutDown();

}

//--------------------------------------------------------------------------
/**

  • ULP mode Function
    */
    //--------------------------------------------------------------------------

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(60) != LE_OK, "Can't set timer as boot source");
// Initiate shutdown.
LE_ERROR_IF(le_ulpm_ShutDown() != LE_OK, "Can't initiate shutdown");

}

//--------------------------------------------------------------------------
/**

  • ULP mode entering- system live timer
    */
    //--------------------------------------------------------------------------

static void SetupModbusPollingTimer()
{
ULPStartTimerRef = le_timer_Create(“ULPStartTimer”); //create timer
le_clk_Time_t interval = { 60, 0 }; //update every 60 seconds
le_timer_SetInterval(ULPStartTimerRef, interval); //Set delay
le_timer_SetRepeat(ULPStartTimerRef, 0); //set repeat to always
le_timer_SetHandler(ULPStartTimerRef, ULPSwitchingTimerHandler); //set callback function to handle timer expiration event
le_timer_Start(ULPStartTimerRef); //start timer
}

// Start App from here.

COMPONENT_INIT
{

LE_INFO("Ultra Low Power Testing.");

// Now check whether boot was due to timer expiry.
if (le_bootReason_WasTimer())
{
	LE_INFO("ULPM: Booted from timer.");
}
else{

	LE_INFO("ULPM: Booted from other reason.");
}

SetupModbusPollingTimer();

}


#2

I believe that the Legato system is rolling back because it thinks that the system is in a boot loop. Personally, I’m not a fan of this behavior because I think it does more harm than good. Please file a bug in the legato application framework.


WP85 app using dataRouter got automatically removed after restart
#3

Hi,

This roolback mechanism is indeed happening if the device resets too often during a probation period (which is several minutes by default). The probation period starts as soon as a new app/system is installed.
To workaround that you can:

  • install the devMode app, that reduces the probation period to 5s. You should have a DS notification for that when you connect to your device.
  • use the target update tool (http://legato.io/legato-docs/latest/toolsTarget_update.html) to mark the system “as good” after your app install. This will end the probation period.

#4

System roll back on boot loop was the issue.
I tried update tool (update --mark-good) to end probation period, as per daav’s suggestion and it was a success.
now my ULP mode test App is running without any problems.

Thank you daav and dfrey.