Application no longer available after a certain time

Hi all,

I have the issue, that my application no available anymore after a certain time. app list command does not show it.
After first I download it into the module. It starts and works well. After few days, I dont know when
app list command does list it. It is not available. It seems the legato system removes the app.
What is wrong?
I using legato 18.6.3 / WP76.

Seems there is rollback.
Have you typed “update -g”?

Hi jyijyi,

when I type “update -g”, I get:
**ERROR: The probation period has already ended. Nothing

You need to type this after you download the app.
BTW, you can check if the system “mark-good” by the following:
root@swi-mdm9x28-wp:~# legato status
Systems installed:
6 [good] <-- current
Legato framework is running.

It is possible to get rollbacks even after an application is marked good.
The only way to completely remove the possibility of your app being removed is to compile a new ‘master firmware’ which includes your app.

Hi Shib,
what is master firmware?
How can I create that?

There is some information here:
https://docs.legato.io/latest/conceptsUpdates.html

That whole page is worth a read if you are planning on spending much time with Legato.
Otherwise the important information is here:
https://docs.legato.io/latest/conceptsUpdates.html#conceptsUpdates_Base

They change their terminology a bit between base and master firmware, but I believe that if you perform an update with a .cwe file it won’t be rolled back.

Personally I create a .spk file which includes a slightly customized linux + legato + my app which updates everything all at once. Using this approach I have never had a rollback, but when I started out having apps rollback that were marked good was a massive headache for me.

1 Like

Hi Shib,
it is possible to disable rollback?
I have modules on the field. When I tested my application, every thinks works well. Now the modules are on the field, and they have rollback.
On the documentation is motioned “When an application or system is installed the system is monitored for problems. If too many errors are encountered, the whole system is rolled back to where it was before the update occurred.”
How can I check if the errors are encountered?

I don’t think it is possible to disable rollback, and it would be ill advised.
Once you have a reliable base firmware, install that with a .spk before sending the units out in the field.
Once in the field, rely on probation periods and rollbacks, it is the best way to ensure reliable long term deployment while still allowing firmware changes.

I’m not sure what the best way would be to detect whether a rollback has occurred, perhaps interrogating the app version or system index?

1 Like

Hi Shib,
in the meantime I created my .spk file will with all components also my application.
When I use the swiflash, everything works well, my application also installed and works.
When I use fdt2.exe on windows, it seems my application does’t be flashed and doesn’t be installed. “app list” doesn’t list it.
Do you know why?

I use a linux VM so I don’t have any experience with fdt2.exe.

There is an application note for it which goes in to the command syntax, the only thing that I can think of trying is to add the -force argument.
If you let me know the command you tried I might be able to suggest something else.

Hi shib,

Ubunt:
I download my application bundle legato.cwe using swiflash
swiflash -m “wp76xx” -i /home/ae/Downloads/fw/te/legato.cwe

After downloadig, I see my application T_test1
root@swi-mdm9x28-wp:~# app list
T_Test1
atAirVantage
atQmiLinker
atService
audioService
avcService
cellNetService
dataConnectionService
fwupdateService
gpioService
modemService
portService
positioningService
powerMgr
qmiAirVantage
secStore
smsInboxService
spiService
tools
voiceCallService

Windows:
I use fdt2.exe to download my application bundle
fdt2.exe -f legato.cwe -force

After Downloading, I miss my application T_test1

root@swi-mdm9x28-wp:~# app list
atAirVantage
atQmiLinker
atService
audioService
avcService
cellNetService
dataConnectionService
fwupdateService
gpioService
modemService
portService
positioningService
powerMgr
qmiAirVantage
secStore
smsInboxService
spiService
tools
voiceCallService

A couple of things to try.

  • make sure you have the latest version of fdt2.exe
  • use an absolute path to your .cwe file - “C:\Users\me\legato.cwe”
  • update your windows drivers for your WP module - source.sierrawireless.com
  • generate an .spk instead of a .cwe

Otherwise I don’t have any ideas.

Hi AE_1,
Try greping for your app name in syslog. I suspect your application can’t start properly by the framework.
If your application uses resources that aren’t available at startup, then Legato won’t start it.
BR,
Chris

The app would still be present in the app list though, even if it has failed to start.
He mentioned that the app is installed and runs when using swiflash.

Hi @shib,
In one of your comments, you mentioned: “It is possible to get rollbacks even after an application is marked good.”

Could you please explain this further? What are the conditions that would cause rollback to occur on a good system?

BR,
Chris

1 Like

Hi cchenry,

my application started proberly by framework. I tested is, it works very well.
But on the field rollback happens. I blieve what shib mentioned. Even when you have application marked as good, rollback happens.

I haven’t looked in to the Legato source on this for a while, so I don’t remember the specifics.
If you grep “sysStatus_MarkBad” you can find some more information in the source code.

sysStatus_MarkBad is the name of the function that marks the current system as bad.

//--------------------------------------------------------------------------------------------------
/**
 * Mark the system "bad".
 */
//--------------------------------------------------------------------------------------------------
void sysStatus_MarkBad
(
    void
)
//--------------------------------------------------------------------------------------------------
{
    file_WriteStrAtomic(CurrentStatusPath, "bad", 0644 /* rw-r--r-- */);
}

If you want to emulate this from the command line, execute the command:

echo "bad" > /legato/systems/current/status

Hi AE_1,
Have you solved your issue?

If not, are you using any of the following:
• GPIOs: 36, 37, 38, 40, 41
• ADC2 and ADC3

Could you please supply the “legato version”? If you’ve manually installed your application the Legato version should append “_modified”. If rollback has occurred, then you won’t see this.

I’m wondering if you’re experiencing the faultLimit. This occurs when a resource that is no longer available is trying to be accessed by your application and the faultAction kicks in too often, resulting in the framework killing your application.

Could you provide a log from a device that is experiencing the rollback?

BR,
Chris